DISCLAIMER: these notes reflect my knowledge and understanding of subjects, not the ultimate truth. Corrections are welcome


Virtualization notes

📅 2025-04-04 📄 source

Generic notes mostly about recurring issues with running Windows guest on Linux amd64 host with libvirt/KVM stack

Linux virtualization stack:

Note: processor virtualization extensions are often disabled by default in firmware, and virt-manager doesn't notify about it during VM creation, instead it silently creates VM which uses software virtualization known as "QEMU TCG" (as opposed to KVM which requires hardware support, can be seen in UI in "virtual hardware details" window/"overview" tab/"Hypervisor Detail"/"Hypervisor"), which works painfully slow and with issues with Windows guest

VirtIO devices and drivers, SPICE

By default new libvirt VM invokes qemu with options to emulate some real ancient devices such as storage/network/graphics/etc. controllers, for which typical OS like Windows has drivers included, but this emulation has significant overhead. VirtIO is "family" of "minimal overhead" virtual devices, "emulation" of which is basically reduced to minimal nessessary communication with respective host OS subsystems, but this requires custom drivers in guest OS. "virtio-win" is project providing collection of Windows drivers for these devices. It is primarily distributed as ISO image https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso (see also https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md )

https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Using_the_ISO

virtio-win-gt-x64.msi in virtio-win.iso is actual VirtIO drivers package for Windows x64, currently including:

Switching storage from SATA to VirtIO

SPICE

SPICE is the protocol which is used by VM viewer for interacting with VM. Typically guest OS itself knows nothing about it, additional "SPICE agent" guest software is needed for integration with host, giving such possibilities as:

virtio-win-guest-tools.exe in virtio-win.iso installs "QEMU Guest Agent" and "SPICE agent"

https://en.wikipedia.org/wiki/Simple_Protocol_for_Independent_Computing_Environments

https://www.spice-space.org/spice-for-newbies.html

Windows specific optimizations

There are many guides of performance optimization but they usually miss good explanation of what and why.

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html/configuring_and_managing_windows_virtual_machines/optimizing-windows-virtual-machines

Other

To make virt-manager request guest OS to resize its SPICE display device resolution to match current VM display presentation area in

Currently virt-manager has bug which causes VM display zoomed out with Wayland backend in Wayland env with display scaling, I force x11 backend via GDK_BACKEND=x11 env var.


Comments are not implemented, but you can create issue on GitHub or check existing ones

Return to index