Skip to main content

Virt-Manager - Windows Guest Clipboard, USB Redirection, and VirtIO Drivers (SPICE)

·657 words·4 mins· loading · loading · ·
kvm kvm qemu virt-manager spice virtio windows
Luke Taylor
Author
Luke Taylor
I like a lot of things

A note from Luke. Reference material, not a story. I had an AI research and draft this one.

Get the ISO
#

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso

Both persistent, always point at current (0.1.285 as of this writing). Don’t hardcode a version filename.

Attach it during install (for the disk driver)
#

Disk on a VirtIO bus means Windows Setup can’t see it until it has the driver.

  1. VM hardware view → Add HardwareStorage, set Device type to CDROM device, browse to virtio-win.iso.
  2. Boot the installer.
  3. At the disk screen, if nothing shows up, Load driver, browse the VirtIO CD, pick the matching folder, e.g. vioscsi\w11\amd64 (or viostor\... on the older block driver).
  4. Continue install normally.

SATA/IDE disk instead? Skip this entirely.

Switch the NIC to virtio
#

Default NIC model in virt-manager is often e1000e or rtl8139, an emulated card. Works, but leaves throughput and CPU overhead on the table compared to virtio-net.

  1. Shut the VM down.
  2. VM hardware view → NIC device → set Device model to virtio.
  3. Start the VM back up.

Windows needs the NetKVM driver for it to show up as a real adapter instead of an unknown device. virtio-win-guest-tools.exe (next section) installs it. Switching the NIC model after already running that installer works too, Windows picks up NetKVM automatically.

VMs with multiple vCPUs under sustained heavy transfer can also turn on multiqueue for virtio-net, spreading network processing across cores instead of pinning it to one. Not needed for normal desktop use.

Running virtio-win-guest-tools.exe after first boot
#

Run this from the mounted virtio-win.iso inside the guest.

virtio-win-guest-tools.exe

Installs the VirtIO driver MSI, the QEMU Guest Agent, and the SPICE agent (vdagent) in one pass. Reboot after.

Check the host side has the SPICE channel
#

vdagent only works if the VM has a channel for it. Usually auto-added with a SPICE display, worth checking on older VMs.

  1. VM hardware view → Add HardwareChannel.
  2. Set Device type to Spice agent (spicevmc). Name auto-fills to com.redhat.spice.0.
  3. Add, restart the VM.

Missing this channel means the agent installs fine, clipboard just silently does nothing.

Test it
#

Copy on host, paste in guest console. If it doesn’t work, check guest Task Manager → Services → spice-vdagent is running.

Optional folder sharing
#

Separate feature, via spice-webdavd.

  1. Shut the VM down.
  2. Add HardwareChannel, set Device type to webdav (spiceport), name it org.spice-space.webdav.0.
  3. Boot guest, install spice-webdavd (spice-space.org downloads, windows/spice-webdavd).
  4. In virt-viewer (not the plain console), go to File → Preferences → Share Folder, pick a directory.
  5. Shows up in Explorer under This PC as a WebDAV drive.

Optional USB redirection
#

Two different things share this name.

  • Redirecting a USB device on your Linux host into the guest. Handled by virt-manager, nothing installed in Windows. Add HardwareUSB Redirection, then from the running VM use Virtual Machine → Redirect USB Device.
  • UsbDk (spice-space.org, currently 1.0.22) is a client-side driver, only needed if you’re viewing this VM’s SPICE session from a Windows or macOS machine via virt-viewer/remote-viewer. Linux host viewing its own VM doesn’t need it.

Bottom line
#

virtio-win.iso (persistent links above), load the storage driver during setup if on VirtIO disk, virtio-win-guest-tools.exe after first boot, confirm the Spice agent (spicevmc) channel exists. Clipboard, resolution, and drivers in one pass.

Why not spice-guest-tools-latest.exe
#

spice-space.org also hosts a standalone installer at /download/windows/spice-guest-tools/spice-guest-tools-latest.exe. Its own directory listing shows the latest build at 9.7M, dated 2018-01-04. virtio-win-guest-tools.exe covers the same drivers and agent and is the one actively updated, so that’s what this post uses.

Background
#

Windows guests under QEMU/KVM don’t get clipboard sharing, USB redirection, or auto-resizing displays by default. Two things fix that.

  1. VirtIO drivers. NetKVM, vioscsi/viostor, Balloon, qxl/qxldod. Performance, and required just to see the disk during setup if it’s on a VirtIO bus.
  2. SPICE guest agent (vdagent). Clipboard sharing and resolution auto-sizing. Drivers alone don’t do this.

REFERENCES
#

https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/

https://github.com/virtio-win/virtio-win-pkg-scripts

https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Driver-installation

https://github.com/virtio-win/virtio-win-guest-tools-installer

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

https://computingforgeeks.com/install-virtio-drivers-windows/

https://www.spice-space.org/download.html

https://spice-space.org/download/windows/spice-guest-tools/

https://dausruddin.com/how-to-enable-clipboard-and-folder-sharing-in-qemu-kvm-on-windows-guest/