Related: Install X11 server for GUI programs in Windows Subsystem for Linux.
Some programs simply cannot run without an X11 graphics server available. In other cases, testing a program requires X11 to be available, even though the windows aren't visible. An example is creating Matplotlib figures in a continuous integration environment.
The X server virtual framebuffer (Xvfb) allows creating non-visible desktop windows without the computation burden of an full X11 graphics environment.
Xvfb is effective for most Linux systems without displays, particularly for headless or embedded systems including:
- Raspberry Pi
- Windows Subsystem for Linux
- continous integration servers
- virtual machines
apt install xvfb
Xvfb :99 & export DISPLAY=:99
Upon opening a new Terminal or SSH connection, the X11 virtual framebuffer is available.
Try running a graphics-only program, for example:
xmessage -center "Hello World"
If XVFB or X11 isn't working, the error message will be like
Error: Can't open display: :0.0