Install Windows Server 2008 on KVM/VirtIO

An example how to install a Windows Server 2008 guest on KVM with VirtIO (on a LVM volume in the example). Besides the installation medium you need the VirtIO drivers for windows in order to be able to access the disk device. You can get signed binary drivers here. Then set up a Windows VM with a command like this:

$ virt-install --connect qemu:///system --arch=x86_64 -n win2k8 -r 1024 --vcpus=2 
--disk pool=vmstore,size=50,bus=virtio,cache=none -c /path/to/win2k8.iso --vnc 
--noautoconsole --os-type windows --os-variant win2k8 --network network=subnet,model=e1000 
--disk path=/path/to/virtio-win-1.1.16.iso,device=cdrom,perms=ro

When the guest is running, shut it down and edit the os section of the XML file to look like this (otherwise Windows setup won’t let you install on the disk):

$ virsh destroy win2k8
$ virsh edit win2k8

Change the XML as follows:

  <boot dev='cdrom'/>
  <boot dev='hd'/>

Start the guest again:

$ virsh start win2k8

Connect to the VNC console and start the installation process. When you reach the form to select a disk device you won’t see any devices available. Click on “Load drivers” at the bottom left and load the drivers from E:\viostor\wlh{amd64|x86}. After the drivers are installed, you’ll see a disk device and can continue with the installation.