# Docker container cannot access dynamically plugged USB devices

**URL:** <https://forums.balena.io/t/docker-container-cannot-access-dynamically-plugged-usb-devices/4277>\
**Category:** balenaOS\
**Tags:** docker\
**Created:** [October 31, 2018, 1:03pm UTC](https://forums.balena.io/t/docker-container-cannot-access-dynamically-plugged-usb-devices/4277 "2018-10-31T13:03:54Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![rapha](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/rapha/32/1239_2.png) [@rapha](https://forums.balena.io/u/rapha)\
**Post date:** [February 4, 2019, 4:00pm UTC](https://forums.balena.io/t/docker-container-cannot-access-dynamically-plugged-usb-devices/4277/14 "2019-02-04T16:00:14Z")

</div>

@jason10 I found the solution for our needs:

I had not seen the `UDEV=1` env one can set in the balena base images:  
[https://www.balena.io/docs/reference/base-images/base-images/#working-with-dynamically-plugged-devices](https://www.balena.io/docs/reference/base-images/base-images/#working-with-dynamically-plugged-devices)

With that one set, as well as `privileged: true` plugging and replugging works. The service in the docker-compose.yml looks like this:

```auto
  cameracontroller:
    image: balenalib/jetson-tx2-ubuntu:melodic
    environment:
      - UDEV=1
    restart: never
    privileged: true
    devices:
      - '/dev:/dev'
    command: /bin/bash

```

---

_[View the full topic](https://forums.balena.io/t/docker-container-cannot-access-dynamically-plugged-usb-devices/4277)._
