Go Back   openSUSE Forums > New User How To/FAQ (read only) > Unreviewed How To and FAQ
Forums FAQ Members List Search Today's Posts Mark Forums Read


Unreviewed How To and FAQ POST HERE: Tips and solutions for SUSE Linux from the community. (Please do not post questions)

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 14-Apr-2009, 10:26
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,926
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Virtual Box USB tips

Adding USB Devices in Virtual Box


USB support is currently only available in the .rpm downloaded from Sun. Downloads - VirtualBox


Once Virtual Box is installed, make sure you are in vboxusers. Either with the following in konsole:
Code:
groupmod --add-user <login_name> vboxusers
OR: Or open YaST -> Security and Users -> UserManagement, and edit your user and add them to the vboxusers group.



The following steps then must be made:
Find the vboxusers ID Number like this:
Code:
grep vbox /etc/group
as user root
For VirtualBox 2.2.0 on OpenSUSE 11.1 you should add the following to /etc/fstab and delete any other lines with usb:
Place your user ID in place: eg;devgid=112
Code:
/sys/bus/usb/drivers /proc/bus/usb usbfs devgid=XXX,devmode=664 0 0
Here is an example of an edited /etc/fstab (notice the use of # to edit out a line)
Code:
/dev/disk/by-id/ata-ST9160827AS_5RF16D1B-part5 swap                 swap       defaults              0 0
 /dev/disk/by-id/ata-ST9160827AS_5RF16D1B-part2 /                    ext3       acl,user_xattr        1 1
 /dev/disk/by-id/ata-ST9160827AS_5RF16D1B-part7 /STORE               vfat       users,gid=users,umask=0002,utf8=true 0 0
 /dev/disk/by-id/ata-ST9160827AS_5RF16D1B-part1 /Vista               ntfs-3g    defaults    0 0
 /dev/disk/by-id/ata-ST9160827AS_5RF16D1B-part6 /home                ext3       acl,user_xattr        1 2
 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
 /sys/bus/usb/drivers /proc/bus/usb usbfs devgid=112,devmode=664 0 0
and add following line to /etc/init.d/boot.local
mount -a Reboot.


Now plug in a USB device to your Linux host. Open Virtual Box but do not start any Virtual Machines yet. Highlight the Virtual Machine you want to work with (In this Pic. It's XP) and click on the USB section in the details column and then click the USB symbol with the + sign:

Here you can add the device you have just plugged in.


Now close the settings window and remove the USB device from your Linux host. Now start the Virtual Machine (XP). When it's up and running, plug in your USB device and it should be picked up by the Virtual Machine (Not by the Host), and you are ready to go. When you close the Virtual Machine the USB device will likely be picked up by the Linux Host.
__________________
Box: openSUSE 11.2 | (KDE4.3.3) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #2 (permalink)  
Old 14-Apr-2009, 10:57
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,701
malcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputation
Default Re: Virtual Box USB tips

Hi
Excellent howto I do have one question with regard to the usbfs
entry. Does it not work by just changing the noatuo to auto?

The reason I ask as I use my GPS and to get it to work in nema mode
with gpsd, I just change this rather than deleting. I was wondering
of the impact with other similar devices and using virtualbox.

--
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 (i586) Kernel 2.6.27.21-0.1-pae
up 1 day 17:47, 1 user, load average: 0.16, 0.14, 0.13
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Reply With Quote
  #3 (permalink)  
Old 14-Apr-2009, 12:00
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,926
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Re: Virtual Box USB tips

@malcolmlewis
I'll look in to it, but it may be tomorrow before I can try.
__________________
Box: openSUSE 11.2 | (KDE4.3.3) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #4 (permalink)  
Old 14-Apr-2009, 13:18
Wise Penguin
 
Join Date: Jun 2008
Location: United Kingdom
Posts: 1,026
consused hasn't been rated much yet
Default Re: Virtual Box USB tips

Quote:
as user root
For VirtualBox 2.2.0 on OpenSUSE 11.1 you should add the following to /etc/fstab and delete any other lines with usb:
Place your user ID in place: eg;devgid=112
Code:

/sys/bus/usb/drivers /proc/bus/usb usbfs devgid=XXX,devmode=664 0 0
Nice howto. Where in the VirtualBox stuff does it state this step is required? For 11.0 maybe, but it shouldn't have been needed since version 2.1.4 and I have installed that and 2.2.0 on 11.1 without any mod to fstab and so have others. It should work with the default usbfs statement. Maybe you know of a particular usb device it's needed for?
Reply With Quote
  #5 (permalink)  
Old 14-Apr-2009, 14:42
Student Penguin
 
Join Date: Jan 2009
Posts: 57
thisoldman hasn't been rated much yet
Default Re: Virtual Box USB tips

The HOWTO is very nice but many people have tried the above solution and USB still wouldn't work for them. I do not have the fstab edits that are recommended and USB just works in VirtualBox 2.2.0 (and 2.1.4) for me.

The thread, Sun Virtual Machine - openSUSE Forums, has a long discussion about this problem. The solution might have been found by hank_se, and clarified for me by consused, if you read well into that series of posts. The files /etc/udev/rules.d/60-vboxdrv.rules and /etc/udev/rules.d/10-vboxdrv.rules are the bad actors, apparently, particularly if both files are present.

I only have the 10-vboxdrv.rules file. As I said, USB just works.

I hope someone will find this helpful.
Reply With Quote
  #6 (permalink)  
Old 14-Apr-2009, 15:05
Student Penguin
 
Join Date: Jan 2009
Posts: 57
thisoldman hasn't been rated much yet
Default Re: Virtual Box USB tips

I forgot to post the only usb related line, from my fstab.

Code:
usbfs  /proc/bus/usb  usbfs  noauto  0  0
Reply With Quote
  #7 (permalink)  
Old 14-Apr-2009, 15:08
caf4926's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: The English Lake District. UK - GMT/BST
Posts: 12,926
caf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputationcaf4926 has a brilliant future with this reputation
Send a message via MSN to caf4926
Default Re: Virtual Box USB tips

I would like to than everyone for their comments so far. It does seem that there are differing experiences and levels of success with USB support. The HowTo can and will be edited if required. Actually my intention was to focus on the steps of adding the device to the VM and the need to have the device removed when actually starting the machine, connecting it only when the VM is up and running. That is my experience anyway. I find the VM locks up at startup if the USB device is connected already.

All comments and criticisum welcome. Thank you.
__________________
Box: openSUSE 11.2 | (KDE4.3.3) | M2N4-SLI | AMD 64 X2 5200+ | nVidia 8500GT | 4GB RAM
Lap: openSUSE 11.2 | Celeron 550 | (KDE4.3.3)"3" | Intel 965 GM | Lenovo R61e | 3GB RAM
Reply With Quote
  #8 (permalink)  
Old 14-Apr-2009, 15:36
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,701
malcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputationmalcolmlewis has great reputation
Default Re: Virtual Box USB tips

Quote:
Originally Posted by thisoldman
The HOWTO is very nice but many people have tried the above solution and
USB still wouldn't work for them. I do not have the fstab edits that
are recommended and USB just works in VirtualBox 2.2.0 (and 2.1.4) for
me.

The thread, 'Sun Virtual Machine - openSUSE Forums'
(http://tinyurl.com/cfl9sw), has a long discussion about this problem.
The solution might have been found by hank_se, and clarified for me by
consused, if you read well into that series of posts. The files
/etc/udev/rules.d/60-vboxdrv.rules and
/etc/udev/rules.d/10-vboxdrv.rules are the bad actors, apparently,
particularly if both files are present.

I only have the 10-vboxdrv.rules file. As I said, USB just works.

I hope someone will find this helpful.

Hi
Very true about udev rules, positioning is a big issue. In getting the
barry utilities (blackberry) to work as a user I needed to move the
default rule to 65 as it was at 10 as well as some rule tweaks....

--
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 (i586) Kernel 2.6.27.21-0.1-pae
up 1 day 22:23, 2 users, load average: 0.07, 0.10, 0.03
ASUS eeePC 1000HE ATOM N280 1.66GHz | GPU Mobile 945GM/GMS/GME

Reply With Quote
  #9 (permalink)  
Old 14-Apr-2009, 15:52
Wise Penguin
 
Join Date: Jun 2008
Location: United Kingdom
Posts: 1,026
consused hasn't been rated much yet
Default Re: Virtual Box USB tips

Quote:
Originally Posted by caf4926 View Post
...Actually my intention was to focus on the steps of adding the device to the VM and the need to have the device removed when actually starting the machine, connecting it only when the VM is up and running. That is my experience anyway. I find the VM locks up at startup if the USB device is connected already...
I'm sure I read about that problem with some device or other, but luckily I haven't experienced it with usb sticks. On 11.1/kde 3.5, I plug it in before starting virtualbox, pick it up with the vm's usb filter setting, start up the vm that captures it, and finally the guest os (openSUSE 11.1 gnome) mounts it. On shutting down the vm, 11.1 gets it back with the normal pop-up requesting action - all very smooth. And I've repeated the test hundreds of times over the last couple of weeks. I have also had success with a Zoom guitar effects processor, but no printers where trouble has been reported. Good luck, you could end up with a big howto and lots of comments.
Reply With Quote
  #10 (permalink)  
Old 14-Apr-2009, 20:40
Puzzled Penguin
 
Join Date: Oct 2008
Posts: 30
ikurtram hasn't been rated much yet
Default Re: Virtual Box USB tips

Good How-To. Appreciate your effort. I've been able to use USB with virtualbox for quite a while now. However, the only issue I have is, usbfs is not being mounted automatically at boot-up. So, after boot-up, if I run mount -a as root and then run VirtualBox (as user), usb support is enabled. If I forget to execute mount -a manually, usb support is disabled.

Here is the line from my fstab. Anyone know how to change it so that it is automatically mounted at boot-up?

Code:
/sys/bus/usb/drivers   /proc/bus/usb   usbfs    auto,devmode=664,devgid=119   0 0
Thank you
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks

Tags
usb, virtual box


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2