Linux Guides & Reviews
RSS icon Home icon
  • Virtualbox with USB Support

    Posted on May 7th, 2009 admin 25 comments

    This guide is specific to ubuntu jaunty (9.04).  It may work on previous version, or other distros, but it is untested.  If you do not need usb support in your copy of virtualbox, you can just install the open source version from the ubuntu package repositories by typing:

    sudo apt-get update
    sudo apt-get install virtualbox-ose

    If you need usb support in your virtualbox install (great for hooking up devices that are not compatible with linux), you need to install the proprietary version (also free), and do a few tweaks in order to get it to work.

    Installing USB Version:

    Make sure the open source version of virtualbox is uninstalled:

    sudo apt-get remove virtualbox-ose

    First, add the respective line to your /etc/apt/sources.list file according to the current version you are running (for example, add the first line if you are running Jaunty):

    deb http://download.virtualbox.org/virtualbox/debian karmic non-free
    deb http://download.virtualbox.org/virtualbox/debian jaunty non-free
    deb http://download.virtualbox.org/virtualbox/debian intrepid non-free
    deb http://download.virtualbox.org/virtualbox/debian hardy non-free
    deb http://download.virtualbox.org/virtualbox/debian gutsy non-free
    deb http://download.virtualbox.org/virtualbox/debian dapper non-free

    Download and add the key for the new repositories:
    wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -

    Install virtualbox:

    sudo apt-get update
    sudo apt-get install virtualbox-3.0

    Configure usb support:

    Edit:

    Editting /etc/init.d/mountdevsubfs.sh is no longer required after further review.

    Make sure you are part of the vboxusers group:

    sudo usermod -G vboxusers -a `whoami`

    Then, logout and back in.

    After that, in virtualbox, click on settings for the virtual machine, and go to usb. Make sure enable usb controller is enabled. Then click on OK, and see if it works.

    Make sure that you enable guest additions (if it is available for your guest operating system).  It makes the experience a lot more seamless, and easy to use.  You can move your mouse in and out of the guest window seamlessly, and the mouse is then a lot less jerky.

    Virtualbox Screenshot

    Virtualbox Screenshot

    Adapted from:  https://help.ubuntu.com/community/VirtualBox/USB

     

    22 responses to “Virtualbox with USB Support” RSS icon

    • You can get limited USB functionality with the OSE version by creating a “Shared Folder” to /media on the linux host. If the host can mount the USB device ( external hard drive, USB stick, etc )then the guest can access it through the shared folder.

    • Ahahahahahahahahahaha! You need a set of instructions on how to have USB support; wow, the open source version makes you so free!

    • dv_cool_fuel

      @derCchef your an idiot.

    • derChef,

      awesome that you can deride people from behind an alias. This time though at least we won’t be able to laugh at you because you can’t read a set of directions.

    • I’m not able to get the usb devices to be available in VirtualBox. I’m running Xubuntu 9.04 and there was nothing in my /etc/udev/rules.d/40-basic-permissions.rules when I edited, so I’m not sure if that is normal or if these configurations are stored elsewhere in Xubuntu? Any helps appreciated, thanks!

    • I have the same problem as Adaemox. No /etc/udev/rules.d/40-basic-permissions.rules file in Jaunty as far as I can see.

      My USB devices appear in the virtualbox usb menu at the bottom of the window but apart from the printer they are disabled.

      I have added a filter for the USB device I want to use and it is still disabled.

    • My bad. I just read back through what I said to do, and looked at a fresh install in a virtual machine. It looks like /etc/udev/rules.d/40-basic-permissions.rules does not exist, and you have to create it. Also, you need to edit one other file (detailed at the beginning of the configure usb support section).

      Please let me know if this fixes/doesn’t fix the issue.

    • VirtualBox 2.2 creates its own file.

      /etc/udev/rules.d/10-vboxdrv.rules

      in jaunty:

      andrea@andrea-laptop:~$ cd /etc/udev/rules.d/
      andrea@andrea-laptop:/etc/udev/rules.d$ dir
      10-vboxdrv.rules 70-persistent-cd.rules 70-persistent-net.rules README

      —————————————–

      your instructions are wrong.

    • on ubuntu 9.04, this does not work for me :/

    • I just recently tried it on a fresh install, and it worked for me.

      Did you reboot after installing, and running the commands?

    • Thank you for the instruction. This is very clear and helpful.

      Andrea is right, there’s a file created there /etc/udev/rules.d/10-vboxdrv.rules.

      I played with the permission file around a little bit and found that I can just configure it from Sun VirtualBox by going to Settings –> USB and click on Enable USB Controller.

      After selection the USB devices will show on the list of my Windows XP virtual machine. I had to avoid selecting my USB mouse and keyboard so it will not get caught by the virtual machine.

    • p.s., I am on Jaunty.

    • @polochen

      I updated the post to reflect what you said. I think that makes sense. I didn’t notice that virtualbox makes its own udev file, and you do not need to make your own.

      I also added the fact that you need to enable the usb controller. Hopefully that fixes it for people that are having trouble. Let me know if it doesn’t.

    • Hi,
      thanks a lot, i have checked this updated tutorial and it works fine for me. I a using ubuntu 9.04 AMD64 on Intel core 2 duo processor. I was able to use mass storage device successfully but my USB webcam does not show any image. it is detected in guest os (win xp sp3) and is installed coorrectly but no image just blank screen. camera works fine in host ubuntu.

    • Virtual Box on Jaunty does not require usbfs.

      See “Implementation Notes for Windows and Linux Hosts” at http://www.virtualbox.org/manual/UserManual.html#id2632723

      The only requirement is mambership in the vboxusers group.

    • Getting USB to work with VirtualBox using Ubuntu Jaunty 9.04 as host and windows as guest.
      (1). Made sure I was member of the vboxusers group
      (2). Made sure I was member of the users group
      With just (1), the USB devices were “grayed out” when I looked at the Devices -> USB Devices pull-down. When I did (2), i.e. adding myself to the ‘users’ group and log out then in again – then the USB devices were no longer grayed out

    • Hi

      i used this and it seems to work (I am able to see the IPOD in the USB devices menu), but I am not able to add it (eg “greyed out”) . I am a member of the users group any help would be much appreciated…

    • I edited:
      sudo gedit /etc/init.d/mountdevsubfs.sh
      and then I was still unable to connect usb (grayed out)
      Then I really made sure I was in “users” group (I wasn’t). Just logged out/in and bingo! it works now.

      Thank you.

    • @Jeff

      Thanks for the help. I tested this on a new install of ubuntu 9.04, and you definitely do not have to edit the /etc/init.d/mountdevsubfs.sh at all.

      The post has been updated above.

    • http://www.tuxguides.com/2009/05/07/virtualbox-with-usb-support/#comment-53

      Dean’s comment worked for me. I was doing everything but I needed to be a member of the user group, also. Before that it was all visible but greyed out.

    • Does not work for Kubuntu 9.10. usr/bin/dpkg error (1)

      Followed your instructions to the letter.

    • The “Configure usb support” step helped me mounting the usbs on my virtual WinXP running on Ubuntu 10.04. Thanks a lot!


    3 Trackbacks / Pingbacks

    Leave a reply