webcam not working in vbox guest machine

Discussions related to using VirtualBox on Linux hosts.
Post Reply
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

webcam not working in vbox guest machine

Post by neuronetv »

I have a centos 7 64 bit host machine running VirtualBox-5.1-5.1.18_114002_el7-1.x86_64 with a fedora 23 64 bit guest. Vbox is command line only on the host and I've succeeded in passing a usb ms lifecam webcam to the fedora 23 guest but it does not work in the guest machine. Everything looks fine, /dev/video0 is present in the guest but neither cheese nor vls will play the webcam. The webcam works fine in the centos 7 host and also works fine in a normal fedora 23 machine. I have virtualboxguestadditions installed on the guest machine. Does anyone know what the problem could be?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: webcam not working in vbox guest machine

Post by socratis »

Webcams are a special case of a USB device. Did you use the "USB attach" method or did you use the webcam specific method? I can't quite understand from your wording. And you do not need the Guest Additions (GAs) on the guest. You need the Extension Pack on the host, the same version as VirtualBox.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: webcam not working in vbox guest machine

Post by neuronetv »

thanks for your response socratis, I already have the extpack installed. To give the webcam to the guest I used
$ VBoxManage list usbhost <-- this gave me the UUID number of the webcam on the host
then on the host I ran
$ VBoxManage controlvm fedora23 usbattach <long-UUID-number> and the guest then picked up the webcam and it appeared as /dev/video0.
edit: I've just discovered though that if I run a vbox from root the webcam works in the guest, but if I run vbox as a user the webcam doesn't work in the guest, even though it's there as /dev/video0. I don't understand why that would be. Also I haven't heard of the the 'webcam specific method'. Thanks if you can shed any further light.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: webcam not working in vbox guest machine

Post by socratis »

neuronetv wrote:Also I haven't heard of the the 'webcam specific method'. Thanks if you can shed any further light.
Sure. You are using the webcam as a standard USB device. There is a webcam specific method, see ch. 9.3 Webcam passthrough.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: webcam not working in vbox guest machine

Post by neuronetv »

thankyou for that link, I followed what was there and I'm slowly getting there I think. The webcam is trying to work because now instead of cheese saying "no devices found" it's now showing a blue screen where there would normally be an image. So I'm getting close. I brought the frame rate down to 10fps with MaxFramerate=10 but I'm not sure if or what the MaxPayloadTransferSize should be. The webcam is a 3Com HomeConnect USB Camera.
I also tried the same steps with a MS lifecam cinema but cheese said there was an error playing video from the webcam. I also tried vlc media player in the guest with the ms lifecam - it gave no error but also no video, same with the 3com homeconnect. So something is still missing...
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: webcam not working in vbox guest machine

Post by socratis »

I've never tried with the command line (CLI) only, but I will be able to try it tomorrow. Until then, what happens if you don't mess with the parameters at all? In the GUI there are not parameters that you can tweak, so I'm assuming that the defaults simply work out of the box and the settings are there for special cases. Again, I haven't tried the CLI option. From the GUI, three different webcams worked out of the box, in almost every guest I can think of.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply