USB Passthrough to LXC that will survive a reboot

n7qnm

New Member
Jan 4, 2024
18
3
3
Prosser, WA, USA
www.n7qnm.net
I'm trying to run a Software Defined Radio USB dongle and the program RTL_433 that reads it - I've managed to get a passthrough set up with these lines in /etc/lxc/<vm>.config:
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/003/002 dev/bus/usb/003/002 none bind,optional,create=file

That's great; but it won't survive a reboot of the node where the dongle is connected.

Worst case, the USB ids change, BEST case "only" the permissions on the /dev entry on the host nodes change.

is there a way to do this?

Thanks!
 
Usually, one would pass the dev-node(s) that are created by the driver (which are stable) on the Proxmox host, instead of /dev/usb/...
I don't know which files those are (since I only know them for my USB TV-tuner) but then you can also use the new way of passing dev-nodes via the Proxmox GUI (which makes dealing with users/groups/permissions much easier). I would compare the /dev directory tree before and after inserting the USB device.