/dev/video0 accessible as root only

Discussions related to using VirtualBox on Mac OS X hosts.

/dev/video0 accessible as root only

Postby neilyoung » 17. Oct 2021, 18:56

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?
neilyoung
 
Posts: 6
Joined: 17. Jun 2021, 21:07

Re: /dev/video0 accessible as root only

Postby scottgus1 » 17. Oct 2021, 19:07

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.
scottgus1
Site Moderator
 
Posts: 13876
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: /dev/video0 accessible as root only

Postby neilyoung » 17. Oct 2021, 19:09

What do you mean? What method?
neilyoung
 
Posts: 6
Joined: 17. Jun 2021, 21:07

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

Postby neilyoung » 17. Oct 2021, 19:12

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
neilyoung
 
Posts: 6
Joined: 17. Jun 2021, 21:07


Return to VirtualBox on Mac OS X Hosts

Who is online

Users browsing this forum: No registered users and 17 guests