LXC Unprivileged - USB Passthrough issue

carda

New Member
Mar 16, 2024
1
0
1
I am currently passing through my google coral simply using the GUI and select the device id. Issue I have is the device ID changes on startup sometimes. I wanted to swap to passing the whole USB through but I am having issues.

When I add the following to the LXC container config:

lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/002 dev/bus/usb/002 none bind,optional,create=dir

I get the following error when starting the container..

lxc-stop: 108: ../src/lxc/confile.c: parse_line: 3099 Invalid argument - Invalid configuration line: lxc.cgroup2.devices.allow: c 189:* rwm
lxc-stop: 108: ../src/lxc/parse.c: lxc_file_for_each_line_mmap: 129 Failed to parse config file "/var/lib/lxc/108/config" at line "lxc.cgroup2.devices.allow: c 189:* rwm"
Failed to load config for 108
lxc-stop: 108: ../src/lxc/tools/lxc_stop.c: lxc_stop_main: 144 Error opening container


Output of ls -la /dev/usb/002

ls -la
total 0
drwxr-xr-x 2 root root 80 Sep 8 11:55 .
drwxr-xr-x 4 root root 80 Sep 8 11:14 ..
crw-rw-r-- 1 root root 189, 128 Sep 8 11:15 001
crw-rw-r-- 1 root root 189, 131 Sep 8 11:55 004


Any ideas please?