79

I was following this question but found a problem. Use my webcam with Ubuntu running in VirtualBox

I used guvcview to test the camera, it works. I installed the 12.04 virtualbox release from their website and installed the extension pack. But when I click the usb with the green plus sign it says no devices available.

enter image description here

3
  • 1
    You sure that the extension pack was correctly installed? Did you reboot both machines?
    – Braiam
    Nov 7, 2013 at 18:29
  • 2
    might be you didn't add your user to the vboxuser group?
    – user214636
    Nov 11, 2013 at 12:04
  • 1
    as of virtualbox 5 on 14.04, the user is 'vboxusers' (with an s) Jun 2, 2016 at 2:07

8 Answers 8

110
+50

This may help you access the USB devices in your guest OS hosted in Ubuntu

First install dkms to your host Ubuntu:

  • sudo apt-get install dkms

Next install Gnome-System-Tools to your host Ubuntu:

  • sudo apt-get install gnome-system-tools

Now launch the application - Users and Groups in host Ubuntu. If you're using Gnome you can do this by tapping the Super key and type user then click Users and Groups icon to start up the User Settings.

Click Manage Groups, find vboxusers, click properties, add your own user name and any other desired users to the vboxusers group. Click Ok. Alternative to using this GUI tool to add user to the group is to use the command sudo usermod -a -G vboxusers $USER .

It will also prove useful to ensure guest additions (enables features like mouse pointer integration, shared folders, shared clipboard, etc.) and extension pack (adds features like USB 2.0 and USB 3.0 Host Controller, Host Webcam, etc.) are installed. On command line, in host Ubuntu, use:

sudo apt-get install virtualbox-guest-additions-iso and

sudo apt-get install virtualbox-ext-pack .

To install guest additions in guest Ubuntu, click on "Devices" > "Insert Guest Additions CD Image..." . Then start a file browser e.g. Nautilus (in Ubuntu), Thunar (in Xubuntu). Here, in the side pane, you will see a new CD image been mounted. Click to go into the folder. Now right click and select to open a terminal in this directory. Then you should run the VBoxLinuxAdditions.run script with sudo privilege, as: sudo ./VBoxLinuxAdditions.run . This will install the guest additions. Alternatively, you can select to Run the script, as allowed by a dialogue box as soon as the guest additions ISO is mounted.

Next you'll have to log out and back in. Now start VirtualBox and proceed with adding the USB devices.

Start the VirtualBox Manager. Select one of the virtual machine of choice from the side panel. Then select from menubar: Machine -> Settings (Ctrl+S). Then in the dialog box select USB, then check on Enable USB Controller. Then based on whether your Webcam is a USB 2 or USB 3 device, select USB 2.0 or USB 3.0 radio button. Next, go to the Add USB device filters and add and checkmark the Webcam filter for your device.

addition of device filter

select USB 3.0 controller

Now you can start the virtual machine and use your webcam in there.

9
  • 1
    ajThapa Thanks! It was just that I wasnt in the users group.
    – Alex
    Nov 8, 2013 at 5:51
  • well scroll still doesnt work
    – Alex
    Nov 8, 2013 at 5:54
  • Please visit this link: askubuntu.com/questions/152742/…
    – rusty
    Nov 9, 2013 at 3:28
  • 2
    gnome-system-tools ended up being the last piece I needed. I'm on Ubuntu GNOME and had already made sure my user was in the vboxusers group, the latest extension pack was installed, and that USB was enabled for the VM. AFter a final reboot USB devices showed up.
    – STW
    Aug 27, 2014 at 15:35
  • 1
    I am on xUbuntu 14.04. I did only "Manage Groups, find vboxusers, click properties, add your own user name" + restart (no need apt-get install). It help. Now VirtualBox see all usb devices. Thanks. Jul 17, 2015 at 4:41
59

This command will add your account to the vbox users group. It will allow your VirtualBox to detect USB flash drives.

sudo usermod -G vboxusers -a $USER

$USER value is your username. You can see it with echo $USER

$ whoami
foo
$ echo $USER
foo

You could also replace $USER by your Home username.

Then logout or reboot your computer and VirtualBox will now detect USB devices.

Sources :
Virtualbox Documentation on Ubuntu (French)
VirtualBox/USB - Community Help Wiki (English)

6
  • 14
    usermod -G ... is error prone, use adduser $USER vboxusers instead.
    – guntbert
    Nov 11, 2013 at 16:27
  • this is the easiest way.
    – realhu
    Oct 12, 2015 at 7:19
  • 1
    Why is this not the accepted answer instead. The easiest
    – KhoPhi
    Jan 11, 2016 at 13:52
  • 1
    what is vboxusers here? adduser: The group 'vboxusers' does not exist. Feb 10, 2016 at 5:27
  • @Abhishek Bhatia then try 'adduser $USER vboxuser' If it doesn't work, you can try to install/reinstall virtualbox and the extension pack. Please note, that these commands must be used on the host system and not on the guest!
    – linux64kb
    Feb 19, 2018 at 5:46
6

It should be enough to run

sudo gedit /etc/group

then find vboxusers line and add to it's end Your user name.

After this reboot is suggested, but logging out or kill -9 -1 (which will probably log You out too) and logging in should be enough.

0
4

After having added yourself to the vboxusers group:

sudo gpasswd -a $USER vboxusers

If you naturally do not want to log out or restart for whatever reasons there are, you may run VirtualBox with a forced effective group:

sg vboxusers virtualbox

This should be unnecessarily after the next reboot.

1
  • 1
    You sir are a magician, previously what I'd end up doing was su $USER to start a new shell inside my current one with the new effective group in place. One thing to note is if you want to add any additional arguments to the command you should quote the command after sg vboxusers 'vagrant up' in my case.
    – dragon788
    Feb 17, 2018 at 20:56
2

I had the same problem with Linux Mint 17 (Ubuntu 14.04) using the standard distro version 4.3.20. gnome-system-tools and dkms were already installed but open-vm-dkms wasn't. I did this:

sudo apt-get install open-vm-dkms

After a re-boot, I could see the USB devices. The package exists in Ubuntu 12.04 and 14.04 as well so I assume it would work there too.

Could be a dependancy problem?

0

Try this. Once in VirtualBox, click on Devices --> USB Devices --> click on your desired USB device. Do you see the desired device?

enter image description here

1
  • 3
    no. Same thing. Just learned that scroll on mouse doesnt work in it too.
    – Alex
    Oct 26, 2013 at 18:55
0

I have Ubuntu 14.04 Lts.Installed 5.0.8 version of oracle Vm and ext. pack.Tried all above solutions.I could't see my usb devices.I downgraded Oracle VM virtualbox and extention pack to 4.3.32 and worked. I am outdated but at least works.

0
0

My fix was simple...

I had this problem today, and I think it was because I ignored a installation warning about some virtualbox service running. I had to restart my host, but afterward the USB was broken, which brought me here.

I re-installed Virtualbox from scratch, completely removing using "Programs and Features", then installed again.

Now the USB works correctly, I have devices showing up. I had to unplug and replug one of my devices to get it to work within the client however.

1
  • 3
    "Programs and Features" is a Windows thing.
    – user323419
    Feb 19, 2016 at 17:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .