X11docker: Webcam not available for Ring

Created on 11 Nov 2018  路  2Comments  路  Source: mviereck/x11docker

I am trying to use Ring in docker. I used your XFCE image as a base.
The --webcam option seems to work, I see /dev/video0, but Ring does not detect a camera.
I tried on the host of course and it work (with Cheese).
I noticed that the /dev/video0 not own by the video group in the container, contrarily to the host.

Here is the Dockerfile: https://framagit.org/snippets/2693

question

Most helpful comment

Good news!
I found that gnome-ring and cheese need some device information from udev.
Option --webcam now shares read access to /run/udev/data.

Now it is enough for cheese and gnome-ring to run with --webcam and --systemd or --dbus-system. No special privileges except webcam access are needed anymore.

Please update to latest master version or run with --sharedir /run/udev/data if you want to stay with current stable release.

All 2 comments

Thanks for reporting!

I've build your Dockerfile and can confirm that gnome-ring does not work ootb.

I got it to work with two changes:

  • I've also installed cheese in image. It seems that gnome-ring is missing a dependency that gets installed along with cheese. (I did not track down which one it is).
  • I run the image with --systemd and --privileged like so:
x11docker --webcam --systemd --gpu --desktop -- --privileged -- gnome-ring-image

Running with --privileged is a breakdown of container isolation, I cannot recommend it. Maybe it can be tracked down to a less privileged setup.
Though, I once failed to run cheese with less privileges than --privileged. I doubt it will be better with gnome-ring, but I don't know.
(Other webcam applications like guvcview don't need --privileged.)

I noticed that the /dev/video0 not own by the video group in the container, contrarily to the host.

That does work here, /dev/video0 belongs to group video in container. Can you please show me ls -l /dev/video0 in container and, for comparision, on host?

Good news!
I found that gnome-ring and cheese need some device information from udev.
Option --webcam now shares read access to /run/udev/data.

Now it is enough for cheese and gnome-ring to run with --webcam and --systemd or --dbus-system. No special privileges except webcam access are needed anymore.

Please update to latest master version or run with --sharedir /run/udev/data if you want to stay with current stable release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schra picture schra  路  3Comments

pahansen95 picture pahansen95  路  7Comments

sandrokeil picture sandrokeil  路  6Comments

SamLex picture SamLex  路  7Comments

vincent-163 picture vincent-163  路  9Comments