You are not logged in.

#1 2022-02-12 22:31:33

mwigzell
Member
Registered: 2016-01-29
Posts: 38

[SOLVED] device shows no permission for world but I can use it, why?

I'm trying to understand why my webcam device /dev/video0 is not accessible in an LXC container.

mark@confucius:~$ ls -al /dev/video0
crw-rw----+ 1 root video 81, 0 Feb 10 20:31 /dev/video0

I can use it no problem, but my unpriveleged LXC container started as root cannot (permission denied). So ok I get it, owner root and group video are unknown in the container. But then, on my host there is no world permission, and I am not in the video group, so how am I able to use it on my host but not in my container? If I understand this, then I might be able to use some mapping trick to allow me to use it in the container.

#/etcsubuid and /etc/subgid:
root:100000:65536
#/var/lib/lxc/playtime/config:
lxc.idmap = u 0 100000 65536
lxc.idmap = g 0 100000 65536
...
lxc.cgroup.devices.allow = c 81:0 rwm
lxc.mount.entry = /dev/video0 dev/video0 none bind,optional,create=file

(trying to map my LXC container named "playtime" such that /dev/video0 allows access in the container.)
I know there was a bunch of auto mounting type stuff to allow access to USB devices, so is this something to do with the USB device hierarchy, udev rules or something? Any hint about how I can get access to /dev/video0 in my container ?

Last edited by mwigzell (2022-02-13 18:42:00)

Offline

#2 2022-02-13 07:58:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,071

Re: [SOLVED] device shows no permission for world but I can use it, why?

https://man.archlinux.org/man/getfacl.1 - logind gets the active session user access via ACL

Last edited by seth (2022-02-13 07:59:13)

Online

Board footer

Powered by FluxBB