[img_assist|nid=366|title=|desc=|link=none|align=right|width=145|height=150]
First of all, USB will not work in VirtualBox if you are using the Open Source Edition (OSE) of VirtualBox. Get the full closed-source edition of VirtualBox from their website. There are many differences between the open-source edition and the closed-source version and one of them is USB.
I finally got USB working with Windows XP running as a guest inside VirtualBox running on a Ubuntu Hardy host. First find out what the group id of the vboxusers group is:
$ grep vbox /etc/group vboxusers:x:<gid>:david
Then, enable the deprecated /proc/bus/usb
inteface:
$ sudo gedit /etc/init.d/mountkernfs.sh
Add the following line after /proc
is mounted, at the end of the do_start() function.
#for hardy: domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=<gid>,devmode=664 #for intrepid: domount usbfs "" /proc/bus/usb usbdevfs -onoexec,nosuid,nodev,devgid=<gid>,devmode=664
replacing <gid>
with the <gid>
you found in the first step. Make sure to reboot. This didn't work for me until I rebooted. There you have it. You shouldn't have to edit /etc/init.d/mountdevsubfs.sh
or /etc/fstab
as some other internet sources have suggested.
Comments
Jan Glascher (not verified)
Thu, 2008-09-11 23:07
Permalink
USB + Virtualbox problems persist
Hi David,
I hope you don't mind me contacting you about some persisting problems
that I have with getting a USB device mounted under virtualbox (running XP
as the guest OS). The host system is Ubuntu Hardy running on a Thinkpad
T61.
I followed the instructions on your blog and edited
/etc/init.dmountkernfs.sh and created a USB filter for the device under the
Settings/USB in Virtualbox (pressing the USB button with the "+" and then
simply "OK"). However, when I boot XP in Virtualbox the entry for the
device in Devices/USB is still grayed out and I cannot connect to the
device
It also does not make a differences whether the device is mount under
Linux or not (which is does just fine). Furthermore, there is also no
difference whether or not the UBS device is plugged in at the time of the
XP boot in Virtualbox.
I also tried editing /etc/init.d/mountdevusbfs.sh and /etc/fstab as other
posts have suggested, but the problem remains. I cannot mount any USB
devices in Virtualbox.
Do you have any further suggestions of what I could try to get the device
mounted?
Thanks a lot for taking the time.
Best wishes,
Jan
David Grant
Fri, 2008-09-12 10:22
Permalink
Suggestions
Try to put only the additional line in mountkernfs.sh and re-comment the line in mountdevusbfs.sh and comment out usbfs stuff in fstab. Run 'mount' without command-line arguments and see what is mounted. You should only have have usbfs mounted once. I had some problems because I had usbfs mounted twice.
BTW, this is what I get when I run "mount | grep usb"
I have nothing in fstab that is usb related, I have not changed mountdevusbfs.sh. I added the following to to mountkernfs.sh
domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=1002,devmode=664
When I run "groups" as my regular user (david) that I use to run Virtualbox, I get "vboxusers" showing up in the list
When I run "
cat /etc/group|grep vboxusers
" I get:vboxusers:x:1002:david
Make sure to do a reboot. Let me know if this still doesn't work. Once we find the solution I'd like to add it to my post to make the information more complete. What version of Virtualbox and Ubuntu are you using?
Scott (not verified)
Wed, 2008-12-17 22:01
Permalink
Check your installed version of VirtualBox
I installed VirtualBox through the Synaptic Package Manager. I was having problems with getting the USB support enabled for my Windows XP guest OS. Come to find out the version installed by Ubuntu was the OSE version, so it doesn't have USB support. I backed up my guest files and uninstalled the OSE version and downloaded and installed the .deb file from VirtualBox's site. Didn't need the backup since the newly installed version updated the files to work with the new version. Now I have USB support. Just something to check before pulling your hair out about USB not working.
Jeffre (not verified)
Tue, 2008-12-23 08:16
Permalink
VirtualBox USB Challenge
I have made all the edits you recommended above. All my settings appear to be OK, but I still cannot access my USB devices in my XP Virtual Machine. They appear on the device list but are "grayed out". I did notice that when I ran "cat /etc/group|grep vboxusers" I get:
vboxusers:x:1001: (my username (jeffrey) does not appear after the second colon.
I am using VirtualBox 2.1.0
Ubuntu 8.10
Thanks for any help you may be able to offer.
Jeffrey
David Grant
Thu, 2008-12-25 22:58
Permalink
You're not in the group then
If your username is not after the vboxusers group name, then you are not in the group. Use the Ubuntu user admin (System->Administration->Users and Groups) to add yourself to the group.
Anonymous (not verified)
Tue, 2009-10-20 02:03
Permalink
This worked for me - ubuntu
This worked for me - ubuntu 9.04 with windows 7 guest, was greyed out until i checked the vboxusers group and added myself to it. Thanks for the help guys.
sampyboy (not verified)
Wed, 2010-11-24 19:13
Permalink
Webcam works!
I have a Dell Vostro 1700 notebook with Ubuntu 10.10 and Windows XP Professional (Service Pack 3) as guest OS in Oracle Virtualbox 3.2.10. Initially webcam option under USB Devices was greyed out. On typing "grep vboxusers /etc/group" in a terminal did not reveal my username. Just by adding my username to vboxusers group, webcam became usable inside virtual box. Thanks guys for the trick!
To add my username, I just followed:
(System->Administration->Users and Groups->Manage Groups->vboxusers->Properties and checking my username). After adding, you must restart the computer and restart the guest OS. If you see LED of webcam glowing for a second while booting of guest OS, you are through! By the way, before doing all the above, please make sure you have installed latest version of guest additions for your Virtualbox!!
Anonymous (not verified)
Mon, 2009-06-15 16:17
Permalink
It Works!!
I cleaned out all of the garbage that the other links said to do and had only the mountkernfs command and it works fine. Crank up XP and it recognizes the flashdrive. Works for me ...
Jan Glascher (not verified)
Fri, 2008-09-12 00:26
Permalink
USB + Virtualbox problems persist (follow-up)
Dave,
thanks a lot for your quick response.
I tried all your suggestions, but I still cannot mount my USB flash drive
I am using Ubuntu Hardy Heron (8.04) and Virtualbox 1.6.6
I commented the lines in /etc/init.d/mountdevusbfs.sh and /etc/fstab that
was sugested by the other posts.
I did reboot before trying all of the below.
output of:
output of:
(glaescher is my username)
I did already add the next line to /etc/init.d/mountkernfs.sh
just before the comment starting with:
Here is the output of "VBoxManage list usbhost"
So it does recognize the Flash Drive (Patriot Memory, no comments on the name, please. It's embarrassing, but a huge and fast drive).
I also tried to set a global USB filter using the command:
but the command produces and syntax error:
However, I did include all the mandatory options that are listed under VBoxManage --help
As for the local usbfilters, I ran "VBoxManage showvminfo "Windows XP SP3" and got:
So the 2 USB filters specific to the VM are recognized.
Do you have any other ideas?
Thanks a lot,
Jan
David Grant
Fri, 2008-09-12 10:25
Permalink
More info
I attached a couple screnshots. I have no filters. (see 2.png)
I see VBoxManage sees the shares. So are the devices greyed out in the VM, as opposed to mine? (see 1.png)
Other other thing I can suggest is to try to run it as root, or start going crazy with chmod 777 on the /proc/bus/usb folder or something.
I am using Version 1.6.2 of Virtualbox. That might be the problem, I had heard of some features breaking in newer versions of VirtualBox. It looks like it's still available: http://www.virtualbox.org/wiki/Download_Old_Builds
Or, maybe you can try Version 2.0?
Caraibes (not verified)
Thu, 2008-11-27 01:59
Permalink
I also have the same
I also have the same problem, as my usb scanner is grayed out, my usb webcam too... My settings are exactly like what you recommend in your guide, I am running Hardy, with a virtualbox 2.0, and winxp inside... I can't seem to find a solution...
Andrzej (not verified)
Tue, 2008-09-23 15:49
Permalink
40-basic-permissions.rules
Hi Jan,
I had the same problem and found the solution in this document
I think, one thing that is missing in your configuration is an additional entry in the file /etc/udev/rules.d/40-basic-permissions.rules.
Don't forget to restart udev service after that and your virtual machine, in this order.
I hope this helps,
regards,
Andrzej
David Grant
Wed, 2008-09-24 15:02
Permalink
Interesting
I didn't need to add the group="vboxusers" to the 40-basic-permissions.rules file or the stuff in mountdevsubfs.sh. I just put:
as explained in the post. Thanks Andrzej, hpoefully if Jan tries your suggestion it will work.
casey a (not verified)
Wed, 2008-10-01 05:07
Permalink
still no good
i've tried all of this and still the device appears unavailable.
i'm trying to make a winblows xp guest see my pda so i can use activesync.
MS CRAP!!!
this is really frustrating... i'm a linux n00b and i have searched google and the ubuntu forums for hours.
and still not working.
any help would be awesome
Anonymous (not verified)
Fri, 2008-10-10 11:06
Permalink
I used the info on this blog
I used the info on this blog and am able to mount usb flash drive on the XP guest on a Ubuntu 8.04 host. Thanks David Grant.
dex (not verified)
Thu, 2008-10-30 03:33
Permalink
:-(
I follow the instruction also in the https://help.ubuntu.com/community/VirtualBox#USB but I continue to have the USB devices grayed.
I'm tryng to solve this task to sync my IPOD with Itunes.
Still not working
For others,
in the help.ubuntu they said you need the PUEL version and not the OSE (that has not USB support).
dex
denwood (not verified)
Sun, 2008-11-16 16:32
Permalink
T61 / Ubuntu / VirtualBox Fixed?
I, too, have a T61 and have tried all of the solutions offered here to no avail. Did you ever get it working?
nox (not verified)
Wed, 2008-11-12 12:02
Permalink
Worked when...
I changed this line
domount usbfs "" usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=,devmode=664
to
domount usbfs "" /proc/bus/usb usbdevfs -onoexec,nosuid,nodev,devgid=,devmode=664
David Grant
Wed, 2008-11-12 13:26
Permalink
Me too
That's right! I had to do that too, but I forgot to update this blog post. Thanks!
Tom B. (not verified)
Fri, 2008-11-14 14:19
Permalink
Thanks! this worked flowless
Maybe you'll be able to help with enabling Wacom Tablets on Intrepid + Vbox, (http://forums.virtualbox.org/viewtopic.php?t=11423&start=0&postdays=0&po...)
I can't find any useful resource about this problem on Intrepid.
Tom B. (not verified)
Sat, 2008-11-15 00:28
Permalink
I solved my Wacom problems 10 munutes after posting here...
All I had to do was chown the tablet module in /proc/bus/usb/
(see the link in the previous post)
Børre Gaup (not verified)
Fri, 2008-11-14 20:25
Permalink
Solved for Ubuntu Intrepid
I went through all the suggestions and advices above, but VirtualBox didn't recognise my USB drive.
Finally I opened the xml file belonging to my windows xp installation, $HOME/.VirtualBox/Machines/windows\ xp/windows\ xp.xml (I quit VirtualBox before I did this)
I changed the line that read:
<USBController enabled="false" enabledEhci="false"/>
to:
<USBController enabled="true" enabledEhci="true"/>
and after that I was able to access my USB drive
Ryan (not verified)
Tue, 2008-11-25 12:45
Permalink
Great little hack, thanks David
I followed author's original instruction for 8.10, they worked great after reboot.
Thanks a bunch!
Ryan
Falk (not verified)
Wed, 2008-12-10 23:29
Permalink
Thanks
Hi,
Thanks for the hints!
One additional comment:
I'm on Intrepid. I had to install Virtual Box version 2.0.6
Regards,
Falk
Jonathan Konrad (not verified)
Sun, 2008-12-14 22:45
Permalink
I'm afraid I only get greyed out devices too
I am running Ubuntu 8.04
I have edited the mountkernfs.sh file as you suggested. Both
domout usbfs usbdevfs /proc/
and when that did not work
usbfs "" /proc/ ...
Before coming across you post, I had tried editing the mountdevsubfs.sh or /etc/fstab as some other internet sources have suggested. Each helpful hint brings be to greyed out USB devices. Better than no devices, yet I can not use my USB devices in my guest OS of WinXP SP3.
I have also created a group called usbuers, and every trick I can find on the web. Any more help would be great. Thank you.
Anonymous (not verified)
Wed, 2008-12-31 10:32
Permalink
try this hack
chmod -R 777 /proc/bus/usb
it made it work for me, after trying many of the above fixes . Obviously it's a permissions issue at work. I am currently tracking own the root issue and will report with a cleaner fix later. This fix won't survive reboots, obviously.
Stuart (not verified)
Wed, 2008-12-31 22:04
Permalink
Thanks
Excellent. After much stuffing about with the advice at http://www.virtualbox.org/wiki/User_FAQ , Linux permissions, etc, your simple one line change works for me...
Jairo Almanza (not verified)
Thu, 2009-01-01 09:37
Permalink
Thks
thank you this has been very useful tip
Greetings from Costa Rica
Pura Vida!!
Kylea (not verified)
Sun, 2009-01-04 20:07
Permalink
USB Virtualbox 2.1
Thanks David - Intrepid suggestions worked a treat!
Gerard (not verified)
Sun, 2009-01-04 20:38
Permalink
Thanks, David. For me, it
Thanks, David.
For me, it works on Ubuntu 8.10 (64b) even after I commented the lines I put before in /etc/init.d/mountdevsubfs.sh and /etc/fstab as I was told by an other internet source.
Gerard.
Chris (not verified)
Tue, 2009-01-06 12:03
Permalink
Must undo what Ubuntu Community's website suggested.
First of all: Thanks so much for your guide! It worked!
I wanted to say that I had first tried the guide here for Ubuntu Intrepid: https://help.ubuntu.com/community/VirtualBox#USB. that DID NOT WORK for me. I then followed your guide, and that didn't work either. What I had to do is go back and UNDO what the Ubuntu Community's guide suggested before your guide would work.
Again, many thanks.
Anonymous (not verified)
Sat, 2009-01-10 03:26
Permalink
Thanks
THANKS
Anonymous (not verified)
Fri, 2009-02-06 00:26
Permalink
use only one method, this
use only one method, this one because it works better than the ubuntu guide's method. this is the method that got my iPod Touch working in my XP host. use only one method! :)
Kaiser (not verified)
Fri, 2009-02-06 00:30
Permalink
Thanks for the tutorial, I'm
Thanks for the tutorial,
I'm also on Ubuntu 8.10, followed the instructions and it didn't work until I found out that I wasn't part of the vboxusers group. After I joined I had to reboot and worked smoothly.
By the way, the USB device I wanted to get working is a Garmin ANT stick, for a GPS, which is a "very-proprietary" device using specially designed communication protocols, so if it works for this, everything can.
Chris (not verified)
Sat, 2009-02-14 13:57
Permalink
Thanks
Thanks a bunch for this. Worked for me on Ubuntu Intrepid (on the apparently-notorious Thinkpad T61, no less) by doing just as you said. (I am in the vboxusers groups, and I didn't previous try anything else specific to making USB work.)
I'm a little worried about enabling something "deprecated", but it works so I'll take it.
Chris (not verified)
Wed, 2009-02-25 13:22
Permalink
I still cannot make it work
I still cannot make this work. I'm running Ubuntu 8.10 host with XP guest on Virtualbox 2.1.4
the results of my '$ mount |grep usb' is
procbususb on /proc/bus/usb type usbfs (rw)
can anyone give me any suggestions?
gravybowl (not verified)
Sat, 2009-03-21 14:49
Permalink
Worked on Thinkpad T61
Worked flawlessly! Followed short and concise guide as-is, reboot and USB works in XP.
Again, like the other T61 owner, I didn't not try any other guides/techniques prior to this one. Running Ubuntu Intrepid 64bit and VirtualBox 2.1.4 (closed-source edition).
Zardoz (not verified)
Thu, 2009-04-23 18:53
Permalink
Works also under Ubuntu 9.04
Works also under Ubuntu 9.04 (Jaunty) + Virtualbox 2.2.
But "somewhere after /proc" is not enough. The mentioned line should be placed at the end of the do_start () function. Otherwise it didn't work for me.
Juan (not verified)
Fri, 2009-04-24 10:22
Permalink
Worked like a champ on
Worked like a champ on Ubuntu 9.04 32bit. Just have to make sure that you add yourself or whatever user that you need to the vboxuser group. Thanks a lot for the guide!!!!!!
sholyer (not verified)
Sun, 2009-05-03 10:18
Permalink
Thanks David! This worked
Thanks David! This worked for me. (Hardy Host/Jaunty Guest)
I was pulling my hair out, because it didn't work at first. Although I did exactly what you wrote.
"mount | grep usb" showed one line exactly like yours, I couldn't find any problems.
I finally checked /etc/fstab and I found a line in there referring to usbfs. I didn't check it sooner, cause how could something be there I never added?
The thing is I DID add this line a year ago when I needed it to make USB work with my guests running under VMWare Server.
Took that old line out. Rebooted. Everything worked like a charm in VirtualBox.
So that's just a hint for anyone who's struggling with this config. Make sure the /etc/fstab isn't mounting something else for usbfs that you don't want!
Stefanos (not verified)
Fri, 2009-05-15 07:12
Permalink
Virtualbox usb
Hello...
I am trying to make what you are saying and I can't
Can you please check if I made it corect?
David Grant
Fri, 2009-05-15 09:42
Permalink
You have to put "domount
You have to put
"domount usbfs "" /proc/bus/usb usbdevfs -onoexec,nosuid,nodev,devgid=124,devmode=664"
after
"domount proc "" /proc proc -onodev,noexec,nosuid"
Mahyar (not verified)
Wed, 2009-05-20 02:46
Permalink
Jaunty
In Jaunty, before you boot the guest, simply do this.
Open Settings>USB
Plug in your device, but ensure it's unmounted in the host
Enable USB controller
Add filter from device (and pick your device)
It worked for me without any mucking around with text files.
David Grant
Fri, 2009-05-22 16:58
Permalink
Jaunty
Can anyone else confirm that this works on a freshly installed Jaunty system?
JM (not verified)
Thu, 2009-06-25 19:22
Permalink
ubs is working
For me it is working OK with my old 256 MB pendrive...
... but I am still working on how to install my laserjet printer via USB...
Anonymous (not verified)
Sat, 2009-06-06 03:30
Permalink
i am no able to implement your fixes
hi david
i have exactly the same problem. i am using suse 11.1 with the closed source version virtualbox 2.2.2. i am allready a member of the vboxusers group.
so i want to implement the next step of your description here. but wehn i am trying:
sudo gedit /etc/init.d/mountkernfs.sh
then i end with: "(gedit:5957): Gtk-WARNING : cannot open display:.
i am a windows crack which want to find his way into linux. but it is so hard, while understand one system and try to do so in a different one! i am quite new here and getting confused sometimes while trying to fix problems in linux.
please: can you send me a step by step manual how to fix this error?
thanks
matthias
David Grant
Sat, 2009-06-06 15:01
Permalink
Try editing with a different
Try editing with a different editor. Try:
nano -w /etc/init.d/mountkernfs.sh
or
kate /etc/init.d/mountkernfs.sh
or use vim or emacs if you know how
Anonymous (not verified)
Fri, 2009-06-12 06:50
Permalink
i realy need help now
hi david
sorry that i am comming back. but i tryd every tipps an tricks on your side here. it took me about one day. but i still can not use my usb devices, such as a garmin device and my u3 usb stick..
this is what i have checked and tryed:
- i have installed the closed virtualbox version.
- i am a member of the vbox users.
- i installed the version 2.2.2 and after this the new one 2.2.4.
- remember after each smale change i allways rebooted my system!
- in virtualbox configruation of the wxp machine i added the required usb filters.
- when i startup the wxp machine, under device --> usb devices, i can see the filters but they are allways grayedout. in the taskbar of the wxp machine it shows me the information: no usb devices attached!
- when i attach a common usb stick to my workstation then suse will recogize it an i can use it under linux.
- when i start the: "/etc/init.d/mountkernfs.sh" it was empty.
- i added: domount usbfs usbdevfs /proc/bus/usb -onoexec,nosuid,nodev,devgid=,devmode=664
- then i added: domount proc /proc proc -onodev,noexec,nosuid
- the file contains now this two lines:
domount proc /proc proc -onodev,noexec,nosuid
domount usbfs /proc/bus/usb usbdevfs -onoexec,nosuid,nodev,devgid=1000,devmode=664 (1000 is my gid)
- i first added the first line and checked it after a reboot.
in a feedback above there is something written about the: do_start () function. what exactly does this mean? since no such function is visable in my: "/etc/init.d/mountkernfs.sh".
if nessesary how is the exact syntax of this?
- i changed the permissions: chmod 777 on the /proc/bus/usb
- interesting is that: mount |grep usb shows simly nothing!
- i removed all lines refering to: usbfs in: /etc/fstab
- the settings in: /home/matthias/.VirtualBox/Machines/wxp_client/wxp_client.xml is: "USBController enabled="true" enabledEhci="true".
any help is welcome.
thanks matthias
David Grant
Sat, 2009-06-13 07:57
Permalink
"when i start the:
"when i start the: "/etc/init.d/mountkernfs.sh" it was empty."
that's your problem. That file should have tons more stuff in it. It comes with the initscripts package, so you might want to try reinstalling that.
bryan (not verified)
Thu, 2009-06-18 04:11
Permalink
Still trying to get USB to work...
Hi,
First off, thanks everyone for the great suggestions on getting USB working.
I am running Fedora 11 i386 and Sun VirtualBox 2.2.4 (VirtualBox-2.2.4_47978_fedora11-1.i586). I am trying to get USB to work in XP SP3. When look at the USB filters, it has no problem showing me all of my USB devices, but when I "Start" the XP host, and then mouse over the USB icon, it says that there are "no attached devices".
[bryan@fedora ~]$ grep vbox /etc/group
vboxusers:x:501:bryan
[bryan@fedora ~]$ mount |grep usb
[bryan@fedora ~]$
[bryan@fedora ~]$ cat /etc/group|grep vboxusers
vboxusers:x:501:bryan
I have performed the changes in mountkernfs.sh, I have also tried adding another group called "USB", I have also tried to CHMOD -R 777 the usb directory.
Any help is appreciated -- I am very frustrated.
Thanks,
Bryan
Pages
Add new comment