Persistent usbattach

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Notorand.IT
Posts: 77
Joined: 14. Nov 2013, 12:47
Primary OS: Other
VBox Version: OSE other
Guest OSses: ArchLinux x86_64
Location: Regnum Utriusque Siciliae

Persistent usbattach

Post by Notorand.IT »

I am running headless VB (v5.0.24) in a Linux (Ubuntu Server) to run Linux VMs.
A few VMs need to access "external" USB devices physically attached to the host machine.
What I have noticed is that, after "usbfilter add" and "usbattach", the configuration file (.vbox) doesn't contain any reference to the UID of the attached USB device, while I would expect a reference to be present somewhere.
I can see this (fragment):

Code: Select all

...
        <USB>
          <Controllers>
            <Controller name="OHCI" type="OHCI"/>
            <Controller name="EHCI" type="EHCI"/>
          </Controllers>
          <DeviceFilters/>
        </USB>
...
Is this normal?
If it's not, how can I fix it?
TIA.
# rm -fr /
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Persistent usbattach

Post by michaln »

The usbattach command won't modify the settings. Adding USB filters should. Please tell us exactly what you did.

Note that the filter normally contains the USB vendor/device IDs, not the UUID since the UUID is not necessarily persistent.
Notorand.IT
Posts: 77
Joined: 14. Nov 2013, 12:47
Primary OS: Other
VBox Version: OSE other
Guest OSses: ArchLinux x86_64
Location: Regnum Utriusque Siciliae

Re: Persistent usbattach

Post by Notorand.IT »

michaln wrote:The usbattach command won't modify the settings. Adding USB filters should. Please tell us exactly what you did.
Infact I wrote that I used "usbfilter add" and "usbattach"
michaln wrote:Note that the filter normally contains the USB vendor/device IDs, not the UUID since the UUID is not necessarily persistent.
Exactly.
I expect that after an usbfilter as been run, the VM's configuration changed ...
# rm -fr /
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Persistent usbattach

Post by socratis »

Notorand.IT wrote:I expect that after an usbfilter as been run, the VM's configuration changed
Did you shutdown VirtualBox?
Do you use snapshots?
For a VM that you modified with the usbattach command:
  1. Right-click on the VM in the VirtualBox Manager.
  2. Select "Show in Finder/Explorer/Whatever".
  3. ZIP the selected ".vbox" file and attach it in your response.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Persistent usbattach

Post by michaln »

Notorand.IT wrote:Infact I wrote that I used "usbfilter add" and "usbattach"
When I run "usbfilter add" I get "-bash: usbfilter: command not found". I'm going to make a wild guess that that's not what you ran, but I would like to know what you did run, exactly. If that's too much to ask then I fear we're at an impasse.
Notorand.IT
Posts: 77
Joined: 14. Nov 2013, 12:47
Primary OS: Other
VBox Version: OSE other
Guest OSses: ArchLinux x86_64
Location: Regnum Utriusque Siciliae

Re: Persistent usbattach

Post by Notorand.IT »

michaln wrote:
Notorand.IT wrote:Infact I wrote that I used "usbfilter add" and "usbattach"
When I run "usbfilter add" I get "-bash: usbfilter: command not found". I'm going to make a wild guess that that's not what you ran, but I would like to know what you did run, exactly. If that's too much to ask then I fear we're at an impasse.
I thought I was talking to someone that uses commandline frequently. Sorry.
I actually run:

Code: Select all

VBoxManage usbfilter add ...
and

Code: Select all

VBoxManage controlvm myvm usbattach ...
But now I am not sure that you (michaln) can really help me ...
# rm -fr /
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Persistent usbattach

Post by michaln »

Notorand.IT wrote:But now I am not sure that you (michaln) can really help me ...
You're right, if you can't provide the command(s) that you actually ran, I can't help you.
Notorand.IT
Posts: 77
Joined: 14. Nov 2013, 12:47
Primary OS: Other
VBox Version: OSE other
Guest OSses: ArchLinux x86_64
Location: Regnum Utriusque Siciliae

Re: Persistent usbattach

Post by Notorand.IT »

I can make the USB device usable by the VM but cannot see the change in the configuration file.
So I am scareb about reboots in either the host or the guest.
Maybe I am wrong, but if this is normal or not, it's unrelated to the exact command line argument.
Unless there is an undocumented argument saying "please save this into the config files".
But OK. Let's be clear:

Code: Select all

VBoxManage usbfilter add 1 --target na1 --name "Western Digital Technologies, Inc. My Passport (WDBKXH, WDBY8L)" --action hold --vendorid 1058 --productid 0748
VBoxManage controlvm na1 usbattach 674ec29b-cad8-402b-9aa1-2f8e328c900b
Of course, "674ec29b-cad8-402b-9aa1-2f8e328c900b" is the UUID that

Code: Select all

VBoxManage list -l usbhost
showed.
After these prefcise commanda my VM was able to access the device. But the .vbox confoguration file is not mentioning it by either vend_id/prod_it or by UUID.
The question is still the original one.
# rm -fr /
Post Reply