Ctrl K

Windows 11 VM on Ubuntu with KVM/QEMU

UEFI based Windows 11 virtual machine on an Ubuntu host using QEMU/KVM, libvirt, and virt-manager.

Ubuntu virtualization stack for running Windows 11 as a guest: QEMU/KVM, libvirt, virt-manager, OVMF (UEFI), and TPM 2.0. Both UEFI firmware and TPM are required by Windows 11 and provided by this stack.

Verify CPU virtualization

Confirm the host CPU supports hardware virtualization. Output greater than 0 means the CPU supports it. If the count is 0, enable Intel VT-x or AMD-V in BIOS first.

egrep -c '(vmx|svm)' /proc/cpuinfo

Install the KVM stack

sudo apt update
sudo apt install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager
sudo systemctl enable libvirtd
sudo systemctl start libvirtd
sudo usermod -aG libvirt $USER

Log out and back in after usermod for group membership to take effect.

Verify KVM kernel modules are loaded. Output should include kvm_intel or kvm_amd depending on the CPU.

lsmod | grep kvm

Recommended VM configuration

Tested working configuration on a 12 core host with 32 GB RAM:

  • Memory: 16 GB
  • vCPU: 6
  • Disk: 100 GB, qcow2 (default)
  • Firmware: UEFI / OVMF
  • TPM: 2.0 (required for Windows 11)
  • CPU model: host-passthrough
  • Network: default libvirt NAT

Create the VM in virt-manager

virt-manager

Confirm Localhost (QEMU/KVM) shows Connected. Then:

  • Create new virtual machine, choose Local install media (ISO image)
  • Browse and select the Windows 11 ISO. Manually select Windows 11 if not detected automatically
  • Set memory and CPU per the recommended config
  • Set disk size to 100 GB, qcow2
  • Check Customize configuration before install before clicking Finish

Critical pre-install settings

Apply these in the customize view before starting the install. Each is required for Windows 11 to install and boot correctly.

  • Overview, Firmware: set to UEFI (OVMF)
  • CPUs, Model: set to host-passthrough
  • Add Hardware, TPM: add a TPM 2.0 device
  • Boot Options: CD-ROM first, Hard Disk second

Start the install

Click Begin Installation. When the boot prompt appears asking to boot from CD or DVD, press Space immediately or the VM will skip to the empty disk and fail to boot.

Proceed with the normal Windows installation.

Resources