Stream linux destop as fake webcam to virtuabox windows guest

Super User Asked by nick maxwell on January 1, 2022

I would like to capture (a part of) my linux desktop (ubuntu 20.04), stream it as a webcam to a windows 10 guest VM running in Virtualbox.

I found Using desktop as fake webcam on linux which got me pretty far.

So I installed v4l2loopback (apt install v4l2loopback-dkms), then ran modprobe v4l2loopback.

Then I ran the ffmpeg command: ffmpeg -f x11grab -framerate 25 -video_size 1280x720 -i :1.0+0,0 -f v4l2 /dev/video0

This works in that I can open /dev/video0 in VLC (Media > Open Capture Device> open /dev/video0) and see the stream.

It also works in that Virtualbox is able to see the /dev/video0 device. This is by navigating to "Devices > Webcams". I had to install the virtual box extension pack (sudo apt install virtualbox-ext-pack).

Virtual box names the webcam device as "Dummy video device (0x0000", which matches the output of v4l2-ctl --all -d /dev/video0 | grep "Card type" : "Card type : Dummy video device (0x0000)". The other devices it lists also similarly correspond correctly to /dev/video<0-6>.

So I’m confident that virtualbox is picking up on the right video feed.

The only problem is that windows only gets a blue screen (of course!) as the webcam feed. I don’t see the correct video feed that I get in VLC.

enter image description here

enter image description here

I did find this page:, but haven’t been able to make heads-or-tails of the answer. I don’t know much about ffmpeg or gstreamer!

I may try the same thing with an ubuntu guest OS to make narrow it down to a Windows problem, or a video formatting problem.

Thanks in advance for any suggestions!

One Answer

OK so the answer is to output in yuyv422 format

in my case

ffmpeg -loglevel verbose -f x11grab -framerate 25 -video_size 1280x720 -i :1.0+0,0 -f v4l2 -vf format=yuyv422 /dev/video6

you may have to figure out which /dev/video# is the right one.

Answered by nick maxwell on January 1, 2022

Add your own answers!

Related Questions

How to install pysvn library for python installed under cygwin

1  Asked on January 5, 2022 by kavita-garg


Accessing Localhost from Hyper-V VM

1  Asked on January 5, 2022 by tim-almond


nginx php can’t write files on CentOS machine

2  Asked on January 5, 2022 by ctrlz


How to permanently disable a built-in keyboard

3  Asked on January 5, 2022 by janos-braem


Heatsinks next to CPU socket?

1  Asked on January 5, 2022


Kali Software Center No Application Data Found

4  Asked on January 5, 2022 by dimidak


sudo twice become method for Ansible

1  Asked on January 5, 2022


Colored copy of PuTTY window

2  Asked on January 3, 2022 by kuroki-kaze


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP