USB Device filter

Discussions related to using VirtualBox on Linux hosts.
Post Reply
slipeer
Posts: 2
Joined: 6. Aug 2010, 09:40
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

USB Device filter

Post by slipeer »

There is "port" aatribute in USB Device filter.
In SDK docs i'm find that it's value is unsigned short, but i have no idea about where can I see the USB port number.
In lsusb i see DeviceID and BusID there is no "port number".
I need to filter out 10 devices, the only difference is in Device and Bus id.

Thanks for responce.

P.S. VirtualBox-bin 3.2.6 OS Gentoo Linux kernel 2.6.34-gentoo-r1 x86_64
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: USB Device filter

Post by frank »

Just leave the port empty.
slipeer
Posts: 2
Joined: 6. Aug 2010, 09:40
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP

Re: USB Device filter

Post by slipeer »

Frank Mehnert wrote:Just leave the port empty.
When i leave port empty all devices maped to single VM, but i need map different device to different VM.
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Re: USB Device filter

Post by michael »

In the following I assume that you are using sysfs to access USB devices, not usbfs. If you do "VBoxManage list usbhost", you will see the address of the USB device which contains a sysfs address and a device address. (E.g.
{{{
Address: sysfs:/sys/devices/pci0000:00/0000:00:1d.0/usb5/5-1//device:/dev/bus/usb/005/002
}}}
where the sysfs address is "/sys/devices/pci0000:00/0000:00:1d.0/usb5/5-1"). If you subtract one from the last number in the sysfs address you get what VirtualBox considers to be the port. The tricky thing here is that if you plug your device into an external USB hub the port will be the port on that hub, not the port on the root hub that the external one is plugged into.
ardinmcallister
Posts: 2
Joined: 11. Aug 2011, 21:56
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP

Re: USB Device filter

Post by ardinmcallister »

Could you please explain the syntax of what exactly is expected of the PORT field?
COULD you connect things via a USB Hub?
Is there any way to bind a usb port+device to a computer so that with 8 of the same devices, you could pass through the same device every time? Relying on the serial number of the device is useless since the device doesnt have that set.


Please dont say to "leave it blank" or "JFGI" (Just F**king Google It). Theres no information in the documentation about the PORT field from what I can find.

-Ardin
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Re: USB Device filter

Post by michael »

If you do "VBoxManage list usbhost" you will get a list of all attached devices, including their "address", which is split into a sysfs part and a device part. The sysfs part ends in a number (actually in several, but we only care about the last one). Subtract one from that number and you have the port number.

Please don't ask...
ardinmcallister
Posts: 2
Joined: 11. Aug 2011, 21:56
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: WinXP

Re: USB Device filter

Post by ardinmcallister »

in other words, no matter if its 5-1 or 1-1 or 3-1, you still put it down as port 0?
we put some PCI usb controller cards in, and those show up as 4-4. does that mean no matter if its 4-4 or 5-4 or 3-4 that its port 3?

What we need is an example of what its actually expecting.

-Ardin
michael
Oracle Corporation
Posts: 682
Joined: 10. May 2007, 09:46
Contact:

Re: USB Device filter

Post by michael »

Normally there will be a "." before the relevant number. If you post the output of VBoxManage list usbhost I can point you to the port numbers for devices. I don't know how much it will help you though, as different hubs will indeed have duplicate port numbers. (I seem to recall that the port number feature was added in request to some very specific customer request).
Afaq
Posts: 1
Joined: 26. Jun 2016, 15:52

Re: USB Device filter

Post by Afaq »

Hi,
I am using USB Hub with multiple USBs from the same vendor. I want to associate each USB with a separate VM of a virtualbox. I can use filter port id in virtualbox USB settings.
The problem is that I see same port IDs using "VBoxManage list usbhost" command for multiple USBs. All USBs also show serial Number of 1.0 so I cannot distinguish them.

Any solution, so that I can use individual USB for individual VM in a Virtualbox?
Thanks
Post Reply