Starting the server would try to claim your video devices, usually resulting in loss of video output as your host’s original X server gets its devices yanked away.Ī better approach is to mount your host’s X Server socket into the Docker container. You’d need to run Docker in privileged mode ( -privileged) so it could access your host’s hardware. Trying to run an X Server in Docker is theoretically possible but rarely used. (Alternative windowing systems, such as Wayland, are available – we’re focusing on X in this article.)
GUI applications can’t render without an X Server available. X Servers such as Xorg provide the fundamental graphical capabilities of Unix systems. The next component is the X Window System. Unlike a virtual machine, containers share the same Linux kernel as their host system.
A Docker “container” is a form of encapsulation which seems to be superficially similar to a virtual machine. You can also use it to run graphical programs though! You can either use an existing X Server, where the host machine is already running a graphical environment, or you can run a VNC server within the container.įirst it’s important to understand what Docker actually does. Docker’s normally used to containerise background applications and CLI programs.