USB passthrough to unprivileged LXC

codemannh

New Member
Oct 28, 2022
4
0
1
I'm not sure what I'm doing wrong, but I have a Google Coral device that was connected on a server that was running Proxmox 7 and passed through to a privileged linux container. I had to move my NVR to a different server with a similar Proxmox configuration, but the LXC is unprivileged.

lsusb on the host:
Bus 002 Device 002: ID 18d1:9302 Google Inc.

lsusb on the container:
Bus 002 Device 002: ID 18d1:9302 Google Inc.

From the container conf file: (These are exactly the same as the former server, I verified the bus ID is still correct)
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/002 dev/bus/usb/002 none bind,optional,create=dir 0,0

When I run ls -al /dev/bus/usb on container, I see this:
total 0
drwxr-xr-x 3 root root 60 May 9 23:12 .
drwxr-xr-x 3 root root 60 May 9 23:12 ..
drw-rw-rw- 2 nobody nogroup 80 May 9 23:11 002

I was able to run ls previously, but now when I run it on the 002 directory I get permission denied.

When I run the same ls -al on the host:
total 0
drw-rw-rw- 2 root root 80 May 9 18:11 .
drwxr-xr-x 4 root root 80 May 9 18:11 ..
crw-rw-r-- 1 root root 189, 128 May 9 18:11 001
crw-rw-r-- 1 root plugdev 189, 129 May 9 18:11 002

It seems there is something to do with permissions, but I'm not knowledgeable enough to know how to address it. Now I've screwed up the permission on the host and can no longer even list the contents of /dev/bus/usb. Any pointers to get on track would highly appreciated.

Bill
 
Looks like a reboot fixed the permission denied on doing the ls -al on the container. Now I still need to figure out how to make sure the container user can access the usb device.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!