Getting Windows 7 running on KVM as a guest OS (Ubuntu LTS 12.04)

There are surprisingly few resources on this on teh intarwebs, so just some notes for my future self and anyone else attempting it. If you are wondering why I want to run a Windows 7 virtual machine - it's because we need a server to run the MiSeq reporter and RTA on, in order to reanalyse runs.

Make sure you belong to libvirt and kvm groups.

This gives you an 8-CPU virtual server with 24Gb of RAM ready to boot the Windows 7 installer DVD.

virsh 'destroy WIN7'
virsh 'undefine WIN7'
virt-install --connect qemu:///system \
--arch=x86_64 \
-n WIN7 \
-r 24000 \
--vcpus 8 \
--vnc \
--vnclisten 0.0.0.0 \
--noautoconsole \
--os-type windows \
--os-variant win7 \
--disk path=/home/nick/windows_partition \
--disk path=/home/nick/virtio-win-0.1-30.iso,device=cdrom,perms=ro \
--cdrom /home/nick/win7.iso \
--boot cdrom,hd \
--prompt

Virtio drivers via Fedora Project.

Update 30/07

To get 8 cores working correctly, you need to add a topology entry to the XML definition using virsh edit:

<cpu>
 <topology sockets='1' cores='4' threads='2'/>
</cpu>