Kvm/qemu: Trouble assigning USB Devices to a VM

Hi folks,
in my PC I have two GPUs (one integrated in the CPU and one dedicated), so I tried to use the dedicated one in a VM. Long story short, the GPU passthrough works, I’m using a separate Monitor connected to the GPU. Both, host and guest are running Fedora 42.

The USB-Keyboard, -mouse (Logitech MX vertical) and -micro/headset (msi gv60) are connected to a KVM Switch, which is this one:

What I thought was, that I can switch my 3 USB devices between guest and host back and forth, however this only works for the keyboard, not for the mouse, nor the microphone/headset.

Mouse and micro always change their - how’s it called? - USB connector id/index?


The keyboard, which is higlighted didn’t change it’s id and is two times present.
Micro and mouse only exist once, but as soon as I switch from “pc1” to “pc2” and vice versa, I have to remove the old, now unused devices from the device list and re-add them with the new index or what it is. The index id counted up and is now at 001:023 and 001:024.

What could I do?

It may help to compare the following cases:

  • When you properly configure USB redirection and it works as expected.
  • When you switch the devices and USB redirection fails.

Specifically, collect the host’s output for each case:

lsusb -v -v -t
virsh -c qemu:///system dumpxml fedora-gaming
virsh -c qemu:///system start fedora-gaming

If the VM fails to start, also include its startup log.
Upload the data to pastebin.com and link it here.