LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 03-29-2010, 07:00 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
VirtualBox: USB device "is being exclusively used by the host computer"


Hello

This summarises a virtualbox.org forums thread in which the question has become more about the host than VirtualBox.

A "USB devices greyed out" problem has come down to this:
Code:
c@CW8:~$ VBoxManage controlvm "WXP" usbattach d9d550c5-fe6c-49dc-8bec-83ea60978a7c
[snip]
ERROR: USB device 'SanDisk Cruzer Blade' with UUID {[snip]} is being exclusively used by the host computer
[snip]
The problem is affecting all available devices -- 2 x thumb drives, 1 Bluetooth adapter and a printer -- so I don't think it is driver-specific.

From the host side, what can I do to investigate what might be making the devices unavailable for VirtualBox?

Netsearching suggests this is an unusual problem; chances are there's something unusual about my system that is triggering it. The only thing I can think of is that I changed the vboxusers group's GID (after which I uninstalled VirtualBox, groupdeleted vboxusers, groupadded vboxusers, installed VirtualBox ...

Versions: VirtualBox 3.1.6 on Slackware 13.0 32-bit.

My intuition is that this is a udev problem, created by the group change but I've scanned all the rules (under /lib/udev and /etc/udev) and found nothing relevant.
 
Old 03-29-2010, 06:20 PM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 4
Posts: 4,305

Rep: Reputation: 205Reputation: 205Reputation: 205
There's a script here:VirtualBox Test Script that checks your VirtualBox setup.
 
Old 03-29-2010, 07:35 PM   #3
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
hi

it may be an udev rule as suspected but as I do not use your distro I will comment in general.

The more user friendly your desktop....the greater the chance that your usb devices HAVE been automounted.

I suggest you use your file manager and look to see if (with root powers)
where are usb devices mounted.....or use normal file manager and look firstly into folders
/mnt
/media

Also peek into your /etc/fstab in case its not an udev rule but an fstab that is mounting your device.

If your distro is that friendly...you should be able to right hand click the mounted icon...folder...and Unmount it.

2) if your log shows usb device is say...../dev/usb3....something
try a root command to umount it or run a fuser against it.

3) Then of course...vbox and usb only play if you are using the non-free edition but I suspect you already knew that?
 
Old 03-30-2010, 12:42 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by {BBI}Nexus{BBI} View Post
There's a script here:VirtualBox Test Script that checks your VirtualBox setup.
Thanks {BBI}Nexus{BBI} I wrote it!
 
Old 03-30-2010, 12:44 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Thanks aus9

It's not mounted ...
 
Old 03-30-2010, 07:24 PM   #6
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
hi

could you expand a little on how you are accessing root and the usb thumb drive/hard drive please?

Do you do it routinely as well?

I have never tested the reported UUID in vbox for a user versus root so will have to have a look myself but I am wondering if its your process?

To me....try insert stick into host slot
do not mount it in host
click on vbxo devices ....check box for usb device
mount it inside vbox for user
umount of user
----

do same process for root but mount for root

--------------

I will get around to it.....but I am wondering IF it reports different UUID...the error is in vbox as UUID is always supposed to be same unless you change the partitioning.
 
Old 03-31-2010, 02:06 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by aus9 View Post
could you expand a little on how you are accessing root and the usb thumb drive/hard drive please?
Thanks aus9

I don't understand the question but will answer in detail hoping to provide the information you want ... Desktop is Xfce. Terminal emulator is mrxvt. Command line is /usr/bin/mrxvt -name root -ic /home/c/d/Repository/Icons/format-text-bold.xpm. Then enter root password and have root command prompt.

If I want to browse the FAT file system on the thumb drive on Linux (Slackware 13.0), I open Xfce's file manager, Thunar, and find it listed but greyed out. At this point it is not mounted. When I double click its icon it is mounted. To unmount it, I right click its icon and choose "Unmount Volume".

That's FYI -- I haven't been doing that after host boot and before trying to attach the thumb drive to a VirtualBox VM.

Once at a root command prompt, for testing purposes only (repeated while writing this post)
Code:
root@CW8:~# /opt/VirtualBox/VBoxManage list usbhost
[snip]

UUID:               b176c47d-0d2c-4fe2-97de-f8bbc5c64d0a
VendorId:           0x0781 (0781)
ProductId:          0x5567 (5567)
Revision:           2.0 (0200)
Manufacturer:       SanDisk
Product:            Cruzer Blade
SerialNumber:       1536401B4C138AB9
Address:            /proc/bus/usb/001/004
Current State:      Busy

[snip]
And, as evidence it is not mounted, firstly when mounted by Thunar as above and then after "Unmount Volume" in Thunar
Code:
root@CW8:~# df -hT | grep CHARLES8GB
/dev/sdc1     vfat    7.5G  132K  7.5G   1% /media/CHARLES8GB
root@CW8:~# df -hT | grep CHARLES8GB
[no output]
Quote:
Originally Posted by aus9 View Post
Do you do it routinely as well?
No, I normally use only the VM's host window's Devices menu to attach USB devices. I did not know of VBoxManage list usbhost until investigating this problem.

Quote:
Originally Posted by aus9 View Post
I have never tested the reported UUID in vbox for a user versus root so will have to have a look myself but I am wondering if its your process?

To me....try insert stick into host slot
do not mount it in host
click on vbxo devices ....check box for usb device
mount it inside vbox for user
umount of user
A valid "wonder". That's exactly what I normally do, assuming "click on vbxo devices" can be expanded to "Start a VM (not full screen). On the host window for the VM, open the Devices menu ...". The problem is that all the USB devices are greyed out so it is not possible to "check box for usb device"

Quote:
Originally Posted by aus9 View Post
do same process for root but mount for root
I cannot do the same for root because root is not a GUI user (trying to start a GUI application in a terminal as above results in cannot connect to X server
Quote:
Originally Posted by aus9 View Post
I will get around to it.....but I am wondering IF it reports different UUID...the error is in vbox as UUID is always supposed to be same unless you change the partitioning.
I don't think the UUID reported by VBoxManage list usbhost is the same as the partition UUID. I just tested again as user c (the usual VirtualBox user, member of vboxusers etc.). Collating results from the virtualbox.org forums thread and while writing this post, it looks as if VirtualBox creates these UUIDs for itself and on-the-fly:
Code:
UUID for c:    1f307a8a-2ecc-4a8d-9630-eebe225137dd
  29 March:    d9d550c5-fe6c-49dc-8bec-83ea60978a7c
UUID for root: b176c47d-0d2c-4fe2-97de-f8bbc5c64d0a
  29 March:    174e0a69-af28-4e32-b1a5-94ae8e94b005
To determine the thumb drive's partition's UUID, I searched for /dev files containing its serial number to get its /dev/sd<letter><number> and then searched for a link to that in /dev/disk/by-uuid
Code:
root@CW8:~# find /dev -iname '*1536401B4C138AB9*' -exec ls -l {} \;
lrwxrwxrwx 1 root root 10 2010-03-31 10:26 /dev/disk/by-id/usb-SanDisk_Cruzer_Blade_1536401B4C138AB9-0:0-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 9 2010-03-31 10:26 /dev/disk/by-id[snip]
root@CW8:~# find /dev/disk/by-uuid -lname '*sdc1*' -exec ls -l {} \;
lrwxrwxrwx 1 root root 10 2010-03-31 10:26 /dev/disk/by-uuid/4BA8-ADEB -> ../../sdc1
Ah! Of course! It is a VFAT file system and that's what their UUIDs look like.
 
Old 03-31-2010, 03:20 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Workaround

I found a workaround for the problem by adding a line to fstab
Code:
none            /proc/bus/usb  usbfs       devgid=765,devmode=664     0 0
That should not be and was not necessary on Slackware 13.0. As the VirtaulBox 3.1.6 User Manual says "If USB is not working on your Linux host, make sure that the current user is a member of the vboxusers group. On older hosts ...". "older hosts" is not defined but I guess they are ones on which VirtualBox cannot use the udev rules mechanism like this /etc/dev/rules.d/10-vboxdrv.rules on my system
Code:
KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"
SUBSYSTEM=="usb_device", GROUP="vboxusers", MODE="0664"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="vboxusers", MODE="0664"
Maybe that is not effective for a thumb drive anyway because it would (?) be superseded by this excerpt from /lib/udev/rules.d/65-permissions.rules
Code:
KERNEL=="sd*[0-9]", ATTRS{removable}=="1", GROUP="plugdev"
which uses the more generic plugdev group rather than vboxusers -- a neater solution because it is not only VirtualBox users who may want read and write access to file systems on USB devices.

BTW the VirtualBox user, "c", is a member of plugdev.

I'll leave this thread not SOLVED for a while because this is a workaround not a proper solution.

Last edited by catkin; 04-03-2010 at 02:11 AM. Reason: Title change
 
Old 03-31-2010, 07:48 PM   #9
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
hi

yes that pesky vfat system gets you every time...well done

anyhow I made a kinda promise so here is part one stuff

--------------------
in host....usb mounted

Code:
df -hT | grep vfat
/dev/sdb1     vfat    488M  3.3M  485M   1% /media/disk
umounted returns null as expected

in host......usb NOT mounted

Code:
VBoxManage list usbhost
Sun VirtualBox Command Line Management Interface Version 3.1.6
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

Host USB Devices:

UUID:               49d59d0e-761a-46fb-b92f-00c435508461
VendorId:           0x0930 (0930)
ProductId:          0x6529 (6529)
Revision:           1.0 (0100)
Manufacturer:       TOSHIBA
Product:            TransMemory
SerialNumber:       09F08951425159F9
Address:            sysfs:/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8//device:/dev/bus/usb/001/005
Current State:      Busy
using root powers usb NOT mounted

Code:
blkid | grep vfat
/dev/sdb1: LABEL="" UUID="8CC9-F420" TYPE="vfat"

My inference.....lets not get fixated on UUID with vfat
 
Old 03-31-2010, 08:11 PM   #10
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
part 2

I just did a rebuild and damn....I can't do the test!

mine is greyed out and clicking into box no good

by hovering...it seems usb is unavailable.

maybe its borked?

 
Old 03-31-2010, 08:35 PM   #11
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
part 3

ok so I used apt-get install with no complaints to get to part 2.

I then used my smxi script....only for smart ppl using Debian style sorry
...guru has a smvi script if you just want to add vbox or vmware

and it found I was missing some dependencies ....EDIT libidl0 I mis-spelt using fuzzy eyesight.....libid L for lima zero at end
libidl0
libqtcore4
libqtgui4

having prevously resolved other dependencies in part 2

so me thinks.....IMHO the solution is to move to a Debian system.

smxi is used to update your system...clean up stuff...tweak and put out the rubbish and night....send cards before birthday is expired etc

good luck

http://i44.tinypic.com/iym0b7.jpg

Last edited by aus9; 03-31-2010 at 08:51 PM. Reason: correct eyes for libidl0
 
Old 03-31-2010, 08:47 PM   #12
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
part 4

ok this is weird but exciting....I mounted usb stick in host
I clicked in devices and mounted usb in vbox
....host no longer shows it

I can't show you a snapshot that is true evidence of this...you just have to trust me.

I have never tested this for a long long time.....when I discovered vbox I knew I had to always umount the host....so this must be more recent development but highly appreciated
 
Old 04-02-2010, 12:55 AM   #13
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by aus9 View Post
I mounted usb stick in host
I clicked in devices and mounted usb in vbox
....host no longer shows it

I have never tested this for a long long time.....when I discovered vbox I knew I had to always umount the host....so this must be more recent development but highly appreciated
Hello aus

Where does "host no longer shows it"?

VirtualBox has got more convenient and more intuitive with each new release. They really work on making it more usable.
 
Old 04-02-2010, 07:57 PM   #14
aus9
Guru
 
Registered: Oct 2003
Posts: 5,060

Rep: Reputation: Disabled
If its mounted in host.....usb stick shows in my file manager....I use LXDE so thats pcmanfm....but I guess the same would be true of other good managers.

Now when I mount it using vbox device manager...the "mounted" folder on host file manager now disappears is what I meant by ...host no longer shows it
 
Old 04-03-2010, 01:00 AM   #15
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by aus9 View Post
If its mounted in host.....usb stick shows in my file manager....I use LXDE so thats pcmanfm....but I guess the same would be true of other good managers.

Now when I mount it using vbox device manager...the "mounted" folder on host file manager now disappears is what I meant by ...host no longer shows it
Same using Xfce's file manager, Thunar, except Thunar does not mount the device until you open it; it's greyed out until then. That makes sense -- it minimises the risk of file system damage caused by unplugging a mounted device while causing minimal user inconvenience (the mounting delay is imperceptible to the user).
 
  


Reply

Tags
usb, virtualbox


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB host to device "passthrough" JonathanWilson Linux - Embedded & Single-board computer 4 05-22-2013 07:27 AM
detect usb device insert/remove and get device node from "C" program ebinjose Linux - Embedded & Single-board computer 4 04-29-2012 09:26 AM
"Unable to open USB device "usb://hp/LaserJet%201000": No such device" lordshipmayhem Mandriva 2 08-08-2004 05:56 PM
USB storage device works in 2.4 not 2.6 "no device error" critch Linux - Hardware 4 05-18-2004 12:13 PM
"Unknown Device"s in lspci, computer running slow thrice Slackware 2 03-28-2004 09:14 AM


All times are GMT -5. The time now is 08:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration