IT lexicon › Infra & Ops › DISPLAY (X11)

DISPLAY (X11)

Infra & Ops På svenska → Updated: 2026-10-08

The environment variable that tells every X program which screen to draw on, in the form host:display.screen.

An X program knows nothing about monitors until it reads DISPLAY. The value :0 means the first X server on the local machine, reached through the Unix socket /tmp/.X11-unix/X0; host:0 means the same server over TCP, on port 6000 plus the display number. A trailing .1 selects a second screen on the same server, the classic separate-surfaces arrangement that Xinerama later merged. The variable is set by xinit or the login manager, and XOpenDisplay(NULL) reads it with no effort from the program.

All of the network transparency hangs on one text string: change DISPLAY and the program appears on another computer without knowing it. SSH exploits exactly that by setting localhost:10.0 and tunnelling the traffic. Two colons, as in host::0, once meant DECnet rather than TCP — a reminder of the world X came from. Wayland has a counterpart in WAYLAND_DISPLAY, but it only ever points at a local socket.

← Back to the lexicon