In one of my previous posts I was writing about how I setup USB forwarding to a Xen guest by forwarding the whole USB controller. I used PCI pass-through method also known as PCI forwarding. I was able to see the USB controller and the USB device from the Xen guest.
Unfortunately the Xen guest was not stable. It would crash after half an hour, sometimes after two hours. I tried increasing the amount of RAM allocated to the guest, tried both paravirtualized and fully virtualized guests and the result was the same. The guest would crash.
I tried again to use USB forwarding and pass only a single USB device to the guest. After a few more attempts I noticed that I could “partially” forward the USB device itself to a fully virtualized guest (HVM) using this syntax:
usb=1
usbdevice="host:xxxx:yyyy"
The values for xxxx and yyyy are the vendor ID and product ID for the USB device. They can be found out by using the lsusb command. For example on my laptop lsusb produces this output:
Bus 007 Device 001: ID 0000:0000
Bus 005 Device 003: ID 0b97:7772 O2 Micro, Inc.
Bus 005 Device 002: ID 0b97:7761 O2 Micro, Inc.
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 009: ID 062a:0000 Creative Labs
Bus 004 Device 008: ID 413c:2002 Dell Computer Corp. SK-8125 Keyboard
Bus 004 Device 007: ID 413c:1002 Dell Computer Corp. Keyboard Hub
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
So if I wanted to forward the device Dell Computer Corp. SK-8125 Keyboard I’d put the following in the Xen guest configuration file:
usb=1
usbdevice="host:413c:2002"
Ok, so in theory this should have let me see the USB device in Xen guest. Well it did, kind of. One thing I noticed was that I was only able to see some output when running lsusb on the guest when the guest was started from command line using the xm create command. When starting the guest from Virtual Machine Manager GUI I’d see absolutely no USB devices in the guest. Second, even when starting the guest from command line I’d see this kind of output from lsusb:
Bus 001 Device 001: ID 0000:0000
So it looks like something was being forwarded to the guest but it wasn’t the device I wanted to export. It looks like USB pass-through works on Xen only with some USB devices. That matches with what I’ve read at xgu.ru.
The final result – at the moment I’m using the USB device from the physical host. At least until I have time to look at it again.
Print This Post


I have been trying to get USB passthrough to work for a Windows HVM. I have to use the PCI passthrough method because the USB passthrough method does not allow for hot-plugging devices in and out. Right now I can’t get the Windows HVM to properly detect the USB Controller. It finds the controller, but it can’t get the drivers to work. I am going to try to get a standard USB PCI card to detect, but I was wondering if you had any recomendations for just getting the PCI passthrough up and running. Thanks.
Dear Mike,
I must admit all I have written in my several posts on the topic is all I know on the matter. Do let me know if you find an answer to your question somewhere else.
[...] and reading, I found the magic configuration lines to add. I also found another blog entry (http://www.olivetalks.com/2008/02/03/usb-forwarding-on-xen-it-just-does-not-work/) saying it wouldn’t work right. But I forged on, confident that even if it didn’t work [...]
[...] There’s device level forwarding, but I need to forward two devices, this here doesn’t say how to do it: http://www.olivetalks.com/2008/02/03/usb-forwarding-on-xen-it-just-does-not-work/ [...]
USB forwarding on Xen: forwarding a single USB device…
In one of my previous posts I was writing about how I setup USB forwarding to a Xen guest by forwarding the whole USB controller. I used PCI pass-through method also known as PCI forwarding. I was able to see the USB controller and the USB device from …
[...] There’s device level forwarding, but I need to forward two devices, this here doesn’t say how to do it: http://www.olivetalks.com/2008/02/03/usb-forwarding-on-xen-it-just-does-not-work/ [...]