Page 1 of 1

Failure to access USB webcam in guest

Posted: 28. Oct 2013, 23:47
by Haertig
Problem: USB webcam shows up as "unknown device" in Virtualbox. Guest OS cannot access it.

Webcam is UVC device. Works in Host OS. Host OS userid is in vboxusers group. When configuring VM on Host, trying to create filter in USB tab, VirtualBox sees the webcam, but lists it as "unknown device". Create the filter anyway. Edit filter and change field values from "unknown device" to appropriate values. Start Guest. Guest sees webcam as "unknown device" and software running in Guest does not detect a webcam. "lsusb" in Host correctly sees and identifies webcam. "lsusb" in Guest also correctly sees and identifies webcam. But even though lsusb in Guest appears correct, Guest cannot access webcam.

VirtualBox version 4.3.0 (identical problem occured in version 4.1.12)
Host OS and Guest OS are both the same: LinuxMint 13 Maya Xfce x64 LTS
Guest Additions and Extension Pack are installed

lsusb output from Host

Code: Select all

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:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 012: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 003 Device 002: ID 03f0:1e11 Hewlett-Packard PSC-950
lsusb output from Guest

Code: Select all

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 002: ID 046d:0825 Logitech, Inc. Webcam C270
vboxmanage showvminfo from Host

Code: Select all

Name:            LinuxMint 13 Maya Xfce x64
Groups:          /
Guest OS:        Linux 2.6 / 3.x (64 bit)
UUID:            accec17c-ba15-484f-8ea8-ac3d00fc8d88
Config file:     /home/david/VirtualBox VMs/LinuxMint 13 Maya Xfce x64/LinuxMint 13 Maya Xfce x64.vbox
Snapshot folder: /home/david/VirtualBox VMs/LinuxMint 13 Maya Xfce x64/Snapshots
Log folder:      /home/david/VirtualBox VMs/LinuxMint 13 Maya Xfce x64/Logs
Hardware UUID:   00000000-0000-0000-0000-000000000000
Memory size:     1024MB
Page Fusion:     off
VRAM size:       128MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             off
Long Mode:       on
Synthetic CPU:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
State:           powered off (since 2013-10-28T20:27:15.000000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): /dev/sr1 (UUID: 00445644-0000-0000-2f64-65762f737231)
SATA (0, 0): /home/david/VirtualBox VMs/LinuxMint 13 Maya Xfce x64/LinuxMint 13 Maya Xfce x64.vdi (UUID: 6138bd70-7f75-4f15-bf70-1b9c73a80762)
NIC 1:           MAC: 080027654D29, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: PulseAudio, Controller: AC97)
Clipboard Mode:  disabled
Drag'n'drop Mode: disabled
VRDE:            disabled
USB:             enabled
EHCI:            enabled

USB Device Filters:

Index:            0
Active:           yes
Name:             Logitech, Inc. Webcam C270 046D:0825 [0010]
VendorId:         046d
ProductId:        0825
Revision:         0010
Manufacturer:     Logitech, Inc.
Product:          Webcam C270
Remote:           0
Serial Number:    F54183D0

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       /home/david/VirtualBox VMs/LinuxMint 13 Maya Xfce x64/LinuxMint 13 Maya Xfce x64.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
vboxmanage list extpacks from Host

Code: Select all

Extension Packs: 1
Pack no. 0:   Oracle VM VirtualBox Extension Pack
Version:      4.3.0
Revision:     89960
Edition:      
Description:  USB 2.0 Host Controller, VirtualBox RDP, PXE ROM with E1000 support.
VRDE Module:  VBoxVRDP
Usable:       true 
Why unusable: 
vboxmanage list usbhost from Host

Code: Select all

Host USB Devices:

UUID:               06fbd777-bfb6-45d0-8778-ff6c407e9ddd
VendorId:           0x03f0 (03F0)
ProductId:          0x1e11 (1E11)
Revision:           1.0 (0100)
Port:               1
USB version/speed:  1/1
Manufacturer:       Hewlett-Packard
Product:            PSC 950
SerialNumber:       MY19OB20CYWP
Address:            sysfs:/sys/devices/pci0000:00/0000:00:12.0/usb3/3-2//device:/dev/vboxusb/003/002
Current State:      Busy

UUID:               a2e2302f-e48e-415a-a4e8-b850df3cdea7
VendorId:           0x046d (046D)
ProductId:          0x0825 (0825)
Revision:           0.16 (0016)
Port:               3
USB version/speed:  2/2
SerialNumber:       F54183D0
Address:            sysfs:/sys/devices/pci0000:00/0000:00:12.2/usb1/1-4//device:/dev/vboxusb/001/012
Current State:      Busy

Re: Failure to access USB webcam in guest

Posted: 29. Oct 2013, 12:30
by mpack
You don't mention installing the guest driver. All USB devices - if not natively supported by the guest OS - will require you to install the application level driver for it, into the guest OS.

Re: Failure to access USB webcam in guest

Posted: 29. Oct 2013, 15:00
by Haertig
Thanks for the reply.

A missing driver is one of the first things I thought about. But there shouldn't be any special driver needed. UVC webcams have been supported in the Linux Kernel since 2.6.something. I'm using kernel 3.2.0. The webcam works fine in the Host OS, which is the exact same Linux distro and version as the Guest OS in my case. I didn't have to install any special drivers in the Host to make the webcam work there.

Also, when initially setting up the VM in the Host, the VirtualBox USB dialog where you add filters identified the webcam as "unknown device". It did successfully pick up the correct Manufacturer code and Device code (046D:0825), but still called it "unknown device". Conversely, other software in the Host picks up that 046D:0825 and correctly displays that as "Logitech, Inc. Webcam C270". I think VirtualBox's failure to do this points to the root cause of my problem. But that's just my theory.

I have screenshots illustrating this, but the forum will not allow me to post links with the error: "You must be a member for 1 days and have 1 posts before you can post urls". If I don't find the solution to this issue by then, maybe I can post those links in another day of so after my userid meets the requirements.

Re: Failure to access USB webcam in guest

Posted: 30. Oct 2013, 19:22
by Haertig
Here is a screenshot while setting up the VM on the Host OS. Note how both "lsusb" and "cheese" on the Host correctly identify a webcam, but VirtualBox calls it "unknown device". Note: this screenshot was taken with Virtual box version 4.3.0:

Image

Below is how the Host (top half of the picture) and Guest (bottom of the picture) see this "unknown device" thing. In the filter popup in the Host setup, I manually filled in the fields for "Name", "Manufacturer" and "Product" as they were initially "unknown device" and blank, but the "Vendor ID", "Product ID", "Revision" and "Serial No" fields were correctly pre-populated by VirtualBox. Note: this screenshot was taken with VirtualBox v4.1.12 - but the results are the same in 4.3.0:

Image

Re: Failure to access USB webcam in guest

Posted: 30. Oct 2013, 19:37
by mpack
I don't know enough to reliably comment on how a ID code is turned into a text name. I'd assume that something like a reverse DNS lookup takes place, or else the software needs a big library of parts.... but it wouldn't surprise or disturb me if I learned that VirtualBox doesn't bother to do any of those things. You seem to be saying that both host and guest can identify the device for you, which means that VBox is picking up the info and passing it along.

As to why it doesn't work, it could be a timing problem - VMs are not noted for their ability to use physical hardware. Or perhaps there is something odd about the device, e.g. it's a composite, and your filter is blocking some element of it.

Re: Failure to access USB webcam in guest

Posted: 30. Oct 2013, 19:51
by michaln
AFAIK that's just Logitech. They don't bother having the description strings on the device and assume that drivers installed on the host will recognize the ID. Ask Logitech why they do that.

Re: Failure to access USB webcam in guest

Posted: 30. Oct 2013, 20:11
by Haertig
Thanks for the replies. Actually, I consider this good news - i.e., that it is probably something on the Guest end rather than the Host end. My theory was that the problem was occuring because the VM setup in the HOST was not correctly recognizing the USB device, and thus passing unuseable data down to the Guest. But your replies make me think that this is really a non-issue, so my theory has been debunked. So now I will continue looking in to this as a problem on the Guest, not the Host (well, maybe it could still be something on the host).

I am not sure what your mean by a filter blocking some element of a "composite device". The webcam does include both video and audio (although in this case I don't care about the audio). But the webcam does have a microphone built-in. Still, lsusb on the Host only reports one element to describe the webcam, so I'm not sure it's a composite device in the first place.

To get around a filter potentially blocking some element of a composite device, is there a method to specify, in the VM setup on the Host, to allow ALL usb devices to pass through to the Guest? i.e., something like an * in all the filter fields?

Re: Failure to access USB webcam in guest

Posted: 31. Oct 2013, 13:06
by mpack
A composite devices acts like multiple devices on one network. I know they exist but I have no experience using one, in fact I use USB very rarely. I don't exactly know how to deal with them, but it would be one of two things: (1) eliminate a field from your field that distinguishes the two (a blank field is a wildcard) and see if VBox then connects both, or if that doesn't work (2) have one USB filters in the VM for each element.

But, I'm not convinced this is the problem. It could simply be a timing issue, i.e. the guest device driver doesn't like latency when talking to the camera controller (I assume there is one, to return exposure values and other telemetry).