How to enable USB support for Virtualbox 3.0.6 non-OSE on openSUSE 11.1?
The FAQ for VB 2.0.2 doesn’t work :\
Have the same problem and no solution!!
Nobody any solution??
Hi rozbarwinek,
are you still interested in a solution?
I’ve found one :o)
and my USB SanDisk U3 Cruzer is running properly!!
cu
aiko
Add me to that list. It stopped working with a kernel update, at least as far as I can recall. I did the recompiling, as instructed, but usb connectivity did not come back.
My workflow for the installation was the following:
- I downloaded SUN VBox (non-OSE) => VirtualBox-3.0.6_52128_openSUSE111-1.i586.rpm from the SUN HP
- I installed: kernel-sources, kernel-headers, gcc, pam-devel and make with YAST
- I installed rpm - file as root(!) in a console with: rpm -ivh VirtualBox-3.0.6_52128_openSUSE111-1.i586.rpm
- The installation rebuilt the kernel with no problem!
- My User-account was automatically added to the VBOXUSER-group
I started VBox with my User-account (not as root!) and that’s the problem,
(from my very limited linux knowledge). VBox has been installed as root, but was not started as
root, so not the whole functionality is available!
I installed W2K3 Server in the VBox. I saw the USB devices including my USB SanDisk Stick, but
after booting W2K3 the USB stick was not available!
Maybe there is an easier way, but I solved it with the following:
- open a console - su - VirtualBox (start VBox as user root!)
- VBox started “untouched”! I expected to see my W2K3 installation, but there was nothing!
- I thought about re-installing, but there was already an installation and I didn’t want to spend
the same amount of time for re-installing :o) - So I did the following:
NEW - CONTINUE - choose a name and OS - CONTINUE - USE HARDDRIVE - BROWSE - ADD -
filename: /home/YOUR-USR-NAME/.VirtualBox/HardDisks/YOUR-FORMER-OS-NAME.vdi
(You can’t browse to that directory and filename, you have to type it!!!)
The rest is self-explaining …
My USB stick was connected all the time! In VBox I marked the USB stick and started W2K3
and … olala … the USB stick was available!!! But only if you start VBox as root!!!
Hope you will be as succesfull as I was …
Next issue will be to get the internet running :O)
cu
aiko
It’s a bad idea to run VirtualBox as root, even though Yast (as root) installs it. There are plenty of previous VBox threads in the forum saying the same. I have just upgraded from 3.0.4 to 3.0.6 (non-OSE) as a** normal user**, using Yast (as root). One of the smoothest VBox installs to date (on 11.1), my VM picked up a USB memory stick that worked flawlessly and released back to the host on shutting down the VM. VBox closed normally, I rebooted the m/c and repeated the test. All done as normal user, and not a hiccup.
I download VBox, place rpm(s) in a directory (any name you like) in /home. That directory is set up in Yast>Software Repositories, as a local repo and enabled. You then do the upgrade via Yast in the normal way. You can leave previous VBox rpm versions in that local repo, but I found I need to refresh the repo after adding the new rpm, to pick it up when in Yast>Software Management (or Install Software from Kickoff menu).
A search of the forum for previous VirtualBox threads would have explained all this, and much more about attaching USB devices. There are threads more recent than the Howto for 2.0.2 (assume the OP refers to caf4926’s). Howto’s are often superceded by forum threads. You need to search for them.
Hi consused,
I agree, starting anything as root is no good idea!!!
The only workaround is to edit fstab or to umount and mount usbfs with new settings before using VBox after every reboot
But why is root able to do it without changing fstab? There must be another solution!!
But for now I do the following as described in [Solved]USB only working for some devices, others greyed out (View topic) • virtualbox.org](http://forums.virtualbox.org/viewtopic.php?f=7&t=19955)
- umount /proc/bus/usb/
- mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=113,devmode=664
(Of course the number given at devgid is the group ID of group “vboxusers”.)
I will test editing fstab later! The current fstab says:
usbfs /proc/bus/usb usbfs noauto 0 0
Anybody any better idea?
consused wrote:
>
> It’s a bad idea to run VirtualBox as root, even though Yast (as root)
> installs it. There are plenty of previous VBox threads in the forum
> saying the same. I have just upgraded from 3.0.4 to 3.0.6 (non-OSE) as
> a* normal user*, using Yast (as root). One of the smoothest VBox
> installs to date (on 11.1), my VM picked up a USB memory stick that
> worked flawlessly and released back to the host on shutting down the VM.
> VBox closed normally, I rebooted the m/c and repeated the test. All done
> as normal user, and not a hiccup.
>
> I download VBox, place rpm(s) in a directory (any name you like) in
> /home. That directory is set up in Yast>Software Repositories, as a
> local repo and enabled. You then do the upgrade via Yast in the normal
> way. You can leave previous VBox rpm versions in that local repo, but I
> found I need to refresh the repo after adding the new rpm, to pick it up
> when in Yast>Software Management (or Install Software from Kickoff
> menu).
>
> A search of the forum for previous VirtualBox threads would have
> explained all this, and much more about attaching USB devices. There are
> threads more recent than the Howto for 2.0.2 (assume the OP refers to
> caf4926’s). Howto’s are often superceded by forum threads. You need to
> search for them.
There is a subtle trap here. To install VBox, you need root privileges. To
get the right permissions and location on the .virtualbox directory, you
have to run the install as the intended user via sudo (or just su and NOT
su - ). Something learned the hard way. Try all 3 and you’ll see subtle
(and some no-so-subtle) differences. As above, RTFM and do it their way.
I’m still trying to figure out the magic incantation that will install VBox
once and alow access to the same virtual machine by several users (one at a
time) but so far I keep hitting the issues the OP found with one or more
users no matter what I try.
–
Will Honea
Hi Will
Seems a long time since we were thrashing this stuff around. Thanks for explaining the privileges, from under the hood. That’s a neat way of nailing the subtleties.
Hi @aiko1603 and other interested users.
You may find some of the old threads on enabling USB devices in VirtualBox, rather long and difficult to follow as several solutions were developed and some were rejected. I will give a link to the original thread containing this solution (arguably the best) at the end of this post. Anyway I’ve been using this one since VBox 2.2.0 and through all the upgrades to 3.0.6, so here it is:
This is what my fstab contains (the permanent partition mounts are not shown here):
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
#usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
Notice the usbfs statement is commented out by inserting “#” at the beginning of the line. That’s the safe way to disable it, but you could also delete the line, after successful testing. It’s not required, and some distros don’t include it now.
Your mount commands:
1. umount /proc/bus/usb/
2. mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=113,devmode=664
I don’t need these, as they belong to old solutions and the use of /proc/bus/usb was deprecated by the VirtualBox people. So start again without them.
Proceed as follows:
You should have commented out any usbfs statements in /etc/fstab as above, and remove any mount -a command in etc/init.d/boot.local.
You need to start with an unmodified /etc/udev/rules.d/10-vboxdrv.rules file e.g. the one produced by a newly installed VirtualBox. Also make sure you don’t have a 60-vboxdrv.rules file in that directory. If there is one delete it.
Copy the file /lib/udev/rules.d/50-udev-default.rules into the directory /etc/udev/rules.d where it will take precedence. This will work according to the udev man page (to be found by entering man:udev in konqueror’s address bar).
The copied file now at /etc/udev/rules.d/50-udev-default.rules should contain amongst others, the following rule
# libusb device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
This default rule is preventing 10-vboxdrv.rules from working OOTB. Comment it out by editing the file and inserting “#” at the start of the line thus:
# libusb device nodes
#SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
Save it, and reboot the system. I connect up the USB devices on the host, before starting VirtualBox. If you set them up correctly in VirtaulBox usb settings, they should be automatically acquired by the VM on starting it.
Please note, that this solution is for openSUSE 11.1 only, and if openSUSE updates the default rules file /lib/udev/rules.d/50-udev-default.rules, then you will have to repeat the steps to copy it over to /etc/udev/rules.d and comment out the rule as before.
For the next release of openSUSE (11.2), none of the above modifications should be necessary, and it will hopefully work OOTB.
You can read the original solution-testing thread here. It’s Solution #4, summarized in post #74.
Good luck.
THANK YOU VERY MUCH!!!
–aiko
Everything is working fine!!
q.e.d.
for openSUSE 11.1 and SUN VirtualBox V. 3.0.6
This worked for me too
To summarize:
- Copy a file
- Edit 1 character in the new file
- Reboot
That points out a complaint I have with forums. There must be dozens of posts on this issue, scattered all over. Some of them have 15 steps, at least. We need a Solutions Subforum or a way to mark issues solved or something.
Thanks for an easy fix to an annoying problem.
@aiko1603 and@ Prexy
Thank you both for feeding back your good results.
The forum improvements mentioned by Prexy have been discussed in the same forum as this recent link, but as that one wasn’t moderated by a staff member, don’t hold your breath. However another thread close by, about marking as Solved was moderated.
If we hear back positively from the OP, we can ask for this thread to be so marked.
Solution described herein works, allows non-root users to access usb devices. Suse11.1 w/VBox3.6 configuration, winxp and mandriva guests.
-fyiultd, aka legacydude
Nothing magic here.
I have this setup on my laptop, where both my wife and I have different openSUSE-11.1 accounts.
We have virtual box directory under /home/virtualbox (separate from /home/oldcpu and /home/youngcpuwife ) and there is a winXP virtual box file there. We both access the same winXP when we are logged in (logged in a separate times).
oldcpu wrote:
>
> Will Honea;2044014 Wrote:
>> I’m still trying to figure out the magic incantation that will install
>> VBox once and alow access to the same virtual machine by several users
>> (one at a time) but so far I keep hitting the issues the OP found with
>> one or more users no matter what I try.
> Nothing magic here.
>
> I have this setup on my laptop, where both my wife and I have different
> openSUSE-11.1 accounts.
>
> We have virtual box directory under /home/virtualbox (separate from
> /home/oldcpu and /home/youngcpuwife ) and there is a winXP virtual box
> file there. We both access the same winXP when we are logged in (logged
> in a separate times).
That’s what I’m after but I keep running into permissions problems. Some
things get created with permissions of the user - what do you set the
permissions for on /home/virtualbox (and below)?
–
Will Honea
From /home:
drwxr-xr-x 4 oldcpu users 4096 2008-11-29 20:18 virtual
and next level down
oldcpu@dell:/home/virtual> dir
total 13001924
drwxr-xr-x 2 root root 4096 2008-11-29 10:51 components
-rw-rw---- 1 oldcpu users 13360073728 2009-10-04 18:36 winXP.vdi
Both user “oldcpu” and user “mrscpu” can access that winXP virtual box (as long as the other properly shuts down winXP before logging off).
oldcpu wrote:
>
> Will Honea;2045107 Wrote:
>> That’s what I’m after but I keep running into permissions problems.
>> Some things get created with permissions of the user - what do you set
>> the permissions for on /home/virtualbox (and below)?
>
> From /home:
> drwxr-xr-x 4 oldcpu users 4096 2008-11-29 20:18 virtual
>
> and next level down
>
> oldcpu@dell:/home/virtual> dir
> total 13001924
> drwxr-xr-x 2 root root 4096 2008-11-29 10:51 components
> -rw-rw---- 1 oldcpu users 13360073728 2009-10-04 18:36 winXP.vdi
>
> Both user “oldcpu” and user “mrscpu” can access that winXP virtual box
> (as long as the other properly shuts down winXP before logging off).
Thanks. I thought I had tried that - so much for assumptions. That warning
about multiple sessions is something I had already learned (the hard way)
but getting that through to the users may be a problem at the office!
Fortunately, all but one essential Win app runs under Wine.
–
Will Honea
This post by consused is fantastic! It has solved all my problems with usb in VBox on opensuse 11.1. Thanks a lot!