Webcam in VirtualBox (Ubuntu Guest/Ubuntu Host)

I have already read the following questions:

  • https://askubuntu.com/questions/126399/unable-to-start-webcam-in-ubuntu-virtual-box
  • Use my webcam with Ubuntu running in VirtualBox
  • Integrated webcam cannot be used in VirtualBox Guest XP

and yet I still have problems getting my webcam (Lenovo Easy Camera) to work under VirtualBox in an Ubuntu (12.04) Host. The host machine is a Lenovo ideapad U410 running Ubuntu 12.10.

In the host machine the camera is not listed in lsusb, yet works fine with all applications (listed under /dev/video0).

I was wondering if there is anyway to get the camera working in the guest machine.

lsusb in host:

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 13d3:5163 IMC Networks 
Bus 003 Device 003: ID 8087:07da Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

P.S.

Even though running an Ubuntu guest inside an Ubuntu host machine (inception!) sounds idiotic, I have some good reasons for that!


Solution 1:

Late to the party, but I hope this helps someone out there:

On virtualbox 5.0.14 on Ubuntu Host, with Windows 10 Guest. Should work for Ubuntu or whatnot as guest.

Follow the steps found on Virtualbox Manual

TL;DR:

Do below when the guest OS is running.

~$ VBoxManage list webcams
Video Input Devices: 1
.1 "USB 2.0 Webcam Device"
/dev/video0
~$ VBoxManage controlvm "Windows10" webcam attach /dev/video0

In this case,

  • my guest OS is Windows10
  • the host path or identifier pointing to the host webcam is /dev/video0
  • using default framerate for host Webcam

Solution 2:

To have the integrated webcam working, I did the following:

  1. Make sure you have GuestAdditions
  2. I installed the Virtualbox Extension Pack for my version (4.3.10 Ubuntu), which you can find here https://www.virtualbox.org/wiki/Download_Old_Builds
  3. I went to Virtualbox>Settings>USB and added an unnamed device
  4. From terminal: sudo adduser <MyUserName> vboxusers
  5. In the running VM I install the webcam from the virtualbox menu of my (Windows) VM: Virtualbox menu of VM>Devices>Webcam

Not sure that all these steps are strictly needed. I have Oracle VM VirtualBox Manager 4.3.10_Ubuntu the webcam does not appear in lsusb