how to use video4linux and /dev/video0 in a linux guest?

Discussions about using Linux guests in VirtualBox.
Post Reply
stephanecharette
Volunteer
Posts: 300
Joined: 10. Nov 2007, 22:03
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu-64bit, Windows
Location: Kelowna, British Columbia, Canada
Contact:

how to use video4linux and /dev/video0 in a linux guest?

Post by stephanecharette »

Before I spend too much time trying to debug this, I figured I should ask. I want to use my webcam in my guest vm to capture some still images. Both host and guest are 64-bit Ubuntu. Host is 11.04, guest is 11.10 beta2.

In VirtualBox on the host, I created a USB device filter for device 046D:0819, my Logitec webcam. This webcam has always worked fine in Ubuntu. When I boot the guest with the USB device filter, I do see a /dev/video0 device in the guest and it no longer shows up in the host. I think this is expected. But as soon as I try to use any software that uses video4linux, or which tries to access /dev/video0 within the guest, the device disappears from the guest.

Looking at dmesg in the guest, I see lots of lines like this:

Code: Select all

[   62.850236] usb 1-1: new high speed USB device number 6 using ehci_hcd
[   62.944329] usb 1-1: device descriptor read/8, error -32
[   63.101419] usb 1-1: device descriptor read/8, error -32
[   63.210336] hub 1-0:1.0: unable to enumerate USB device on port 1
Meanwhile, the last 4 lines of the VB machine log contains this:

Code: Select all

00:00:15.409 Guest Additions capability report: (0x5) seamless: yes, hostWindowMapping: no, graphics: yes
00:00:21.444 EHCI: USB Suspended
00:01:03.731 EHCI: USB Operational
00:01:11.294 EHCI: USB Suspended
And the host dmesg also contains lots of USB-related errors, such as:

Code: Select all

[72941.802162] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0819)
[72941.902744] input: UVC Camera (046d:0819) as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.4/2-1.3.4:1.0/input/input9
[72980.614942] usb 2-1.3.4: USB disconnect, address 17
[72980.694504] usb 2-1.3.4: new full speed USB device using ehci_hcd and address 18
[72980.774068] usb 2-1.3.4: device descriptor read/64, error -32
[72980.963702] usb 2-1.3.4: device descriptor read/64, error -32
[72981.153249] usb 2-1.3.4: new full speed USB device using ehci_hcd and address 19
In your opinion, do you think it would be possible to use a webcam to capture still images in a guest vm, or is that probably beyond what would be supported by VirtualBox's USB abilities?
Post Reply