VirtualBox

Opened 4 years ago

Last modified 4 years ago

#19714 new enhancement

USB Port filter should use Linux USB bus id instead of a random number

Reported by: Helge Deller Owned by:
Component: USB Version: VirtualBox 6.1.10
Keywords: Cc:
Guest type: all Host type: Linux

Description

On Linux the "port" field in the "USB Filter" should ideally use the physical bus id instead of a random number.
In my use case I'd like to create an USB filter limited to a specific physical USB port. If the user e.g. puts some random USB memory stick into this specific physical USB port, it should show up in the VM. For that it would be necessary to have a USB filter which can refer to a unique "port", which the current implementation can not guarantee.

E.g. currently I see this on my machine:

UUID:               9b7430c2-c602-49d8-84e9-ffbb3a22bce0
VendorId:           0x04d9 (04D9)
ProductId:          0x1133 (1133)
Revision:           2.16 (0216)
Port:               1
USB version/speed:  1/Low
Manufacturer:       Holtek Semiconductor, Inc.
Address:            sysfs:/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-2//device:/dev/vboxusb/003/002
Current State:      Busy

UUID:               191cbe8f-442d-4f5e-9552-c0b0cd7bf119
VendorId:           0x046a (046A)
ProductId:          0x0023 (0023)
Revision:           0.50 (0050)
Port:               1
USB version/speed:  2/Low
Manufacturer:       Cherry GmbH
Product:            CyMotion Master Linux Keyboard G230
Address:            sysfs:/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-2//device:/dev/vboxusb/002/002
Current State:      Busy

As you can see in the example above, both USB ports have "Port: 1" and thus they are not uniquely identifyable. So it would be more useful to instead refer the "Port" field to "3-2" for the first entry, and to "2-2" in the second entry (see the "Address" field).

Change History (1)

comment:1 by Helge Deller, 4 years ago

Looking at VirtualBox source code I see that the "Port" field is defined as integer value and not as string.
So, my proposal isn't possible as I described it. Instead one probably needs to add another field.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use