Running Windows in a qemu virtual machine is very easy.
Install all required qemu packages.
jason@Yog-Sothoth:~$ sudo apt-get install qemu-kvm qemu-utils qemu |
Now we can create a virtual machine disk image to install our virtual machine onto.
jason@Yog-Sothoth:~$ qemu-img create -f raw win7.img 30G |
Some drivers are required, as Windows will not support the disk type that qemu uses. Download this ISO image and load it to provide the drivers needed for installation.
https://fedorapeople.org/groups/virt/virtio-win/deprecated-isos/stable/virtio-win-0.1-81.iso.
Select the “Load Driver” option.
Then select the proper SCSI driver here to allow Windows 7 to see the HDD.
And of course, a Windows ISO is required. I used Windows 7.
This is the updated script to run the whole virtual machine.
#!/bin/sh export QEMU_AUDIO_DRV=alsa DISKIMG=~/win7.img WIN7IMG=~/Downloads/win7.iso VIRTIMG=~/Downloads/virtio-win-0.1-81.iso qemu-system-x86_64 --enable-kvm -drive file=${DISKIMG},if=virtio -m 4096 \ -net nic,model=virtio -net user -cdrom ${WIN7IMG} \ -drive file=${VIRTIMG},index=3,media=cdrom \ -rtc base=localtime,clock=host -smp cores=4,threads=4 \ -usbdevice tablet -soundhw ac97 -cpu host -vga vmware |
When the installation gets to the disk selection stage, you will need to add a driver, then select the SCSI driver to enable Windows 7 to detect the disk to install to. After that it will work perfectly. Once installation has completed, and you have re-booted go to device manager and install drivers for the Ethernet adapter, these are on the same drive as the disk drivers. Then networking will work perfectly.
This is how easy it is to get Windows installed in a simple and fast VM on a Linux machine. This is very good for testing various things and running Windows software.