Running Windows 10 in a VM on Linux Mint with KVM, QEMU, and Virt-Manager
I’ve recently switched over to Linux Mint from years of using Ubuntu as a desktop OS. So far, so good - it’s more than decent for a desktop distro, with the window manager Cinnamon taking less CPU and memory than it’s counterparts.
One of my first actions when (re)building is to create a set of VMs - one for study, one for work, one for <INSERT UNFINISHED PROJECT HERE>. Part of this is figuring out which hypervisor to use, which to date has been VMware Workstation. Unfortunately Broadcom’s acquisition has led to price increases impacting the overall support renewal invoice, and I’ve had to drop Workstation to save some $$$.
So virt-manager
to the rescue! It’s been a long time since I’ve used KVM but it was quite easy after a bit of google-fu. I did find, however, that no-one had a concise guide on setting up a Windows guest including drivers, so here’s something I whipped up.
Hope this helps you who stumbled here with a similar question. I’m assuming you’re trying to install Windows 10 like I was - but this same process would apply if you’re building Windows 11.
Prerequisites
This guide is based on the following assumptions. It might still help you if you’ve deviated from this garden path, though.
- You’re running Linux Mint 21 (amd64)
- Your CPU supports virtualisation (VT-x for Intel or AMD-V for AMD)
- You have virtualisation enabled in your BIOS/UEFI settings
Step 1: Download Required Files
- Windows ISO - grab this from Microsoft:
- The Virtio Drivers ISO - this will give you guest additions.
Step 2: Install KVM and Dependencies
Open a terminal and run the following commands to install KVM and its dependencies:
sudo apt-get update
sudo apt install -y qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager
sudo apt install -y qemu virt-viewer spice-vdagent ovmf
If you’re keen on running with a vTPM and Secure Boot, install swtpm.
sudo apt install -y swtpm swtpm-tools
After install, restart your system.
Step 3: Create a New Virtual Machine
- Open Virtual Machine Manager
- Go to File > New Virtual Machine
- Select “Local install media” and browse to the downloaded Windows ISO
- Choose your desired RAM and CPU settings (you can change these later)
- For storage, create a new volume with at least 60GB capacity
- On the final screen select “Customize the configuration…":
- Set the chipset to Q35
- Set the firmware to
UEFI x86_64:/usr/share/OVMF/OVMF_CODE_4M.ms.fd
- Change the NIC to use NAT and the virtio device model
- Set the SATA Disk 1 bus to VirtIO and cache mode to “writeback” for best performance
- Add the Virtio Drivers ISO as a CDROM device
- (If using TPM) Add a TPM device (emulated or passthrough) with version 2.0
- Click “Begin installation” to end this quest.
Step 4: Install Windows
- Hit a key to start the Windows installer if prompted.
- If no HDD is found during installation, load the following drivers from the Virtio Drivers CD:
- viostor > w10 > amd64
- NetKVM > w10 > amd64
- qxldod > w10 > amd64
- Finish the winstaller.
Step 5: Install Virtio Drivers in Windows
Once Windows is installed:
- Open the Virtio Drivers CD in the VM
- Run virtio-win-guest-tools.exe to install the drivers
That’s it! You now have a fully functional Windows VM running on your Linux Mint 21 system.
Sources
Thanks go to these folk.