Linux guests on KVM get virtio for free — the drivers ship in the kernel and “just work.” Windows guests do not. Without the virtio drivers, a Windows VM falls back to emulated IDE for disks and rtl8139 for network — both slow, both with worse interrupt patterns. This article is the procedure to install the virtio drivers in a Windows guest: at install time (the Windows installer can’t see a virtio disk without them) and on an already-installed guest where you want to convert.
How to verify
The virtio drivers are shipped as an ISO by the Fedora project (the canonical source: virtio-win.iso). Confirm it’s accessible from your hypervisor’s storage pool.
# On the hypervisor
ls -la /var/lib/libvirt/images/virtio-win.iso 2>/dev/null || \
echo "download: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso"
# Check the guest XML to see what bus types and NICs it has
virsh -c qemu:///system dumpxml win-guest | xmllint --xpath '//disk | //interface' -
The disk’s bus='ide' and the interface’s <model type='rtl8139'/> are the symptoms of an unconverted guest. virtio replaces both with bus='virtio' (or virtio-scsi) and <model type='virtio'/>.
What’s happening
virtio is a paravirtualization standard — instead of emulating a real hardware device (an IDE controller, a Realtek NIC), the host exposes a simpler interface that the guest’s virtio driver speaks directly. The result: fewer trap-and-emulate cycles, less CPU overhead, much higher throughput. The drivers live in the kernel for Linux and in a separate signed package for Windows because Microsoft requires kernel-mode drivers to be signed.
The Fedora-built virtio-win.iso contains drivers for every Windows version from XP onward, plus optional installers for the QEMU Guest Agent (qemu-ga) and the balloon service. The drivers are WHQL-signed since 2018, so they install on locked-down Windows machines without driver-signing bypass.
The procedure
-
Install Windows from scratch, with virtio for the disk. Two CD-ROMs: the Windows ISO and the virtio-win ISO. The Windows installer doesn’t see the virtio disk until you point it at the driver:
<disk type='file' device='cdrom'> <source file='/iso/win2022.iso'/> <target dev='sda' bus='sata'/> </disk> <disk type='file' device='cdrom'> <source file='/var/lib/libvirt/images/virtio-win.iso'/> <target dev='sdb' bus='sata'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/win-c.qcow2'/> <target dev='vda' bus='virtio'/> </disk>On the “Where do you want to install Windows?” screen, click “Load driver,” browse the virtio-win CD to
viostor\<version>\amd64\, and loadviostor.inf. The virtio disk now appears. -
At the same time, load the NIC driver. During install (or right after first boot via Device Manager), load
NetKVM\<version>\amd64\netkvm.inffrom the virtio-win CD. The NIC starts working. -
Install the full driver set after Windows boots. Run the
virtio-win-guest-tools.exeinstaller from the virtio-win CD. This installs balloon, vioserial, viorng, the QEMU Guest Agent service, and the SPICE WDDM driver in one pass. Reboot when prompted. -
Convert an existing IDE-installed Windows guest to virtio. Windows won’t boot from a virtio disk if it has no virtio driver loaded — chicken-and-egg. The workaround:
a. Shut down the guest cleanly. b. Edit the XML to add a second small virtio disk (a 1-GiB scratch):
<disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/virtio-scratch.qcow2'/> <target dev='vdb' bus='virtio'/> </disk>c. Boot Windows. Device Manager will show “Unknown device” for the new virtio disk; install the driver from the virtio-win CD. Reboot. d. Shut down, edit the XML again — change the boot disk’s
bus='ide'tobus='virtio'(and update its target dev tovda). Remove the scratch disk. e. Boot. The system now uses virtio for the boot disk. -
Same conversion for the NIC. Less risky than the disk: add a virtio NIC alongside the legacy one, install the driver, configure IP, then remove the legacy NIC.
-
Install the QEMU Guest Agent. This is what enables
virsh shutdownto send a graceful Windows shutdown, and whatvirsh snapshot-create --quiesceuses to fsfreeze the Windows filesystem before snapshot. The installer is on the virtio-win ISO underguest-agent\. -
Verify from inside Windows. Device Manager → Storage controllers should show “Red Hat VirtIO SCSI controller” (or “Red Hat VirtIO Block Device”); Network adapters should show “Red Hat VirtIO Ethernet Adapter.”
services.mscshould show “QEMU Guest Agent” running.
Common pitfalls
- The
virtio-win.isolink sometimes points at “latest” which can include unsigned beta drivers; the “stable” subpath is the right one for production guests. - A Windows guest configured with virtio-blk for disk but no virtio NIC results in a network connection that is the slowest part of the stack — convert both.
- The QEMU Guest Agent service is essential for sane shutdown and snapshot — without it,
virsh shutdownfalls back to ACPI which Windows often ignores during user sessions. - Cloning a Windows VM that has virtio drivers installed and changing its disk bus to ide on the clone will produce a clone that BSODs on boot — keep the bus consistent.
- The balloon driver can interact badly with Windows memory pressure and SQL Server in particular — don’t run the balloon service in guests where you’ve sized memory deliberately; install the driver but leave the service stopped.
Stack Harbor’s Windows-on-KVM golden images come pre-converted to virtio — the Packer template installs the drivers, qemu-ga, and the guest tools, then sysprep’d for reuse. Clients who inherited IDE-installed Windows VMs from a legacy setup get them converted as part of Managed Operations, with the boot-disk swap rehearsed on staging first.