Xorg Display Server

Last update: 2023-09-10 04:30:01 +0800 +0800
Available translations: 日本語 / 中文(简体) / 中文(繁體)

Xorg is an X11 display server. GUI programs use toolkits such as GTK or Qt and client libraries such as libX11 or libxcb to send X11 requests to it. The server manages input, outputs, and rendering; extensions such as GLX and XRender support accelerated rendering.

Connecting to a Display #

DISPLAY has the form [protocol/]host:display[.screen]. For the usual local display, :0 selects /tmp/.X11-unix/X0. TCP displays use port 6000 + display, though modern Xorg usually disables TCP listening. Once connected, the client and server exchange setup data, requests and replies, and asynchronous events such as key presses and expose notifications. SSH X11 forwarding creates a protected transport while retaining the protocol.

Authentication #

Opening the Unix socket is not authorization. The common MIT-MAGIC-COOKIE-1 mechanism stores a random per-display token in an Xauthority file, commonly ~/.Xauthority or the file named by XAUTHORITY. The client selects the entry matching DISPLAY and sends the cookie in the setup handshake; the server rejects a mismatched token. DISPLAY says where to connect, while XAUTHORITY says which credential to present. xhost can alter server-side access control, but broad rules are less safe than sharing a specific cookie.

Components #

The X.Org source projects include xorg/xserver, which builds the X and Xorg server executables, and xorg/app/xinit, which builds xinit and startx. A display manager normally starts the server and session. startx is a convenient user-facing wrapper around xinit; the exact privilege and device-access arrangement depends on the distribution and its logind or seat-management integration.

Comments

Read or comment on GitHub (sign-in required to comment)