A new user recently had an issue with configuring their Nortek HUSBZB-1 (a combined zwave and zigbee stick) on a docker install (ie Home Assistant Container), and asked a question about not being able to get it to work on this thread - Debugging Zigbee on Nortek HUSBZB-1 w/Docker on linux/Ubuntu They posted log issues related to the install that stated the following:
Sep 5 11:36:04 chipmunk dockerd[762]: time="2021-09-05T11:36:04.803994908-04:00" level=warning msg="path in container /dev/ttyUSB0 already exists in privileged mode" container=ff9c21f65f7d768dda4a2f999359c0577fa999673a15e5356063f0950ac1f566
Sep 5 11:36:04 chipmunk dockerd[762]: time="2021-09-05T11:36:04.804072798-04:00" level=warning msg="path in container /dev/ttyUSB1 already exists in privileged mode" container=ff9c21f65f7d768dda4a2f999359c0577fa999673a15e5356063f0950ac1f566
Sep 5 11:36:04 chipmunk dockerd[762]: time="2021-09-05T11:36:04.804106409-04:00" level=warning msg="path in container /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_31200456-if00-port0 already exists in privileged mode" container=ff9c21f65f7d768dda4a2f999359c0577fa999673a15e5356063f0950ac1f566
Sep 5 11:36:04 chipmunk dockerd[762]: time="2021-09-05T11:36:04.804143320-04:00" level=warning msg="path in container /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_31200456-if01-port0 already exists in privileged mode" container=ff9c21f65f7d768dda4a2f999359c0577fa999673a15e5356063f0950ac1f566
I’m not exactly sure why the poster on the other thread can’t get their zwave/zigbee stick to work, but the log issue appears to be a direct result of installing the container in with the --privileged:true option while still specifying devices with the --device option in the docker run command/compose.
Looking into this further, as a result of a recent github issue stating a user couldn’t get a zigbee stick to work - https://github.com/home-assistant/home-assistant.io/issues/18014
The documentation was then updated to say a home assistant container install should be installed in privileged mode through this PR - https://github.com/home-assistant/home-assistant.io/pull/18275. The updated documentation on this is here - Linux - Home Assistant
However, further down on the same page in that documentation, it still says that to map devices, you need to use the --device flag - Linux - Home Assistant
This appears inconsistent and will create issues, as demonstrated by the log warnings posted above. Using the --device flag properly should not need the --privileged:true flag. Also, it doesn’t seem necessary and is not best practice to give a container privileged, root access to the OS just to map a USB stick. In addition, if you use --privileged:true you shouldn’t use the --device flag, which will create the log errors posted above. Also, even If you do go with -privileged:true, I think you still need to map the usb devices in the dev directory as a volume (I could be wrong on this though since I’ve never installed a docker container in privileged mode)
I was going to submit an issue to at least suggest fixing the documentation around “Exposing devices” to be consistent with privileged mode, or is it best to just recommend removing -privileged mode and go back to the way it was with needing to specify devices under the --device flag? I’m not sure what the best way to suggest a fix to the documentation would be, or am I missing something here and the docker install documentation is ok? Despite what the documentation says, I’m not personally planning to install Home Assistant in privileged mode. I also don’t map USB drives to Home Assistant, and use other docker containers for that (zwavejs2mqtt with zstick mapped and zigbee2mqtt with zigbee stick mapped).