Running X server via Docker
Lately, I have been using a Docker server Linux laptop. On the laptop, I do all; programming, browsing, using Twitter, using Slack, and seeing YouTube. So, I have been running an X Server in a container and using GUI directly.(It’s not directory :)
I will explain the how-to.
Architecture:
0. My laptop is
Ubuntu Server 16.04.3 LTS (64bit)
|
|
1. build a container that has an X server and X clients.
Dockerfile:
|
|
- The “xserver-xorg-legacy” is needed to run startx from a normal user.
- The sed script that editing “/etc/X11/Xwrapper.config” is also needed to run startx from normal a user.
2. run the container with the options.
|
|
--privileged
option is needed to display GUI./run/udev
is needed to use mouse and keyboard./run/dbus
and/run/systemd
are needed to use systemd. If you do not need systemd, the options are needless.--shm-size
option sets the shared memory size. To using applications such as Google Chrome, it’s the needs the large size of shared memory. The default value is only 64MB!
3. My REAL settings
My REAL settings are below:
- docker-x11-base: an X server, X clients, and standard tools.
- docker-x11-wm: docker-x11-base + window manager.
- docker-desktop: docker-x11-wm + my favorite applications.
I am updating them as necessary, cheers.
Biography
- https://docs.docker.com/engine/reference/run/
- https://superuser.com/questions/688766/how-to-start-xorg-server-inside-plain-chroot
- https://gist.github.com/alepez/6273dc5220c1c5ec5f3f126e739d58bf
- https://bbs.archlinux.org/viewtopic.php?id=185294
- https://wiki.archlinux.org/index.php/Xorg#Rootless_Xorg
- https://www.archlinux.org/news/xorg-server-116-is-now-available/