Page 1 of 1

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

Posted: 30. Jan 2020, 01:01
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

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

Posted: 30. Jan 2020, 22:34
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.