USB port number and extensions problems

Discussions related to using VirtualBox on Windows hosts.
Post Reply
LMRig
Posts: 12
Joined: 13. Apr 2022, 13:57
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: W10
Location: Czech Republic

USB port number and extensions problems

Post by LMRig »

Hello, I need to assign USB flash discs (which will be always different) plugged into only one specific USB port. How to do it? What to insert to filter?

And also I needed USB3 so I used extensions, I'm getting BSOD almost every time I boot or login, mostly with IRQL not or less equal (only after I added it).

PC: Windows 10 Pro 64bit
VM 6.1.32 r149290 + Oracle_VM_VirtualBox_Extension_Pack-6.1.32.vbox-extpack with Windows 10 Pro 64bit

Thank you for all help.
Last edited by LMRig on 13. Apr 2022, 16:28, edited 1 time in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: USB port number and guest additions problems

Post by mpack »

The Guest Additions have nothing to do with USB, so I think you are referring to the host EXTENSION PACK.

AFAIK the USB port is part of the device address, it isn't use to identify a device. If you want to distinguish otherwise identical devices then they need to have unique serial numbers, which you include in the filter.
LMRig
Posts: 12
Joined: 13. Apr 2022, 13:57
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: W10
Location: Czech Republic

Re: USB port number and extensions problems

Post by LMRig »

Ah, sorry, I thought I was searching for guest additions (edited).

They will be consumers devices so I don't know any details about these devices. But I need to assign only these to VM by the specific USB port on the motherboard, really there isn't any solution?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: USB port number and extensions problems

Post by mpack »

As I said, a port number is part of the address, it doesn't identify the device that lives there. And in any case there would also be the question of USB hubs, both internal and external, which would make it very tricky to use a port number as a proxy ID.

Basically, avoid getting really cheap devices, i.e. those that skip the final testing and device serial number programming step: or at least make sure that the USB chipset in the device allows for programming a custom serial number.
LMRig
Posts: 12
Joined: 13. Apr 2022, 13:57
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: W10
Location: Czech Republic

Re: USB port number and extensions problems

Post by LMRig »

So I have to do it manually, which is pretty uncomfortable :-/ .
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: USB port number and extensions problems

Post by mpack »

I know, that's why cheap devices skip that step on the production line.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: USB port number and extensions problems

Post by scottgus1 »

If I might chime in, It seems to my interpretation that LMRig wants to put out a host which will take whatever device is plugged into a particular port on the host and put it into the VM.

'Whatever device' would then mean that serial numbers, vendor & product IDs, etc, would be different at any time, so the filter settings besides 'Port' would have to stay empty.

This might be possible, if Virtualbox can properly use a filter that uses only the Port number. (I have not tested this to see if it works.)

You can see the Port numbers of the attached USB devices with 'vboxmanage list usbhost' .

The port number of the USB port containing the universal devices must be unique. No other devices can attach with that port number, or those devices will go into the VM also. This might be the straw that breaks the project's back: Multiple devices may have the same port number. Additionally, whereas a USB 'port chain' would include intermediary devices such as plugged-between or embedded USB hubs, Virtualbox only reads and acts on the final number in the chain, so a USB device on a hub plugged into the filtered port can end up with a different final port number, or the wrong device can match the port number, etc.
LMRig
Posts: 12
Joined: 13. Apr 2022, 13:57
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: W10
Location: Czech Republic

Re: USB port number and extensions problems

Post by LMRig »

scottgus1: You are right, that's what I meant. I didn't know what cheap devices or something like that we were talking about but from other text, I thought it's just not possible.

There is one PC that hosts VM. I wanted to use one USB port to be automatically added to VM when someone puts their USB flash disc which is a totally random device and I don't know their vendor, serial numbers or any other things, only the USB port on the motherboard is always the same.
I saw that Port option in the USB filter and it was why I wrote here because I thought people already used it.
It's my first time using VM so I totally don't know how to do it.

If you guys can also be so kind and tell me where to write 'vboxmanage list usbhost'?
I'll try it myself but just cloning the original disc to the new 500GB SSD to have space for VM so maybe you will be faster.

If there is something that can help with this problem (some hardware I mean) I can also buy it so just tell me.
Atm. I have there also some USB hubs but it will be maybe just a problem to use that, right? And better to use the motherboard USB directly.

Thanks
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: USB port number and extensions problems

Post by scottgus1 »

LMRig wrote:where to write 'vboxmanage list usbhost'?
In the host OS's command prompt.

On Windows hosts, you'd open the command prompt (web-search for how) then run these commands:

cd "C:\Program Files\Oracle\Virtualbox"
vboxmanage list usbhost


The Port setting is useful if more than one identical USB device is to be sent to separate VMs, or one to a VM and the other to stay in the host. Just need different port numbers for the devices in 'list usbhost'.

There isn't any special hardware that will simplify this, unfortunately. Even add-in USB PCIe cards will only show the last port number in 'list usbhost', and it's quite likely the port numbers will be the same as the motherboard port numbers.
LMRig
Posts: 12
Joined: 13. Apr 2022, 13:57
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: W10
Location: Czech Republic

Re: USB port number and extensions problems

Post by LMRig »

Thanks, when I get to work I'll try it.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: USB port number and extensions problems

Post by scottgus1 »

One possibility: ports 0 to 3 are highly likely to show up multiple times (4-port USB hub chips, etc). I recall seeing a 'list usbhost' showing a port #7, and possibly even two-digit ports. The host hardware is what causes the port numbers. Finding a high port number, at least above 3, will be a lot more robust for your project.
LMRig
Posts: 12
Joined: 13. Apr 2022, 13:57
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: W10
Location: Czech Republic

Re: USB port number and extensions problems

Post by LMRig »

Thank you thank you!
It works exactly what I need, I set the port to filter and now it's plugged into VM but not the host PC.

But now the second problem, I'm still getting IRL NOT OR LESS EQUAL BSOD.
It's just idle on the desktop and then it appears.

I have set 4GB RAM, 30GB Space and one core.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: USB port number and extensions problems

Post by scottgus1 »

Glad your port project is working?

Please start a new topic about the "extensions" question, keeping in mind that there are the "Extension Pack" which provides USB 3 in Virtualbox among other things, and the Guest Additions, which go in the VM and which do not influence USB in the VM.

Is the BSOD on the host PC or in the VM? Please answer this in the new topic.
Post Reply