@olivierlambert Sure thing!
Because I was passing through a USB Bluetooth dongle, I had to specifically create an "allow" entry in /etc/xensource/usb-policy.conf
.
- Run
lsusb
and identify the device to be passed through.
Bus 001 Device 002: ID 1b70:100f
Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 005: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0557:2419 ATEN International Co., Ltd
I happened to want to pass through the Cambridge Silicon Radio entry. Note the ID of 0a12:0001
. The format is vid:pid
that will come in handy later.
- Run
/opt/xensource/libexec/usb_scan.py -d
and runcat /var/log/user.log | grep "'idVendor': '<vid>'"
. I found the line that had:
Aug 1 11:56:24 ascension usb_scan.py DEBUG: UsbDevice: (u'1-12', {'idVendor': '0a12', 'ID_VENDOR_FROM_DATABASE': u'Cambridge Silicon Radio, Ltd', 'bConfigurationValue': '1', 'bDeviceClass': 'e0', 'ID_MODEL_FROM_DATABASE': u'Bluetooth Dongle (HCI mode)', 'version': ' 2.00', 'idProduct': '0001', 'bNumInterfaces': ' 2', 'serial': '', 'bcdDevice': '8891'})#012#011|__ UsbInterface: (u'1-12:1.0', {'bInterfaceNumber': '00', 'bInterfaceClass': 'e0', 'bInterfaceProtocol': '01', 'bInterfaceSubClass': '01'})#012#011|__ UsbInterface: (u'1-12:1.1', {'bInterfaceNumber': '01', 'bInterfaceClass': 'e0', 'bInterfaceProtocol': '01', 'bInterfaceSubClass': '01'})
but a different device would have a different line but similar content. Note down the 'bDeviceClass'.
- Edit the
/etc/xensource/usb-policy.conf
file and add
ALLOW:vid=<vid> pid=<pid> class=<bDeviceClass>
using the values from earlier.
- Rerun
/opt/xensource/libexec/usb_scan.py -d
and the USB Device should now be added.
Now to actually pass through the USB to the VM.
- Run
xe pusb-list
. My output is:
uuid ( RO) : f20850de-c998-5541-4d16-f06eccf87b40
path ( RO): 1-12
vendor-id ( RO): 0a12
vendor-desc ( RO): Cambridge Silicon Radio, Ltd
product-id ( RO): 0001
product-desc ( RO): Bluetooth Dongle (HCI mode)
serial ( RO):
version ( RO): 2.00
description ( RO): Cambridge Silicon Radio, Ltd_Bluetooth Dongle (HCI mode)
uuid ( RO) : 8560df9a-d712-687b-1f36-3ecd1c84dad1
path ( RO): 1-2
vendor-id ( RO): 0764
vendor-desc ( RO): Cyber Power System, Inc.
product-id ( RO): 0501
product-desc ( RO): CP1500 AVR UPS
serial ( RO):
version ( RO): 1.10
description ( RO): Cyber Power System, Inc._CP1500 AVR UPS
I actually have 2 USB devices but I didn't want to pass through the UPS. Note the UUID of the USB device: f20850de-c998-5541-4d16-f06eccf87b40
.
-
Run
xe pusb-param-set uuid=<uuid> passthrough-enabled=true
with the UUID from earlier. -
Shutdown the target VM.
-
Run
xe usb-group-list PUSB-uuids=<uuid>
. For me, output is:
uuid ( RO) : 316ac764-39fe-4120-0d6a-759ecb81a1ea
name-label ( RW): Group of 0a12 0001 USBs
name-description ( RW):
Note the group UUID of 316ac764-39fe-4120-0d6a-759ecb81a1ea
.
-
Run
xe vusb-create usb-group-uuid=<group_uuid> vm-uuid=<vm_uuid>
-
Run
xe vm-start uuid=<vm_uuid>
Those are the exact procedures I followed to try to get my USB passed through. Hope it will help troubleshoot!
For most devices, you probably don't have to do the first section. My UPS showed up perfect fine without the first section.