Page 1 of 1

/dev/video0 accessible as root only

Posted: 17. Oct 2021, 18:56
by neilyoung
Hi,

I'm running an Ubuntu 20.04 Server guest in my VB 6.1 on macOS Big Sur. I'm forwarding a USB camera into the VM.

ls -lall /dev/video0
crw-rw---- 1 root video 81, 0 Oct 17 15:57 /dev/video0

Running a GStreamer pipeline using this camera is only possible if using "sudo". I can temporarily assign myself to be the owner of this device, but this is changed again to root on unplug/plug.

Is there any way to have non-root access to this device permanently?

Re: /dev/video0 accessible as root only

Posted: 17. Oct 2021, 19:07
by scottgus1
The method you're using does not sound like a Virtualbox method. See https://www.virtualbox.org/manual/ch09. ... assthrough for the Virtualbox method. This should not require sudo.

Re: /dev/video0 accessible as root only

Posted: 17. Oct 2021, 19:09
by neilyoung
What do you mean? What method?

Re: /dev/video0 accessible as root only [SOLVED]

Posted: 17. Oct 2021, 19:12
by neilyoung
Ok, disregard.

I had to install VB Extension on the guest:

sudo apt install virtualbox-ext-pack

Then I added myself to the group vboxusers:

sudo usermod -a -G vboxusers ubuntu

Logged out/in.

After that I was able to open this pipeline as non-root:

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-h264,profile=constrained-baseline,width=1920,height=1080,framerate=30/1 ! h264parse ! rtph264pay config-interval=1 ! application/x-rtp,media=video,encoding-name=H264 ! fakesink