February 7, 201511 yr I'm trying to install WHS 2011 as a VM. From what I've been reading, it's not possible to install to a qcow container so I'm trying to follow various guides around. Then stumbled upon this one from jbartlett on the forums here! Unfortunately I'm stuck at the first hurdle... Anyone know how best to run this command, qemu-img create -f raw WHS2011.img 160G I think once I've managed to create the img file I'll be good to go. I've tried using the plugin to create Raw, qcow & qcow2 but WHS2011 won't load the drivers to install to any of these and it's a well documented issue. Thanks for any help.
February 8, 201511 yr You need to telnet into the unRAID or have keyboard/video attached to the base linux OS to use these commands on the system itself. At this point, the graphical plugins don't support the type of VM image you want to use. If you aren't comfortable from the shell, I'm not sure I'd try this. You will want to create your image in an appropriate place, which is not a quick thing to describe.
February 8, 201511 yr Author Right, managed to sort it out, and the solution was staring me in the face the whole time. Feel a bit of an idiot as it was so obvious. Fired up a Linux Mint VM and mounted my KVM share. Opened a terminal and ran. sudo apt-get install qemu-utils Then in my KVM share from a terminal ran qemu-img create -f raw WHS2011.img 160G The rest is just following jbartlett's post with a few things changed to suit my config. So I want to say a big thank you to jbartlett, don't think I'd ever have got things going without his post. All of this is only to run an IIS Server while I try and get my head around Apache or Nginx! Damn you Windows!
February 8, 201511 yr Author You need to telnet into the unRAID or have keyboard/video attached to the base linux OS to use these commands on the system itself. At this point, the graphical plugins don't support the type of VM image you want to use. If you aren't comfortable from the shell, I'm not sure I'd try this. You will want to create your image in an appropriate place, which is not a quick thing to describe. I'm comfortable using SSH but I couldn't find the qemu commands location to run them. Care to share as you may have notice from my previous reply that I went somewhat round the houses to get to the solution and I'd prefer not to have to do all that again!
February 8, 201511 yr Author So thought I'd update this post with some XML files to help anyone else. Jbartlett has done a great job solving this one, but I find if I have a couple of xml files to peruse then it enables me to see which bits are relevant and generic and those that are specific to my install. Bit of background: My KVM folder is mounted on a non-array 250Gb SSD named aptly enough KVM, which is why I needed to create WHS2011.img on the cache drive as I didn't have enough space, due to WHS requiring a 160GB drive as a prerequisite to install. In summary what I did is: 1. Use a Linux VM Opened a terminal and ran. sudo apt-get install qemu-utils Then in my KVM share from a terminal ran qemu-img create -f raw WHS2011.img 160G Then I created my VM in the plugin in the normal way (I used q35) the relevant part I then posted in to get the VM to work was <os> <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/mnt/cache/WHS2011.img'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> I also altered the disk entry for the WHS2011.qcow2 file changing the target dev from hda to vda (Not sure if this is necessary but seemed sensible, so it looked like this. <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/mnt/disk/KVM/VM/WHS2011/WHS2011.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/> </disk> Then I booted the VM and installed WHS2011, along the way you need to install the virtio network drivers and balloon driver. Onceit was all installed, at this point I deviated a little from jbartlett's instructions as I already had a qcow2 hdd that had been created with the VM by the plugin and I left it in the XML file, so once WHS2011 was installed I could install the virtio SCSI driver straightaway. Meaning my WHS2011 install now had the ability to see qcow2 images. Once that's done, shutdown the WHS2011 VM. Then booted my Linux VM, mount the cache drive and open a terminal there and run qemu-img convert -O qcow2 WHS2011.img WHS2011.qcow2 That takes a while to run...... Once it's finished just copy over the WHS2011.qcow2 file overwriting the existing file, then remove the reference to the WHS2011.img disk, rename the target dev line in the qcow2 entry to this <target dev='hda' bus='virtio'/> Within the plugin change the boot device to HD and there you go... Once again this was all jbartlett's work, I'm just documenting the way I did it. Hope it helps someone along the way. I'm very new to KVM and still finding my feet so I figure there must be others like me out there so documenting the problems I have as I find them seems a good idea. Of course if anyone thinks it's spam then let me know and I'll stop!
February 8, 201511 yr Author Decided to do a bit more with my WHS2011 install. Firstly the VM was 160GB large, which I don't need, although the qcow2 img isn't that big initially I didn't like the idea of it getting out of hand. WHS partitions the disk into two parts C: OS Install - 60GB D: User Shares -100GB My plan was to try and shrink it down to a more manageable 40GB. Began by opening the dashboard in WHS and moving all the user shares to the OS disk. You get a warning that it's not recommended but just click through that. Then open computer management and go to Storage: Disk Management. Once there, delete the D partition. Shrink the C partition to a size smaller than you want your final partition size to be. eg. I wanted a 40GB final partition, so I shrunk C: to 25GB. I now have the System Reserved partition at 100MB, and a C: partition at 25GB and a lot of empty space. Shutdown the VM. Copy the qcow2 file to another location - I used my cache disk as you're about to need more space to convert it to a RAW file. I then used my Linux VM, mounted my cache drive and opened a terminal running qemu-img convert -O raw WHS2011.qcow2 WHS2011.raw I then shrunk the RAW file qemu-img resize WHS2011.raw -120G Then converted it back to qcow2 qemu-img convert -O qcow2 WHS2011.raw WHS2011.qcow2 I then copied the WHS2011.qcow2 file back to the VM folder for my WHS2011 install after renaming the original just in case. Booted it up, go back into Computer Management - Storage - Disk Management and extend your C partition to fill the empty space. Robert's your Mother's Brother! I've only tried this with WHS2011 but I don't see any reason why it wouldn't work with any other Windows OS. The only thing I have in the back of my mind is that this was a fresh install and hadn't been used other than to make all the changes I've documented in the thread thus far. I wonder if it was a heavily used VM whether the shrink command may truncate a file system if there was stuff written "towards the end of it" if you see what I mean...
Archived
This topic is now archived and is closed to further replies.