# USB devices no longer show up in /dev

**URL:** <https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238>\
**Category:** Product support\
**Tags:** raspberrypi4\
**Created:** [June 2, 2021, 7:38pm UTC](https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238 "2021-06-02T19:38:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttmetro](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@ttmetro](https://forums.balena.io/u/ttmetro)\
**Post date:** [June 2, 2021, 7:38pm UTC](https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238/1 "2021-06-02T19:38:54Z")

</div>

As of this week (?), dynamically plugged usb devices no longer show in `/dev`.

Setup:

- multi-container app
- Dockerfile for affected container sets “ENV UDEV=1” and does not override the ENTRYPOINT
- It is run as “privileged”

When I connect a USB device (example is an ESP32 but I’ve tried many others with same result), it shows up in `lsusb`:

```auto
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]

```

`dmesg` even shows the port the device is attached to (ttyUSB0):

```auto
[472.505837] usbcore: registered new interface driver cdc_acm
[588.133495] usb 1-1.4: new full-speed USB device number 5 using xhci_hcd
[588.244833] usb 1-1.4: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[588.253373] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[588.260848] usb 1-1.4: Product: CP2104 USB to UART Bridge Controller
[588.267342] usb 1-1.4: Manufacturer: Silicon Labs
[588.272167] usb 1-1.4: SerialNumber: 0160B5B8
[588.540347] usbcore: registered new interface driver cp210x
[588.546444] usbserial: USB Serial support registered for cp210x
[588.564967] usb 1-1.4: cp210x converter now attached to ttyUSB0

```

If I plug in a second device, dmesg reports `cp210x converter now attached to ttyUSB1`.

However, neither list in /dev.

Possibly relevant is a recent change to no longer run the container as root, i.e. added

```auto
RUN useradd -m -s /bin/bash -G dialout,netdev -U -u 1000 iot \
 && echo 'iot ALL=(ALL) NOPASSWD:ALL' | EDITOR='tee -a' visudo

USER iot
WORKDIR /home/iot

CMD ["/bin/bash", "/usr/local/bin/start.sh"]

```

Maybe this “broke” the usb mount - if so, what’s the fix?

---

<div class="post-metadata">

**Author:** ![ttmetro](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@ttmetro](https://forums.balena.io/u/ttmetro)\
**Post date:** [June 3, 2021, 2:19am UTC](https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238/3 "2021-06-03T02:19:40Z")

</div>

Yes, switching to a non-root user was the problem. Making the switch in start.sh instead fixed my issue.

I suspect the ENTRYPOINT script assumes the user is root.

---

<div class="post-metadata">

**Author:** ![nitish](https://avatars.discourse-cdn.com/v4/letter/n/34f0e0/32.png) [@nitish](https://forums.balena.io/u/nitish)\
**Post date:** [June 3, 2021, 12:26pm UTC](https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238/5 "2021-06-03T12:26:34Z")

</div>

Thanks for reaching out. It seems from your message you were able to resolve the issue via switching in `start.sh`. Anything we can help here answer for you?

---

<div class="post-metadata">

**Author:** ![cmfcruz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/cmfcruz/32/6878_2.png) [@cmfcruz](https://forums.balena.io/u/cmfcruz)\
**Post date:** [June 4, 2021, 12:52pm UTC](https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238/6 "2021-06-04T12:52:01Z")

</div>

Hi, are you still having issues accessing your USB devices? Let us know if there are still things that you need help with.

---

<div class="post-metadata">

**Author:** ![ttmetro](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@ttmetro](https://forums.balena.io/u/ttmetro)\
**Post date:** [June 5, 2021, 1:31am UTC](https://forums.balena.io/t/usb-devices-no-longer-show-up-in-dev/323238/8 "2021-06-05T01:31:53Z")

</div>

Everything works again after removing “USER iot” from my Dockerfile.  
Perhaps this could be added to the documentation:

- Privileged
- UDEV=1
- → add USER root

I switch the user in start.sh (run by CMD). The trick is to avoid inadvertently dropping back to root (exit, ^D).

Many thanks! I should say generally my experience with [Balena.io](http://Balena.io) has been excellent. It’s powerful and very reliable. Thanks!
