Uv4l /dev/video0 device in multi-container

Hi All,

Am experimenting with webrtc on uv4l, using the raspberry pi, with plain old balenalib/raspberrypi3. Everything seems to work well, in that I’ve got the uv4l server starting, and it manages to create the /dev/video0 device… but only on the host OS (that is, the command is run within the container, but the device is only seen in host). The device is not present at all within the container from which uv4l is running. In terms of the normal things to try:

  1. The container is running in privileged mode
  2. I’ve tried manually forcing a udev refresh using udevadm
  3. I’ve added the SYS_RAWIO capability to the container

None of these things cause the /dev/video0 device to show up within the container.

Does anyone have any idea on what else I could try?


Hi @cmoss,

I have no personal experience with uv4l, but did you try to add /dev/video0:/dev/video0 to devices? Check the Interact with hardware page to see what I mean.

Yes, I tried that as well. The issue is that /dev/video0 doesn’t exist until the uv4l server is run. To rule out any multi-container issues, I tried the same thing in a single container app, and have encountered the same problem.

Is this sample project of any help? If not, I’ll try to ask more experienced colleagues.

Unfortunately no, I’ve looked at that too (in fact, that’s what I’ve based the installation of uv4l on).

Again: the issue isn’t in creating the device, or running any of the uv4l tools - the issue is purely in ensuring that the /dev/video0 device is available from within the container running the tool.

As a workaround, I’ve issued the mknod commands manually within the container, and that seems to work. The container has the UDEV=1 env var defined, but that doesn’t seem to be propagating dev fs changes properly.

The device is running balenaOS 2.31.5+rev1 - is there anything in there that might cause problems?


Hey @cmoss,

I’m glad that you found a workaround. I’m still going to get the BalenaOS to help you further, and to see whether we can properly fix it