As a continuation of a previous article on using KVM/Qemu from the command line, here are some simple instructions for installing Microsoft Windows 10 in a KVM/Qemu Virtualization environment.
To start, a Windows 10 installation ISO will be required from, for example: Windows 10 ISO. Also, to improve the response of Windows 10 in a KVM/Qemu environment, and to be able to read the local drives, the latest binary virtio drivers are required.
# qemu-img create -f raw images/win10.img 25g # qemu-system-x86_64 \ -drive id=disk0,format=raw,file=images/win10.img,if=virtio \ -drive file=/var/local/downloads/Win10_1803_English_x64.iso,index=1,media=cdrom \ -drive file=/var/local/downloads/virtio-win-0.1.171.iso,index=2,media=cdrom \ -enable-kvm \ -m 4096 \ -cpu host \ -smp cores=2,threads=4 \ -name win10 \ -net nic,model=virtio \ -net tap,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-win10-v90 \ -rtc base=localtime,clock=host \ -usb -device usb-tablet \ -vga virtio \ -no-reboot \ -boot d
The above is used for the initial install. When Windows wants to reboot, remove the last two lines. For this example, this is a continuation of the previous environment where it uses an Open vSwitch script to attach the tap device to the OVS bridge via a vlan.
Network drivers will need to be installed from the virtio cd in directory NetKVM/w10/amd64.
Other interesting links:
- virt-installs/win10uefi.sh - found via Any secrets to installing Win10 onto QEMU+KVM virtual machine ? on reddit
- Windows 10 Virtualization with KVM - mentions the installation of the network card driver
- Installing Windows 10 on KVM (with Fedora Core) uses a virt-install mechanism but mentions Spice and QXL drivers for the display
- High KVM/QEMU CPU utilization when Windows 10 guest is idle talks about some performance tools for optimizing cpu utilization. When using the GUI managers, some extra options are enabled, which I have not enabled in my example above.
- Running Windows 10 on Linux using KVM with VGA Passthrough which is a very interesting article about how to configure pass-through devices in order to supply a guest with direct access to certain hardware devices.
Some of the perf commands from before:
perf kvm --host top -p `pidof qemu-system-x86_64` perf stat -e 'kvm:*' -a -- sleep 1 perf kvm --host stat live