Jump to content
kingfetty

VM USB Passthrough Multiple Devices with the same Vendor/Product

19 posts in this topic Last Reply

Recommended Posts

If you have multiple USB devices with the same Vendor and Product then the passthrough does not work as the UI currently builds the XML file with USB based on the Vendor / Product and not the Address Bus= Device=  syntax.  Since this is the case if you attempt to passthrough any usb devices that have duplicate Vendor/Product you will not be able to start your VM.

 

The workaround is to manually edit the xml to the Address syntax.

 

Examples:

 

Bus 011 Device 003: ID 08bb:2704 Texas Instruments Audio Codec

Bus 011 Device 002: ID 08bb:2704 Texas Instruments Audio Codec

 

 

Current Syntax:

 

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source >
        <vendor id='0x08bb'/>
        <product id='0x2704'/>
      </source>
     </hostdev>

 

This will result in a non booting VM

 

 

Fixed Syntax:

 

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <address bus='11' device='2'/>
      </source>
    </hostdev>

Share this post


Link to post

Thanks for posting this. For anyone else following this, you can get the Bus and Device numbers from Tools / System Devices.

 

Share this post


Link to post

If you have multiple USB devices with the same Vendor and Product then the passthrough does not work as the UI currently builds the XML file with USB based on the Vendor / Product and not the Address Bus= Device=  syntax.  Since this is the case if you attempt to passthrough any usb devices that have duplicate Vendor/Product you will not be able to start your VM.

 

The workaround is to manually edit the xml to the Address syntax.

 

Examples:

 

Bus 011 Device 003: ID 08bb:2704 Texas Instruments Audio Codec

Bus 011 Device 002: ID 08bb:2704 Texas Instruments Audio Codec

 

 

Current Syntax:

 

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source >
        <vendor id='0x08bb'/>
        <product id='0x2704'/>
      </source>
     </hostdev>

 

This will result in a non booting VM

 

 

Fixed Syntax:

 

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <address bus='11' device='2'/>
      </source>
    </hostdev>

 

As this isn't really a defect report, but rather, a workaround to solving a current limitation, I'm going to move this thread to the KVM Hypervisor forum (and maybe sticky thread it) so folks see it there.  This isn't really a bulletproof solution either, as reboots can cause the bus/device addresses to change sometimes.

Share this post


Link to post

This isn't really a bulletproof solution either, as reboots can cause the bus/device addresses to change sometimes.

You are correct, as I have learned the hard way. In my case I am using a USB to serial adapter. So how do I add a second one? Any thoughts?

Share this post


Link to post

 

 

This isn't really a bulletproof solution either, as reboots can cause the bus/device addresses to change sometimes.

You are correct, as I have learned the hard way. In my case I am using a USB to serial adapter. So how do I add a second one? Any thoughts?

 

Use a different vendor / brand for the second one.

 

The issue here is that it's an unsolvable problem due to the fact that USB devices (in general) are not required to contain a GUID (globally unique identifier).  The physical ports on the system do not map to a specific number for bus/address either, so race conditions ultimately end up deciding which bus/address each device gets assigned upon rebooting the system.  Sometimes you'll get lucky and the same bus/address gets mapped every time, but other times, this just won't happen.

 

For devices that do contain a GUID (such as some flash storage devices), we could (in the future) find a way to seek for that identifier and use it to identify the bus/address for a device and map that to a specific VM each time the system is booted, but other than for storage devices, I haven't yet found one that has a GUID (although admittedly I've only had a handful of devices to test with).

 

Generally speaking, I don't see this as a huge issue.  Is it annoying that you can't use multiple of the same devices?  Sure.  Is it the end of the world to have to purchase an alternative?  Not by a long shot.

Share this post


Link to post

I am trying to get 2 xbox one controllers on the VM but as they have the same vendor/product ID i tried this:

 

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <address bus='1' device='9'/>

      </source>

      <alias name='hostdev1'/>

    </hostdev>

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <address bus='1' device='8'/>

      </source>

      <alias name='hostdev2'/>

    </hostdev>

 

However the second device shows up in windows as an unknown device.

Share this post


Link to post

I am trying to get 2 xbox one controllers on the VM but as they have the same vendor/product ID i tried this:

 

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <address bus='1' device='9'/>

      </source>

      <alias name='hostdev1'/>

    </hostdev>

    <hostdev mode='subsystem' type='usb' managed='yes'>

      <source>

        <address bus='1' device='8'/>

      </source>

      <alias name='hostdev2'/>

    </hostdev>

 

However the second device shows up in windows as an unknown device.

 

Ohh crap, I have not had the need to plug in and assign my second Xbox one controller, had not thought of that issue.... Perhaps will HAVE to just pass an entire PCIe USB card through

Share this post


Link to post

I cant get this walkaround to work.

 

My USB Devices:

 

Bus 002 Device 009: ID 0951:1666 Kingston Technology DataTraveler G4
Bus 002 Device 005: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 008: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard
Bus 002 Device 029: ID 17ef:6019 Lenovo 
Bus 002 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 006: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard
Bus 002 Device 028: ID 17ef:6019 Lenovo 
Bus 002 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

 

My modifyed XML:

 

    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <address bus='2' device='29'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <address bus='2' device='8'/>
      </source>
    </hostdev>

 

Then i get this error: internal error: Did not find USB device bus:2 device:29

 

Edit: I use UNRAID 6.1.9 64bit

Please help!

Thanks :)

Share this post


Link to post

I found out why i get the error, but i have no qlue how to walk around this.

 

My keyboards stays at the same device number.

But my lenovo mouse's gets a new device number every 1-2minute... why?

 

I have 1 usb hub for each setup. 1 hub with mouse and keyboard and another hub with a mouse and keyboard.

 

I thought maby the mouse got a new device number because it might disconnect and reconnect. But the keyboard are on the same usb hub and they dont get new device number.

 

please help, thanks :)

Share this post


Link to post

As far as I can see, editing the VM through the UI will "undo" the changes to the XML file.

 

Wouldn't USB assignment on a port level be a better choice than the current one? I just assume that this is an issue most people will face eventually. If you for example add two Logitech unifying receivers or Xbox360 adapters they will obviously have the same name. I assume most people would rather use specific ports for VMs instead of having to worry about this issue?

 

Edit: Some sort of setting on the VM page that toggles the format vendor/product or address would be awesome.

Share this post


Link to post

I think this might be the reason my VM wont start. Well it starts from the WEB console, but i get no Image on the Monitor that would boot the Windows 10 iso.

I have to roccat nyths mouse, one black one White, but i think they might have similar ids, and two Keyboards, Asus Rog Horus, and Asus Rog Horus RGB. The Keyboards, are the same, but one has rgb, so ids might be different. The keboards have also each 2 usb ports, and These two ports might also be hubs.

 

I also have a PCI express 4 port usb 3.0 Card, and each port has ist own Fresco Chipset, so its not a Hub.

However this is not assignable to the VM

 

I wanted to know, is there a way to verify if the USB devices have a GUID, and if they indeed have one, could we bind the devices by GUID to the specific VMs ?

Share this post


Link to post
On 9/8/2015 at 6:09 AM, jonp said:

 

 

 

 

Use a different vendor / brand for the second one.

 

The issue here is that it's an unsolvable problem due to the fact that USB devices (in general) are not required to contain a GUID (globally unique identifier).  The physical ports on the system do not map to a specific number for bus/address either, so race conditions ultimately end up deciding which bus/address each device gets assigned upon rebooting the system.  Sometimes you'll get lucky and the same bus/address gets mapped every time, but other times, this just won't happen.

 

For devices that do contain a GUID (such as some flash storage devices), we could (in the future) find a way to seek for that identifier and use it to identify the bus/address for a device and map that to a specific VM each time the system is booted, but other than for storage devices, I haven't yet found one that has a GUID (although admittedly I've only had a handful of devices to test with).

 

Generally speaking, I don't see this as a huge issue.  Is it annoying that you can't use multiple of the same devices?  Sure.  Is it the end of the world to have to purchase an alternative?  Not by a long shot.

Well I am afraid I have to contradict. We are using unRaid's hypervisor funtions to run multiple VMs as testrigs. Unfortunately some software we are using requires hardware licenses (usb dongles , WIBU CodeMeter-Stick). Obviously we are not able to purchase alternatives. The only option left for us is using the address to assign these dongles individually which comes with the flaws mentioned before.

However each dongle offers an individual identification in the form of WIBU_-_CodeMeter-Stick_00000******* (the stars represent individual numbers for each dongle). This name shows in the Main-Tab only. In the properties of each VM one can only see "WIBU-Systems AG CmStick (MSD, article no. 1001-xx-xxx) (064f:03e9)" for each dongle.

I have seen that this topic originates in 2015. We are running unRaid 6.7.0 and still have this issue. Is there anything in the roadmap that will address this issue in any way?

 

Cheers

Max

Share this post


Link to post
38 minutes ago, craptec said:

Well I am afraid I have to contradict. We are using unRaid's hypervisor funtions to run multiple VMs as testrigs. Unfortunately some software we are using requires hardware licenses (usb dongles , WIBU CodeMeter-Stick). Obviously we are not able to purchase alternatives. The only option left for us is using the address to assign these dongles individually which comes with the flaws mentioned before.

However each dongle offers an individual identification in the form of WIBU_-_CodeMeter-Stick_00000******* (the stars represent individual numbers for each dongle). This name shows in the Main-Tab only. In the properties of each VM one can only see "WIBU-Systems AG CmStick (MSD, article no. 1001-xx-xxx) (064f:03e9)" for each dongle.

I have seen that this topic originates in 2015. We are running unRaid 6.7.0 and still have this issue. Is there anything in the roadmap that will address this issue in any way?

 

Cheers

Max

Hi Max. I suggest you post a request in the feature request forum. Not saying that LT will implement that but there's a better chance than posting in this old topic.

Share this post


Link to post
2 hours ago, craptec said:

Well I am afraid I have to contradict. We are using unRaid's hypervisor funtions to run multiple VMs as testrigs. Unfortunately some software we are using requires hardware licenses (usb dongles , WIBU CodeMeter-Stick). Obviously we are not able to purchase alternatives. The only option left for us is using the address to assign these dongles individually which comes with the flaws mentioned before.

However each dongle offers an individual identification in the form of WIBU_-_CodeMeter-Stick_00000******* (the stars represent individual numbers for each dongle). This name shows in the Main-Tab only. In the properties of each VM one can only see "WIBU-Systems AG CmStick (MSD, article no. 1001-xx-xxx) (064f:03e9)" for each dongle.

I have seen that this topic originates in 2015. We are running unRaid 6.7.0 and still have this issue. Is there anything in the roadmap that will address this issue in any way?

 

Cheers

Max

I would definitely create a post in the feature request forum.  This isn't really something we would directly develop ourselves, but if we could find a way to "script" around this, I could see us devoting some time to doing that.  As of right now, it's not a development priority because there just aren't enough users out there complaining about it.  There are plenty of things we want to see improved and this is one of them, but we have to tackle things in the order of what's going to bring the most value to the most people first, and this definitely slides down the task list as a result.

Share this post


Link to post

I have the same problem with 2 x 4TB WD USB 3 external drives:

Bus 1 --> 0000:00:14.0 (IOMMU group 3)
Bus 001 Device 004: ID 046d:c248 Logitech, Inc. G105 Gaming Keyboard
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 002: ID 0781:5581 SanDisk Corp. Ultra
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 2 --> 0000:00:14.0 (IOMMU group 3)
Bus 002 Device 006: ID 1058:25e2 Western Digital Technologies, Inc. My Passport (WD40NMZW)
Bus 002 Device 005: ID 1058:25e2 Western Digital Technologies, Inc. My Passport (WD40NMZW)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

 

I don't have any other USB controllers so cannot pass through the entire controller (micro ATX MB).  Unfortunately I don't have the Linux chops to be able to make a coherent feature request.  If I did it would be something along the lines of querying the usb device for unique Id parameters i.e.:

Quote

*-scsi:1
          physical id: 2
          bus info: usb@2:5
          logical name: scsi9
          capabilities: emulated
        *-disk
             description: SCSI Disk
             product: My Passport 25E2
             vendor: WD
             physical id: 0.0.0
             bus info: scsi@9:0.0.0
             logical name: /dev/sdj
             version: 4005
             serial: WXT1EC79M81F
             size: 3725GiB (4TB)
             capabilities: gpt-1.00 partitioned partitioned:gpt
             configuration: ansiversion=6 guid=8f717fa2-263c-4d2d-a89e-ddaf98ceba1c logicalsectorsize=512 sectorsize=4096

Then allowing selection of a unique identifying parameter like "serial" to make a selection, I don't really have another $125 to spend on a different model/brand drive so that's not really an option.

 

Share this post


Link to post
On 7/20/2015 at 1:52 PM, kingfetty said:

If you have multiple USB devices with the same Vendor and Product then the passthrough does not work as the UI currently builds the XML file with USB based on the Vendor / Product and not the Address Bus= Device=  syntax.  Since this is the case if you attempt to passthrough any usb devices that have duplicate Vendor/Product you will not be able to start your VM.

 

The workaround is to manually edit the xml to the Address syntax.

 

Examples:

 

Bus 011 Device 003: ID 08bb:2704 Texas Instruments Audio Codec

Bus 011 Device 002: ID 08bb:2704 Texas Instruments Audio Codec

 

 

Current Syntax:

 

 


<hostdev mode='subsystem' type='usb' managed='yes'>
      <source >
        <vendor id='0x08bb'/>
        <product id='0x2704'/>
      </source>
     </hostdev>
 

 

 

This will result in a non booting VM

 

 

Fixed Syntax:

 

 


<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <address bus='11' device='2'/>
      </source>
    </hostdev>
 

 

This workaround does not seem to work on my Windows VM running on 6.8.0-rc1 - anybody else having this issue or is it just me?

I ended up passing a whole USB controller and everything is back up and running.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.