Hello Proxmox Community,
I'm using Proxmox on my home server. I have several USB Devices (DVB-S Receiver, 3D Printer + Webcam) that I want to connect to my Server and use from Docker Containers (Running minisatip or octoprint). The USB Devices are turned off most of the time and are only turned on on demand. To access them, I have set up an unprivileged LXC Container with Debian 12, Docker and Docker Containers for the respective software. When starting everything manually, the docker containers can access the USB devices successfully.
What I would like to achieve is for the docker containers to be started and stopped automatically, whenever the corresponding USB device is plugged in/unplugged.
In the past, when I had everything running on plain Debian, I used a udev rule to run a script when a specific device was (un)plugged, essentially
. On my Proxmox Setup, this does not work. udev in the unprivileged LXC container does not appear to process rules or in fact receive events (I forgot to note down the exact error messages - but they amounted to "udev can't do anything here"). udev on the host does process rules successfully - I'm already using this to adjust the permissions on the USB devices for access by the unprivileged container. However, trying to inject a call into the container by making a rule call
(where up.sh contains the snippet from above and 103 is the lxc container in question) simply fails with an exit code 1 and no further information in either dmesg or syslog, not even which part of the call has failed.
I know that LXC and Docker are not a recommended combination. However, the bandwidth requirements of the DVB-S tuner far exceed what qemu can deliver for a VM on my hardware, so using a VM for this purpose is out of the question. I also have other USB devices in the system that are attached to several VMs (Zigbee Stick in one VM, low-performance USB Storage device in another), so making a VM and PCIe-Passthroughing the USB controller also is not an option for me.
I am now somewhat at a loss. How can I receive the Hotplug event anywhere on the machine and convert it into starting/stopping a docker container in a specific unprivileged LXC container?
Regards
Damian
I'm using Proxmox on my home server. I have several USB Devices (DVB-S Receiver, 3D Printer + Webcam) that I want to connect to my Server and use from Docker Containers (Running minisatip or octoprint). The USB Devices are turned off most of the time and are only turned on on demand. To access them, I have set up an unprivileged LXC Container with Debian 12, Docker and Docker Containers for the respective software. When starting everything manually, the docker containers can access the USB devices successfully.
What I would like to achieve is for the docker containers to be started and stopped automatically, whenever the corresponding USB device is plugged in/unplugged.
In the past, when I had everything running on plain Debian, I used a udev rule to run a script when a specific device was (un)plugged, essentially
Bash:
cd docker-dir; docker compose up
Code:
PUN+="pct exec 103 /dockerstuff/minisatip/up.sh"
I know that LXC and Docker are not a recommended combination. However, the bandwidth requirements of the DVB-S tuner far exceed what qemu can deliver for a VM on my hardware, so using a VM for this purpose is out of the question. I also have other USB devices in the system that are attached to several VMs (Zigbee Stick in one VM, low-performance USB Storage device in another), so making a VM and PCIe-Passthroughing the USB controller also is not an option for me.
I am now somewhat at a loss. How can I receive the Hotplug event anywhere on the machine and convert it into starting/stopping a docker container in a specific unprivileged LXC container?
Regards
Damian