LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Question: Virtualbox: Webcam access failure in guest (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/question-virtualbox-webcam-access-failure-in-guest-4175482417/)

haertig 10-27-2013 10:31 PM

Question: Virtualbox: Webcam access failure in guest
 
USB webcam access problem in guest. Both "guest additions" and "extension pack" are installed on guest. On host, added my userid to "vboxusers" group. Logged out/logged back in on host. Configured USB filter for Webcam in Virtualbox. Started guest. Guest can see webcam, but lists it as "unknown device" in the Devices->USB dropdown. "lsusb" in guest lists the device as a webcam. I start up "cheese" in guest, and all options are grayed out, even "Properties", so I assume this means that it is not seeing that a webcam is installed.

Attached picture shows host setup at the top of the pic, guest setup on lower half of pic.

Any ideas what I have done incorrectly? I'm guessing that the guest OS must need to load a driver for the webcam, and that hasn't happened, but I don't really know. Probably a dumb user error on my part. This is the first time I've tried to use USB in a guest. Note: the HP PSC950 printer usb device came through from the host to the guest as expected (e.g., it was not called an "unknown device" in the drop-down).

Host OS: LinuxMint13_Xfce_x64_LTS
Guest OS: same - LinuxMint13_Xfce_x64_LTS
Virtualbox v4.1.12 (from the LinuxMint13 repos)

http://img12.imageshack.us/img12/6060/fgnc.jpg

http://img12.imageshack.us/img12/6060/fgnc.jpg

camorri 10-28-2013 06:48 AM

Does the web cam work on the host with cheese?

I did some testing on my system, different web cam, and I'm on slackware. My guest is Win XP. so lots of variables. My setup looks the very similar. I don't see a problem there.

Your web cam is supported by 'Linux UVC driver and tools'. See this link -->http://www.ideasonboard.org/uvc/#download.
From the page above,
Quote:

Linux 2.6.26 and newer includes the Linux UVC driver natively. You will not need to download the driver sources manually unless you want to test a newer version or help with development.
I would guess you are using a newer kernel? If yes, then you should have UVC driver already.


Have you got guvcview installed? If not, give it a try, rather than cheese. It should work the kernel driver.

The other variable is the version of V-box. I'm running 4.2.10-r84104. Newer versions are available from v-box.

haertig 10-28-2013 10:43 AM

Thanks for responding.

Yes, the webcam works on the Host OS using cheese. My kernel is 3.2.0

I installed guvcview in the guest. When I start it, I get a popup: "Guvcview error: Unable to start with minimum setup Please reconnect your camera." I have tried reconnecting the camera (before I posted this thread even), and that does not make any difference.

I may have to try a newer version of VirtualBox. Since I'm on an older version of Mint (Maya - 13, the current Long Term Support version), I always try the software in the distro repos first, before moving to a newer version. That's kind of the reason for LTS releases, the software may not be the newest bleeding edge, but it's stable. In my case here though, "stable" may not equal "functional". I'll do a little more research into this to see if it can work with my current VirtualBox release, and then probably install a newer VirtualBox release if required.

haertig 10-28-2013 03:30 PM

I upgraded VirtualBox to the newest release ... 4.3.0 Actually I uninstalled everything related to my previously installed version 4.1.12 including config files, etc., and then installed 4.3.0 from scratch (DEB file downloaded from the Virtualbox website).

Unfortunately, this made no difference. The same USB "unknown device" problem still occurs with release 4.3.0

jefro 10-29-2013 02:50 PM

Boot to a live cd and see if the same happens with this device?

haertig 10-29-2013 04:21 PM

I created a new VM containing Ubuntu Server 12.04 (I needed that new VM anyway). Same problem with USB "unknown device" there. So I doubt it would be any better from a LiveCD either.

jefro 10-29-2013 08:44 PM

It is easy enough to test.

haertig 10-29-2013 09:49 PM

Same problem running a LiveCD in the VM. "unknown device". :(

jefro 10-30-2013 03:27 PM

Then we know it is an issue with the distro and not the virtual machine. I suspected that but wanted to be more sure with that test.

Then as camorri notes, you'll need to correct your client. Best to look at host when the usb is working for how and what driver is being used.

haertig 10-30-2013 04:32 PM

Thanks for your continuing help! :)

Quote:

Originally Posted by jefro (Post 5055431)
Then we know it is an issue with the distro and not the virtual machine.

I don't think so. But it is quite possible that something in the VM is preventing the Guest OS from detecting the webcam and working with it. Even though the OS of the Guest is perfectly capable of doing that on it's own (without the VM in the middle).

The distro on the Host and the distro on the Guest are identical. The webcam works on the Host, but not on the Guest. Both the Host and the Guest OS are "LinuxMint 13 Maya Xfce x64". Both were loaded from the same ISO download that I had burned to a DVD long ago. They were both loaded from the same physical DVD, and they both have all updates from the repos applied (the same repos for both Host and Guest).

No special drivers were loaded on the Host for the webcam to work. The distro came out-of-the-box with support for the webcam. This is expected, since UVC webcams have been supported directly by the Linux kernel since 2.6.something. And the distro I am running uses the 3.2.0 kernel (same exact kernel, same exact distro, in both the Host and the Guest).

So it's not the distro per se, but could be a combination of the distro and the VM when they are working together. The distro does fine with the webcam if the VM is not present.

gradinaruvasile 10-31-2013 02:09 AM

You should try a newer kernel. Since 3.2 many modifications were made to the usb handling.

I had a mobo that had some buggy usb drivers (nvidia MCP78 or something) and i even got kernel panics if i used a certain low end webcam (which was working fine in the host) in a VM. So the kernel is important even you pass it through to a VM. Since i changed the mobo to a different chipset (A85X), i had no issues.

jefro 11-01-2013 03:54 PM

When I suggested to boot to a live cd, did you boot the host? Since the host is working on it's normal distro, I wanted you to test host booted to a live cd and not the client vm.

haertig 11-02-2013 01:46 PM

No, I did not boot the HOST from a LiveCD. I don't understand why I'd want to do that. I'd have to install VirtualBox all over again in the LiveCD environment (not that that is difficult). But the Host already works just fine with the webcam.

I did try booting the Guest with a newer kernel. I booted the Guest with a LinuxMint 15 LiveCD. I can't remember what kernel that one used, but it was newer than the one I have been using in Mint 13. I still had the same problem with failure to access the webcam.

BUT, I did notice on booting the newer kernel LiveCD that an error quickly scrolled by regarding a problem with uvcvideo. Ahah! A clue. Chances are the older distros were seeing this same error and when booting them I just did not see it, or maybe the error was hidden from screenview on the older distros.

I've been busy the last few days and unable to investigate this newly found uvcvideo error. But I have a new direction to head off in for troubleshooting now. I just have to find the time to pursue it.

Code:

[  31.380198] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[  31.942563] Linux video capture interface: v2.00
[  33.936660] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
[  33.936803] usbcore: registered new interface driver snd-usb-audio
[  33.975414] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
[  33.992729] uvcvideo: Failed to query (129) UVC probe control : -32 (exp. 26).
[  33.992749] uvcvideo: Failed to initialize the device (-5).
[  33.992844] usbcore: registered new interface driver uvcvideo
[  33.992858] USB Video Class driver (1.1.1)
[  34.098367] 2:3:4: cannot set freq 48000 to ep 0x86
[  34.110372] 2:3:4: cannot set freq 48000 to ep 0x86
... this same "cannot set freq" message repeats several dozen times ...

The above messages are from dmesg in the Guest.


All times are GMT -5. The time now is 02:46 AM.