Issue with USB passthrough debian 11 for deCONZ

Hello! I’m not sure if this is exactly an LXD related issue, please let me know if not.

In my setup I have an LXC debian container to run deCONZ, a zigbee device manager, which works through a USB gateway device.

I am running this on a raspberry pi, running raspberry pi debian image.

I had no issues when I was running debian 10, and creating a debian 10 container. Now I have updated to debian 11, and using debian 11 container I started to have issues with deCONZ reading the USB. From the software, I see that it does not pick vendor, product and firmware details and the gateway doesn’t seem to work.

In order to mount and make available the usb, I am doing the following:

  • In my profile;
  raw.lxc: |-
    lxc.cgroup.devices.allow = c 166:* rwm
    lxc.mount.entry = /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file 0 0
  • Inside the container;
  chown root:dialout /dev/ttyACM0
  chmod 664 /dev/ttyACM0
  mkdir -p /run/udev/data
  setcap cap_net_bind_service+ep /usr/bin/deCONZ
  echo -e 'E:ID_VENDOR_ID=1cf1\nE:ID_MODEL_ID=0030' > /run/udev/data/c166:0

I have tried mounting /dev/bus/usb/001/003 device address instead ( with the right cgroup number; 189 ) and I tried using lxc config device add instead. I also tried running a debian 10 container ( host debian 11 ) with the same variations but no success. It only worked again when I reverted my host to debian 10. It also worked smoothly when installing the software directly on the host ( debian 11 )

Some more info; deCONZ provides a CLI vendor utility to check for USB stick GCFFlasher_internal -l
This command only lists the USB ( tested when running host and container debian 11 ) when I mount usb as ttyACM0 ( still not read from software ).

Any chance someone can point me out how to debug and fix this? This is the only thing in my whole set up that might make me roll back to debian 10.

I tested this with a debian 10 host, running a debian 11 container and it works. The USB passthrough seems to not work properly only when the host is debian 11.

Out of interest, why did you go the raw.lxc route rather than using the built-in LXD usb or unix-char devices:

Sorry what I meant with “config device add” is using the type-usb, I think I also tried with type-unix-char when I was initially setting this container up a while ago but I had no success. I’m not sure what is the difference between type-usb and type-unix-char, I will try again with the latter one.

Also mainly I followed this guide, and even though I realized I was passing through the usb in a more old fashioned way, the was the only way it worked for me.