Page 1 of 1

USB Device filter

Posted: 6. Aug 2010, 10:45
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

Re: USB Device filter

Posted: 9. Aug 2010, 11:42
by frank
Just leave the port empty.

Re: USB Device filter

Posted: 9. Aug 2010, 13:16
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.

Re: USB Device filter

Posted: 9. Aug 2010, 16:59
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.

Re: USB Device filter

Posted: 11. Aug 2011, 22:05
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

Re: USB Device filter

Posted: 12. Aug 2011, 10:08
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...

Re: USB Device filter

Posted: 12. Aug 2011, 20:22
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

Re: USB Device filter

Posted: 22. Aug 2011, 15:39
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).

Re: USB Device filter

Posted: 26. Jun 2016, 16:18
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