Mapping a USB port to Xenserver

We’ve been using Xenserver for a while as our hypervisor platform but have always been frustrated that you could only map USB storage devices using Xencentre.

We had a client who needed to map a non storage USB device for licensing and certificates with HSBC, RBS & Lensware. This was time critical and we had no alternatives such as USB to Ethernet adapters (which havent been stable in the past anyway).

To map a local USB drive directly you need to carry out the following in the console:

First you need to find the uuid of the machine you want to passthrough the usb:

xe vm-list

It will return something like this:

uuid ( RO) : 3545ec72-eb9a-93cf-0837-ce295b722c01
name-label ( RW): YOUR MACHINE NAME
power-state ( RO): running

then get the usb hub address you want to passthrough:
lspci | grep USB
It will return something like this:
00:1 a.0 USB controller: Intel Corporation 6 Series/Intel USB Enhanced Host Controller
00:1 d.0 USB controller: Intel Corporation 6 Series/Intel USB Enhanced Host Controller
All you need to do now is combine and run the command:
xe vm-param-set other-config: pci = 0/000: 00:1 a.0 uuid = 3545ec72-eb9a-93cf-0837-ce295b722c01
to undo this:
xe vm-param-remove param-name = other-config param-key = pci uuid = 3545ec72-eb9a-93cf-0837-ce295b722c01
Hope this helps someone else!

 

Leave a Reply

Your email address will not be published. Required fields are marked *