Running Windows 10 in a VM on Linux Mint with KVM, QEMU, and Virt-Manager

Posted on May 5, 2024

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.

there's so much space! for activities!

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.

  1. You’re running Linux Mint 21 (amd64)
  2. Your CPU supports virtualisation (VT-x for Intel or AMD-V for AMD)
  3. You have virtualisation enabled in your BIOS/UEFI settings

Step 1: Download Required Files

  1. Windows ISO - grab this from Microsoft:
    1. Windows 10, or
    2. Windows 11
  2. 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

  1. Open Virtual Machine Manager
  2. Go to File > New Virtual Machine
  3. Select “Local install media” and browse to the downloaded Windows ISO
  4. Choose your desired RAM and CPU settings (you can change these later)
  5. For storage, create a new volume with at least 60GB capacity
  6. 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
  7. Click “Begin installation” to end this quest.

Step 4: Install Windows

  1. Hit a key to start the Windows installer if prompted.
  2. 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
  3. Finish the winstaller.

Step 5: Install Virtio Drivers in Windows

Once Windows is installed:

  1. Open the Virtio Drivers CD in the VM
  2. 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.