Use an image or video on host machine as webcam input for a guest VM?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
RocketNuts
Posts: 4
Joined: 11. Jul 2018, 06:27

Use an image or video on host machine as webcam input for a guest VM?

Post by RocketNuts »

When running a Virtual Machine with VirtualBox, is it possible to specify a custom image or video as the input for the virtual webcam in the VM?

So if any application in the guest VM would access the webcam, it would get the contents of my image or video.

If this is possible, then is there also a way to do this from the command line, e.g. using VBoxManage?

Something like:

Code: Select all

VBoxManage controlvm MyVirtualMachine setwebcaminput /Users/RocketNuts/selfie.jpg
(Note that there is no actual 'setwebcaminput' command, it's just an imaginary example to illustrate what I'm looking for)

P.S. I did notice there is a 'webcam' command, supposedly to be used like this:

Code: Select all

VBoxManage controlvm MyMachine webcam attach <path>
But if I specify an image or video file for <path> it doesn't seem to work, I'm getting this error:
VBoxManage: error: Attach emulated USB webcam (VERR_PDM_NO_USBPROXY)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component ConsoleWrap, interface IConsole, callee nsISupports
VBoxManage: error: Context: "WebcamAttach(path.raw(), settings.raw())" at line 2029 of file VBoxManageControlVM.cpp
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Use an image or video on host machine as webcam input for a guest VM?

Post by scottgus1 »

Only thing I can suggest is to open the PDF copy of the Virtualbox manual in the Virtualbox installation folder, then search for 'webcam'. If there is a way, the manual will have it.

Alternatively, try to find a 3rd-party program that will fake a computer into thinking that there's a webcam when there isn't, and feed a video thereto.
Post Reply