Qemu/KVM + Windows
In order to use certain software, I have to prepare a Win10 virtual machine. However, common virtual machine software (VMware / Parallels Desktop) has no Linux support, while VirtualBox is not powerful enough. That drove me to an alternative: QEMU-KVM.
This note shows how to successfully run Win10 as a guest in QEMU-KVM. I will not be too hacky, and most steps are done with GUI support.
The host system:
- OS: Linux Mint
- Intel VT-x enabled
Prerequisites
The first step is to install the required packages.
sudo apt install qemu-system libvirt-daemon-system libvirt-clients bridge-utils virt-manager virt-viewer spice-vdagent
Note: Different Linux distros may have different package names.
After the installation is finished, you may have to reboot your machine to enable the KVM connection. libvirt will also create a default virbr0 bridge interface.
Then you will have to download a Win10 installation image.
Finally, you need a Win10 VirtIO driver pack maintained by Fedora. Check here to download the latest version.
Create a New Virtual Machine
Open Virtual Machine Manager, select create a new virtual machine.
Then select local install media.
Load the local Win10 media and enter the target operating system: Microsoft Windows 10.
Adjust CPUs and memory allocation according to your own machine.
Load a storage volume as your whole-disk storage. Here you can create either a qcow2 volume or a raw image (with an img suffix). I choose a raw image because it is faster than the qcow2 format. If you prefer snapshot support, select the qcow2 format.
Finally, check Customize configuration before install and finish.
Customize Configuration Before Install
In Display Spice tab, change Type from Spice to VNC.
Here, you may wonder how to choose between the network sources. If you want your Win10 guest to be accessible by devices outside your host network, you may use Bridge mode. If not, the default NAT network is just fine.
Note: Win10 does not support VirtIO as a network card by default. After installation, you should install the VirtIO network card driver manually.
Click Add Hardware, and at the first entry, Storage, load your previously downloaded virtio-win-*.*.***.iso image as a CDROM device, as the following image shows.
The last customization is to adjust the boot option. The top one is SATA CDROM 1 (the main storage), followed by VirtIO Disk 1 (the Win10 installation image).
After all these customizations, click Begin Installation, and here we go!
Win10 Setup
During the ordinary Win10 setup, you will see a page where no available storage is shown. Here, you should load the drivers manually.
Then select E:\amd64\w10\viostor.inf.
We can proceed and finish the Win10 installation. When you see the classic Windows desktop, right-click the Win button and select Device Manager.
Expand Other Devices, right-click Ethernet Driver, and update the device driver.
And here, we have successfully run Win10 in QEMU-KVM!