Dear community,
i am new to this forum and to Proxmox. I have started to use Proxmox some weeks ago, comming from a simple Raspberry installation for my home automation and some other apps.
I have setup a VM for my FHEM home automation with two USB devices (CUL and Homematic HM-CFG-USB). Further some LXC for Weatherstation, Cups and so on.
Setting up the LXCs I faced the usual issues with passing through the USB devices:
a) USB devices are changing their IDs when rebooting.
b) /dev/bus/usb/001/00x have "Nobody/Nogroup" owner in the containers.
Because I have only very basic Linux knowledge I tried to find solutions by gooling in very helpful communities and forums like this. Allthough thousends of postings for these kind of issues exist, I did not find a solution that fits for me. After hours of googling, testing and frustration Ifound the following solution for me:
My Solution for a) Instead of mounting only the one device that I need in the respective container I mounted the whole directory, so that all devices are available in all containers. The devices that are additionally passthroud' to my VM are still working:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir
My Solution for b) I defined an udev rule, that sets the owner/group to 100000:100000 for all USB devices:
SUBSYSTEM=="usb", OWNER="100000", GROUP="100000"
The combination of solution a) and b) seems to be working very well in my case, but I am not sure if this is an appropriate solution that will work long term without any side effects. Can someone please have a look? Maybe this is also an inspiration for others with the same challenge around passing through USB to LXcs.
Thank you very much !
Jens
i am new to this forum and to Proxmox. I have started to use Proxmox some weeks ago, comming from a simple Raspberry installation for my home automation and some other apps.
I have setup a VM for my FHEM home automation with two USB devices (CUL and Homematic HM-CFG-USB). Further some LXC for Weatherstation, Cups and so on.
Setting up the LXCs I faced the usual issues with passing through the USB devices:
a) USB devices are changing their IDs when rebooting.
b) /dev/bus/usb/001/00x have "Nobody/Nogroup" owner in the containers.
Because I have only very basic Linux knowledge I tried to find solutions by gooling in very helpful communities and forums like this. Allthough thousends of postings for these kind of issues exist, I did not find a solution that fits for me. After hours of googling, testing and frustration Ifound the following solution for me:
My Solution for a) Instead of mounting only the one device that I need in the respective container I mounted the whole directory, so that all devices are available in all containers. The devices that are additionally passthroud' to my VM are still working:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir
My Solution for b) I defined an udev rule, that sets the owner/group to 100000:100000 for all USB devices:
SUBSYSTEM=="usb", OWNER="100000", GROUP="100000"
The combination of solution a) and b) seems to be working very well in my case, but I am not sure if this is an appropriate solution that will work long term without any side effects. Can someone please have a look? Maybe this is also an inspiration for others with the same challenge around passing through USB to LXcs.
Thank you very much !
Jens