Discussion - Distinguish multiple identical USB devices

This is for discussing general topics about how to use VirtualBox.

Discussion - Distinguish multiple identical USB devices

Postby scottgus1 » 24. Dec 2020, 16:33

This topic is for discussing Distinguish multiple identical USB devices

Background & experiments:
USB devices have various pieces of information, such as VendorID, ProductID, Revision, etc., which appear in the Virtualbox guest's USB filter settings. What to do if two or more USB devices have identical settings in all of the filter fields? If Virtualbox has no unique setting between the devices it will not be able to tell which is which, and will very likely pass all of the attached identical devices into the guest. The port number that the USB device is attached to does not appear in the USB filter's Port box when you select a USB device to make a new filter. However, port number information is available by running 'vboxmanage list usbhost' in a command prompt (tested on a Windows host, other hosts unknown). If the port number for each identical device is different, then entering the port number into the USB filter will cause only that device to go into the guest.

This has been tested on a Windows host with two nearly identical USB thumbdrives (differing only in serial number) and two USB security dongles (completely identical filter information).

For the thumbdrive test, the guest USB filter was cleared out to show only the usual entries: Name, VendorID & ProductID. As expected, both thumbdrives went into the guest. 'Vboxmanage list usbhost' revealed that one thumbdrive's Port number was 2 and the other's was 3. I unplugged the thumbdrives and put '2' in the guest's USB filter for the Port box. When the guest was restarted and the thumdrives were reinserted, only the thumbdrive on "port 2" went into the guest. The other thumb drive appeared on the host. I removed the thumbdrives and switched them. Now the other drive went into the guest and the first remained in the host. I was also able to get two guests to reliably grab one or the other of the thumbdrives based solely on which port the thumbdrive was plugged into, by putting one port number on one guest's USB filter and the other port number on the other guest's USB filter.

I did not do much testing with the security dongles, as the host was someone else's PC and the project involving Virtualbox had to be done during work hours. But using the port number from 'list usbhost' the guest now only uses the one of the two identical dongles and leaves the other in the host, allowing for correct licensing of the special software that runs in both host and guest.
scottgus1
Site Moderator
 
Posts: 11351
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Discussion - Distinguish multiple identical USB devices

Postby fth0 » 25. Dec 2020, 01:16

scottgus1 wrote:The port number that the USB device is attached to does not appear in the USB filter's Port box when you select a USB device to make a new filter. However, port number information is available by running 'vboxmanage list usbhost' in a command prompt (tested on a Windows host, other hosts unknown).

Both statements also hold true for my macOS High Sierra and Linux Mint 20 hosts. And I think that the port number is left out deliberately, because in the common case you don't want your USB device to be captured only at one of the USB ports.
fth0
Volunteer
 
Posts: 1776
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...


Return to Using VirtualBox

Who is online

Users browsing this forum: No registered users and 9 guests