Last tested: Proxmox 9.0.3 / Kernel 6.14.8
This guide walks you through a clean, modern Windows 11 installation on a Linux host using KVM/QEMU + libvirt + virt-manager — with UEFI, Secure Boot, TPM 2.0, proper VirtIO drivers, and practical performance tuning.
You’ll also find:
- A full
virt-installCLI one-liner for terminal users- A separate, tested Windows XP section using legacy hardware emulation
- No Proxmox required (works on bare-metal Linux)
👉 For the Windows XP (legacy BIOS) section, jump here.
Why run Windows 11 on KVM?
Performance
Near-native CPU performance using KVM with paravirtualized VirtIO drivers and excellent disk I/O.
Clean Linux integration
Uses the upstream Linux virtualization stack (libvirt), portable across Ubuntu, Fedora, Arch, Debian, and openSUSE.
Modern security
UEFI firmware, Secure Boot capability, and TPM 2.0 via swtpm.
Flexibility
Snapshots and backups (qcow2), SPICE or RDP remoting, and optional GPU passthrough (VFIO) for 3D or gaming.
Prerequisites (host)
1) Hardware requirements
- Intel or AMD CPU with virtualization extensions (VT-x / SVM)
- Optional for passthrough: IOMMU (VT-d / AMD-Vi)
- Virtualization enabled in UEFI/BIOS
Quick checks (any distro)
# CPU virtualization flags (vmx for Intel, svm for AMD)
lscpu | grep -i virtualization || egrep -i "(vmx|svm)" /proc/cpuinfo | head
# KVM kernel modules present
lsmod | grep -E "kvm(_amd|_intel)?" || true
# Your user is in libvirt group (log out/in after adding)
groups $USER2) Required packages
Install the matching set for your distro.
Ubuntu / Debian
sudo apt update
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients virtinst virt-manager ovmf swtpm swtpm-tools bridge-utils
sudo usermod -aG libvirt $USER
sudo systemctl enable --now libvirtdFedora / RHEL / Alma / Rocky
# Fedora Workstation/Server
dnf -y groupinstall "Virtualization"
dnf -y install virt-install virt-manager edk2-ovmf swtpm
systemctl enable --now libvirtd
usermod -aG libvirt $USERArch / Manjaro
sudo pacman -S --needed qemu-full libvirt virt-manager virt-install edk2-ovmf swtpm
sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt $USERopenSUSE Leap/Tumbleweed
sudo zypper install -y qemu-kvm libvirt virt-manager virt-install ovmf swtpm
sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt $USERLog out/in (or reboot) so your user’s new
libvirtgroup membership takes effect.
Download the ISOs you’ll mount
- Windows 11 ISO (official) — download from Microsoft: https://www.microsoft.com/software-download/windows11
- VirtIO driver ISO (“virtio-win”) — official builds: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/
Save both ISOs to a convenient folder, e.g.
~/iso/.
Create the VM in virt‑manager (GUI path)
Basic wizard
- Open virt-manager → Create new VM
- Local install media (ISO) → select the Windows 11 ISO
- OS type: Windows 11 (or Windows 10 if not listed)
Firmware & machine type
- Firmware: UEFI x86_64 (OVMF)
- Secure Boot: Enable if available
- Machine type: Q35
CPU & memory
- vCPUs: 4 (adjust to your host)
- CPU model: Copy host CPU configuration (host-passthrough)
- RAM: 8 GB recommended (4 GB minimum)
Storage (recommended)
- Disk size: 64 GB+
- Format: qcow2
- Bus: SCSI
- Controller: VirtIO-SCSI
- Cache: None
- Discard: unmap (TRIM)
Attach VirtIO drivers
Before first boot:
- VM Details → Add Hardware → Storage → CDROM
- Attach the virtio-win ISO
Network, display, integration
- NIC model: virtio
- Display: SPICE
- Video: QXL
- Add QEMU Guest Agent channel:
org.qemu.guest_agent.0
TPM 2.0
- Add Hardware → TPM
- Backend: emulator
- Version: TPM 2.0
Install Windows 11
Start the VM.
At “Where do you want to install Windows?”:
- Click Load driver
- Browse the VirtIO ISO
- Select:
vioscsi → w11 → amd64 - Disk appears → select it → Next
First login & drivers
Inside Windows:
- Open the VirtIO CD
- Run virtio-win-guest-tools.exe
- Reboot when finished
This installs storage, network, ballooning, guest agent, and SPICE tools.
Verify Windows 11 requirements
Win + R→tpm.msc→ TPM 2.0 presentWin + R→msinfo32→ Secure Boot: On / Supported
CLI alternative: one‑shot virt-install
Adjust paths, CPU/memory, and bridge name. This example creates UEFI+Secure Boot+TPM2, VirtIO‑SCSI storage, and attaches both ISOs.
VMNAME=win11-kvm
ISO_WIN=/path/to/Win.11.Pro.22621.382.iso
ISO_VIRTIO=/path/to/virtio-win-0.1.285.iso
DISK=/path/to/$VMNAME.qcow2
qemu-img create -f qcow2 "$DISK" 100G
sudo virt-install \
--name "$VMNAME" \
--memory 8192 --vcpus 4 \
--cpu host-passthrough \
--machine q35 \
--os-variant win11 \
--graphics spice \
--video qxl \
--controller type=scsi,model=virtio-scsi \
--disk path="$DISK",bus=scsi,format=qcow2,cache=none,discard=unmap \
--cdrom "$ISO_WIN" \
--disk path="$ISO_VIRTIO",device=cdrom \
--network network=default,model=virtio \
--rng /dev/urandom
If your distro doesn’t support the
secureboot=onflag, enable Secure Boot from virt‑manager after creation: Overview → Firmware → Enable Secure Boot.
Performance & reliability tuning (post‑install)
- CPU model: Keep host‑passthrough for best performance and feature exposure.
- Disk: Use VirtIO‑SCSI with
discard=unmapto allow TRIM from the guest. In Windows, confirm TRIM: open Admin PowerShell →Optimize-Volume -DriveLetter C -ReTrim -Verbose - VirtIO Balloon: Installed by guest tools; allows the host to reclaim memory under pressure.
- QEMU Guest Agent: Ensure the Windows service is Running (services.msc) — improves shutdown, IP reporting, freeze/thaw for snapshots.
- RNG device: Add a VirtIO RNG (
virtio-rng) in virt‑manager (Add Hardware → RNG) to speed up crypto/initialization. - Backups: Prefer qcow2 images for internal snapshots; for external backups, shut down the VM or use host‑level snapshotting (LVM/ZFS/btrfs) plus guest agent quiesce.
Folder sharing options
SPICE WebDAV (easy): install spice‑guest‑tools in Windows (download: https://www.spice-space.org/download.html), then in your SPICE client map a shared folder (you should see a new network drive).
virtio‑fs (faster): new shared‑folder method with a Windows driver built on WinFsp. Add a virtiofs device in libvirt and install the Windows virtiofs driver/service: https://virtio-fs.gitlab.io/howto-windows.html
Optional: GPU passthrough (VFIO)
For gaming/3D/CUDA, pass a physical GPU into the VM using VFIO and OVMF (UEFI). High‑level checklist:
- Enable IOMMU in kernel args; reboot and verify groups.
- Bind the target GPU (and its audio function) to vfio‑pci.
- Add GPU and audio PCI devices to the VM; set video to none or a minimal display; plug your monitor into the passed‑through GPU.
- Install the vendor driver inside Windows.
This warrants its own article, but the above outline gets you pointed in the right direction.
Troubleshooting
| Issue | Fix |
|---|---|
| No disk during install | Load vioscsi/w11/amd64 |
| “This PC can’t run Windows 11” | Ensure TPM 2.0 + UEFI (+ Secure Boot) |
| Clipboard/mouse missing | Install spice-guest-tools |
| Poor 3D performance | Expected without GPU passthrough |
| VirtualBox conflict | Don’t run VirtualBox alongside KVM |
Update: Installing Windows XP on KVM/QEMU (Legacy BIOS Setup)
Several readers asked if the same KVM/QEMU setup used in this guide can be reused to install Windows XP.
Because Windows XP is a legacy operating system, it requires a different virtual hardware configuration.
Below is a tested, copy-paste–friendly script for installing Windows XP on an Ubuntu host using KVM/QEMU.
⚠️ This setup uses legacy BIOS, older chipset emulation, and XP-compatible devices. It is not suitable for Windows 10/11, but works reliably for Windows XP.
Windows XP – VM Creation Script
VMNAME=winxp-kvm
ISO_WIN=/home/mohammad/Downloads/winxp.iso
DISK=/home/mohammad/tmp/$VMNAME.qcow2
qemu-img create -f qcow2 "$DISK" 40G
sudo virt-install \
--name "$VMNAME" \
--memory 2048 \
--vcpus 2 \
--cpu pentium3 \
--machine pc \
--os-variant winxp \
--graphics spice \
--video cirrus \
--disk path="$DISK",bus=ide,format=qcow2 \
--cdrom "$ISO_WIN" \
--network network=default,model=e1000 Why this works
- Legacy BIOS
- i440fx chipset
- IDE storage (no drivers)
- E1000 NIC (native XP support)
- Cirrus VGA
- Pentium-class CPU
This avoids common XP boot and installer issues such as:
failed to load Boot00001- Missing disk during setup
- Setup freezing or reboot loops
Notes
- VirtIO drivers are not required for this setup
- Performance is lower than modern VirtIO-based VMs, but stability is significantly better
- Ideal for legacy software, testing, or nostalgia setups
Final takeaway
- Use the main guide for Windows 11 / modern Windows
- Use the legacy script above for Windows XP
- Mixing modern VM hardware with XP will not work
If this guide helped, share it — and if something breaks, drop a comment and we’ll debug it properly.
Mohammad Dahamshi is a skilled Embedded Software Engineer and web developer. With experience in C/C++, Linux, WordPress, and DevOps tools, he helps businesses solve technical challenges and build reliable digital solutions. Fluent in Arabic, Hebrew, and English, he also runs Saratec, offering web design and digital marketing services.

Thanks for the article but it’s not working for me. I’m running Kubuntu 24.04 LTS (KDE with Ubuntu 24.04.3) on an Intel i7-3770 which supports VT-x and have a functioning libvirt/kvm hypervisor which is running (when needed) recent Ubuntu VMs as well as an old Windows VM. I did run the “apt install …” just to be sure. “systemctl status libvirtd” shows enabled. Output from:
lscpu | grep -i virtualization || egrep -i “(vmx|svm)” /proc/cpuinfo | head
returns “Virtualization: VT-x”
lsmod | grep -E “kvm(_amd|_intel)?” || true
returns
kvm_intel 487424 0
kvm 1409024 1 kvm_intel
irqbypass 12288 1 kvm
I’m sudoed to root but my user (leroy) is a member of: leroy adm cdrom sudo dip plugdev lpadmin lxd sambashare libvirt
I used “qemu-img create -f qcow2 win11.qcow2 64G” to create the image in /var/lib/libvirt/images.
Using the above virt-install script which I modified to read:
virt-install \
–name “win11″ \
–memory 7839 –vcpus 4 \
–cpu host-passthrough \
–machine q35 \
–os-variant win11 \
–graphics spice \
–video qxl \
–controller type=scsi,model=virtio-scsi \
–disk path=”/var/lib/libvirt/images/win11.qcow2”,bus=scsi,format=qcow2,cache=none,discard=unmap,detect-zeroes=unmap \
–cdrom “/mnt/p7/Win11_24H2_English_x64.iso” \
–disk path=”/mnt/p7/virtio-win-0.1.285.iso”,device=cdrom \
–network network=default,model=virtio \
–rng /dev/urandom \
–tpm backend=emulator,model=tpm2 \
–boot uefi,secureboot=on
I (successively) got:
ERROR Unknown –boot options: [‘secureboot’] (removed “,secureboot=on”, retried getting)
ERROR Unknown –disk options: [‘detect-zeroes’] (removed “,detect-zeroes=unmap”, retried getting)
ERROR Unknown –tpm options: [‘backend’] (changed to “emulator,model=tpm-crb” per ‘man virt-install’, retried
getting)
ERROR unsupported configuration: TPM version ‘2.0’ is not supported
“dpkg -l | grep swtpm” returns (excess spacing removed)
ii libtss2-tcti-swtpm0t64:amd64 4.0.1-7.1ubuntu5.1 amd64 TPM2 Software stack library – TSS and TCTI ibraries
ii swtpm 0.10.1-2 amd64 Libtpms-based TPM emulator
ii swtpm-libs:amd64 0.10.1-2 amd64 Common libraries for TPM emulators
ii swtpm-tools 0.10.1-2 amd64 Tools for the TPM emulator
“dpkg -l ovmf” returns
ii ovmf 2024.02-2ubuntu0.4 all UEFI firmware for 64-bit x86 virtual machines
Thanks for your help, if you need more information feel free to email me.
Hey Leroy,
I removed some unsupported options, please try with the new script, also please make sure ‘–‘ and not ‘-‘ for the command options (double dashes).
Please le me know if you need help.
Nice guide! Is specific for Windows 11? I’d like to run way older games, so I’m thinking Windows XP here.
What tips on what would change in the guide?
Hey Francis,
Honestly I didn’t test it on other versions, will try to test with XP and update the post with the result 🙂
I tested the script for XP it didn’t work, XP is so old for this script.
I added a new section with another script for XP, take a look.
https://techlino.net/windows-11-on-kvm-qemu-with-virt%e2%80%91manager-sb_info-year-edition-a-complete-copy%e2%80%91paste-guide/#xp-script