Windows runs well on KVM once it has the right drivers. This guide shows how to install a Windows VM on KVM with fast VirtIO storage and networking, UEFI and a virtual TPM, then prepare it for Remote Desktop.
Before you start
- A KVM host with libvirt; see install KVM on Ubuntu.
- A Windows Server or Windows 11 ISO and a valid licence.
- The
virtio-winISO from the Fedora project. - Packages
ovmf(UEFI firmware) andswtpm(virtual TPM) installed on the host.
Create the VM
virt-install --name win2022 --memory 8192 --vcpus 4 --cpu host-passthrough --machine q35 --boot uefi --tpm backend.type=emulator,backend.version=2.0,model=tpm-crb --disk path=/var/lib/libvirt/images/win2022.qcow2,size=80,bus=virtio --cdrom /var/lib/libvirt/images/windows-server-2022.iso --disk /var/lib/libvirt/images/virtio-win.iso,device=cdrom --network bridge=br0,model=virtio --os-variant win2k22 --graphics vnc,listen=127.0.0.1 --video qxl --noautoconsoleWindows Server 2022 does not strictly need TPM; Windows 11 does. Connect to the VNC console through an SSH tunnel (see SSH port forwarding).
Load VirtIO drivers during setup
- Boot the installer (press a key when prompted) and choose your edition.
- At Where do you want to install Windows? no disk is listed. Click Load driver → Browse.
- Open the virtio-win CD, then
viostor\2k22\amd64(match your Windows version). Select the Red Hat VirtIO SCSI controller. - The disk appears. Optionally load
NetKVMnow too, then continue the install.
Install guest tools
- After first login, open the virtio-win CD and run
virtio-win-guest-tools.exe. - This installs network, balloon, serial, display drivers and the QEMU guest agent.
- Check Device Manager for unknown devices.
Enable Remote Desktop
- Set a static IP in Network Connections if not using DHCP.
- Go to Settings → System → Remote Desktop (or Server Manager → Local Server) and enable it.
- Allow RDP only from your IPs; see Windows firewall rules with PowerShell.
- Install Windows updates and reboot.
Performance tips
- Use
host-passthroughCPU and add Hyper-V enlightenments (virt-install's win2k22 profile sets common ones). - Keep the disk on VirtIO with
cache=noneand enable discard for thin storage. - Disable unnecessary visual effects for RDP use.
Troubleshooting
- No disks during setup: load the viostor or vioscsi driver.
- "This PC can't run Windows 11": TPM 2.0, UEFI and Secure Boot are missing; use the
--tpmand--boot uefioptions with Secure Boot firmware. - No network after install: NetKVM driver not installed yet.
- Mouse pointer offset in VNC: add a USB tablet device.
Frequently asked questions
Can I install Windows on my KVM VPS myself?
If your provider allows custom ISOs, yes; see mount an ISO in Virtualizor. You must still license Windows.
Which virtio-win version should I use?
The latest stable release normally supports current Windows versions.
How much RAM does Windows Server need?
Microsoft lists minimums, but 4–8 GB is a practical starting point for a server with a GUI.
