# libudev cannot monitor udev events inside container

**URL:** <https://forums.balena.io/t/libudev-cannot-monitor-udev-events-inside-container/363638>\
**Category:** Product support\
**Tags:** docker\
**Created:** [September 28, 2022, 8:12pm UTC](https://forums.balena.io/t/libudev-cannot-monitor-udev-events-inside-container/363638 "2022-09-28T20:12:57Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![wolvi-lataniere](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/wolvi-lataniere/32/8352_2.png) [@wolvi-lataniere](https://forums.balena.io/u/wolvi-lataniere)\
**Post date:** [September 29, 2022, 12:54pm UTC](https://forums.balena.io/t/libudev-cannot-monitor-udev-events-inside-container/363638/4 "2022-09-29T12:54:16Z")

</div>

Hello again,

I tried this on my device and succeed to reproduce your problem.  
It turns out that you probably should install `udev` and start the service on your container.

I could do it with your example C code and following `Dockerfile`

```auto
FROM debian:bullseye

RUN apt-get update &&\
    apt-get install -y build-essential libudev-dev udev

WORKDIR /test

COPY code.c .
RUN gcc -o code code.c -ludev

CMD service udev restart && ./code

```

Let me know if it solves your issue.

---

_[View the full topic](https://forums.balena.io/t/libudev-cannot-monitor-udev-events-inside-container/363638)._
