Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running X11 server inside a container #221

Closed
hoshsadiq opened this issue Feb 10, 2020 · 3 comments
Closed

Running X11 server inside a container #221

hoshsadiq opened this issue Feb 10, 2020 · 3 comments
Labels

Comments

@hoshsadiq
Copy link

I'm curious if it is possible at all to run x11 server and client inside a container. Reason for this is that I'd like to run a pi with nothing but docker and let docker continually pull an updated fully configured image. I know I can (obviously) run server on the pi, but I'm trying to have to avoid as any moving pieces within the pi, and so all the configuration required would be inside the container. Is this possible at all? I've done a lot of searching but have come out blank.

@mviereck
Copy link
Owner

Do you want the X server to access the hardware?

If you want to use a real Monitor at your pi, you would need Xorg with hardware access. That is possible with a highly privileged container, but I discourage it. If Xorg runs in a container, it might make wrong assumptions on the connected hardware and might damage it.

An invisible X server without hardware access like Xvfb would be no problem. You could remotely access it with xpra, or even run xpra+Xvfb in a container.

A third possibility is Xwayland in container and Wayland compositor Weston on host. See https://github.com/mviereck/dockerfile-x11docker-xwayland

@hoshsadiq
Copy link
Author

I think really you answered my question. Was hoping that it would be possible without increased privileges, so I'll try and use the ways you suggested. Thanks for your help!

@mviereck
Copy link
Owner

mviereck commented Jun 8, 2022

Finally x11docker allows to run Xorg in a container.
Since x11docker version 7.1.5-beta-17 this is possible with options --xc --xorg if image x11docker/xserver is provided.
The most important missing key was to share /run/udev/data with the container to allow right hardware detection for Xorg. Other important parts are capability TTY_SYS_CONFIG and devices in /dev/input.
The setup is still experimental. I hope it will work on other machines and setups as well.

The X container needs some advanced privileges, but they are not shared with the GUI container.
Dependencies on host are reduced now; however, X tools like xauth are still used from host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants