Webcam autostart

Discussions related to using VirtualBox on Windows hosts.
Suncatcher
Posts: 79
Joined: 5. Nov 2013, 16:10
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: BodhiLinux, Windows 7
Location: Honolulu

Webcam autostart

Post by Suncatcher »

Is it possible to to make webcam start automatically in guest OS? I mean without going to Devices menu and checking webcam checkbox.
Especially I'm interested in headless mode via VRDP.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

Use USB filters within the VM configuration
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Suncatcher
Posts: 79
Joined: 5. Nov 2013, 16:10
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: BodhiLinux, Windows 7
Location: Honolulu

Re: Webcam autostart

Post by Suncatcher »

noteirak wrote:Use USB filters within the VM configuration
But I cannot find my webcam among them. My laptop is Asus S500CA
How to determine which of the devices is webcam? I see one "unknown device" among them but it doesn't seem to be webcam because I tried to add it and haven't succeed.
Attachments
Untitled.png
Untitled.png (47.69 KiB) Viewed 3161 times
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

Webcam on laptop usually mean it can't be used, since they are directly locked by the host OS without a way to disconnect the webcam and get the lock on Virtualbox.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Suncatcher
Posts: 79
Joined: 5. Nov 2013, 16:10
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: BodhiLinux, Windows 7
Location: Honolulu

Re: Webcam autostart

Post by Suncatcher »

noteirak wrote:Webcam on laptop usually mean it can't be used, since they are directly locked by the host OS without a way to disconnect the webcam and get the lock on Virtualbox.
It's sad.
But on the Windows 7 guest webcam works stable if connected manually.
Or do you mean that it's impossible to autoconnect webcam on laptops?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

I mean the host OS locks the webcam, and it cannot be unplugged to release the lock. So Virtualbox can never get a lock on it, and pass it to the guest.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Suncatcher
Posts: 79
Joined: 5. Nov 2013, 16:10
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: BodhiLinux, Windows 7
Location: Honolulu

Re: Webcam autostart

Post by Suncatcher »

noteirak wrote:I mean the host OS locks the webcam, and it cannot be unplugged to release the lock. So Virtualbox can never get a lock on it, and pass it to the guest.
But as I say
But on the Windows 7 guest webcam works stable if connected manually.
I mean my Win 7 guest is running on the same laptop.
Is is a pleasent exception and undocumented feature? It shouldn't be so?
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

So the list is not the same while the VM os running or powered off?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Suncatcher
Posts: 79
Joined: 5. Nov 2013, 16:10
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: BodhiLinux, Windows 7
Location: Honolulu

Re: Webcam autostart

Post by Suncatcher »

noteirak wrote:So the list is not the same while the VM os running or powered off?
Yes. List is not the same. If I do not connect webcam via Devices menu list will look like this:
no cam.png
no cam.png (21.62 KiB) Viewed 3138 times
If I connect it, the unknown device will transform into Azurewave USB2.0 UVC HD Webcam
connected-1.png
connected-1.png (6.67 KiB) Viewed 3138 times
Then I made some trick. I've added cam to USB filters during machine run when it recognized.
cam filter.png
cam filter.png (36.74 KiB) Viewed 3138 times
Suncatcher
Posts: 79
Joined: 5. Nov 2013, 16:10
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: BodhiLinux, Windows 7
Location: Honolulu

Re: Webcam autostart

Post by Suncatcher »

But trick had no sense - it haven't been connected during boot. Furthermore, if the filter is enabled it doesn't work even if connected manually.
It can be seen on screenshot - Skype tried but couldn't get picture from cam and then wrote "Cannot use. The device is busy by other program" or something similar.
connected.png
connected.png (102.9 KiB) Viewed 3138 times
But I don't give up so easy and I've made some tests.
Some cases all was wonderful: the cam was connected on boot and it worked!!!
Some cases failed: the device have been unrecognized and and have been listed as "unknown usb device".
Some cases were 50/50: the device worked (when connected via Device/Webcam) but not listed correctly (the screens were made during the same boot):
yes-no.png
yes-no.png (96.79 KiB) Viewed 3138 times
yes-no1.png
yes-no1.png (12.22 KiB) Viewed 3138 times
In some cases the device didn't worked and didn't listed correctly.

I can conclude that I wasn't able to achieve unambiguous behavior of the program.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

In the Device Manager in the host, do you always see the webcam under its true name when you see it as "Unknown Device" in Virtualbox?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Webcam autostart

Post by mpack »

AFAIK, "Unknown device" simply means that the device driver doesn't supply a readable name, just a numeric ID. It doesn't imply less functionality.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

Indeed, but from the OP screenshots, it is not always named "Unknown Device", so I suspect the issue being on the host.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Webcam autostart

Post by mpack »

Or the two menus use two different methods for obtaining the device name. :-)
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Webcam autostart

Post by noteirak »

That would be nasty then, and bug-prone. But AFAIK they both use the same method, being only one in the API.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply