Windows 7 Virtualization with KVM

Revision as of 00:25, March 13, 2014 by Daniel Robbins (Talk)




Windows 7 Professional 32-bit running within qemu-kvm

KVM Setup


If you build your kernel from scratch, please see the KVM page for detailed instructions on how to enable KVM. These instructions also cover the process of emerging qemu, which is also necessary. Do this first, as described on the KVM page -- then come back here.


Before using KVM, be sure that your user account is in the kvm group so that qemu can access /dev/kvm. You will need to use a command such as vigr as root to do this, and then log out and log back in for this to take effect.

Prior to using KVM, modprobe the appropriate accelerated driver for Intel or AMD, as root:

# modprobe kvm_intel

Windows 7 ISO Images



Windows 7 Professional, 32-bit Edition is a free download but requires a valid license key for installation.


Create Raw Disk


$ cd
$ qemu-img create -f raw win7.img 30G


QEMU script




export QEMU_AUDIO_DRV=alsa 
-usbdevice tablet -soundhw ac97 -cpu host -vga vmware

Now, make the script executable:

$ chmod +x





For optimal performance, adjust the script so that the -smp option specifies the exact number of cores and threads on your system -- on non-HyperThreading systems (AMD and some Intel), simply remove the ,threads=X option entirely and just specify cores. Also ensure that the -m option provides enough RAM for Windows 7, without eating up all your system's RAM. On a 4GB Linux system, use 1536. For an 8GB system, 2048 is safe.

Starting Windows 7 Installation


$ ./



Enjoy your virtualized Windows 7 system!