Dynamic USB passthrough using virsh USB passthrough can be a pain sometimes while using virt-manager. If the previously connected device isn’t connected at the time of starting the VM, it will refuse to boot at all complaining about a missing USB device. But manually adding & removing the USB device each time isn’t ideal, so let’s automate it! Components: Linux Host Windows VM USB device to pass from the host to the vm Python pyudev subprocess json virsh SystemD The idea Use udev to listen to usb events and pass that to the vm using virsh