Installing and configuring a graphical display server
The graphical stack: what an X server actually does, how X and Wayland differ, and the parts of it a system administrator is expected to configure or debug.
Lesson 1 of 3 in objective 106. User interfaces and desktops, part of LPIC-1 Exam 102-500.
The client-server idea, which is the opposite way round from expectations
In X, the SERVER is the machine with the screen, keyboard and mouse, and the CLIENTS are the applications — even when they are on the same machine. That inversion is deliberate and it is what allows an application running on a remote host to draw on your local display: the DISPLAY variable names which server to draw on, spelled host:display.screen, and :0 means the first display on this machine.
X.Org is the implementation in use. Configuration is /etc/X11/xorg.conf if it exists, though modern systems autodetect nearly everything and use snippets in /etc/X11/xorg.conf.d/ for the few overrides needed. The log is /var/log/Xorg.0.log, and it is the right first place to look when the display does not come up.
Wayland is the replacement, and its structural difference is worth stating: it merges the display server and the window manager into one compositor, and there is no built-in network transparency, so a remote application does not simply set DISPLAY. On Wayland, X applications run through an X compatibility layer.
The pieces around it
A window manager draws the frames and decides where windows go; a desktop environment is a window manager plus a whole set of applications and settings. xhost and xauth control who may connect to a display — xhost by host, which is blunt, and xauth by a cookie file in ~/.Xauthority, which is what ssh -X uses when it forwards a display. xdpyinfo reports what the server is capable of.
The keyboard belongs to the server too, which is why changing its layout is not a shell setting. setxkbmap de talks to the XKB extension of the RUNNING server and switches the layout immediately — the first non-option argument is taken as the layout, so setxkbmap -layout de is the same instruction written out. Because it changes a running server, it lasts exactly as long as that server does. Making the layout survive a restart is a different file: an XkbLayout option in an InputClass section under /etc/X11/xorg.conf.d/, or localectl set-x11-keymap de on a systemd host, which writes that snippet for you. Keep localectl's two keymaps apart — the X11 one is this, and the console one is what loadkeys sets for a text terminal.
Pointing a client at a display
DISPLAY is an ordinary environment variable, so it is set the ordinary way and it has to be EXPORTED: export DISPLAY=:0 sets it for this shell and for everything the shell starts, which is the point, because the thing that needs to read it is the application you are about to launch. Setting it without export changes the shell and nothing it runs. Quoting makes no difference — export DISPLAY=":0" and export DISPLAY=:0 are the same — because there is nothing in the value for the shell to split on.
The value is host:display.screen, and the two shorter spellings mean the same thing on a single-screen machine: :0 is display 0 with the screen left implied, :0.0 says screen 0 explicitly. An empty host means this machine. So a cron job or a script run from a console that needs to put a window on the logged-in desktop sets DISPLAY first — and, because the server also checks the cookie, usually XAUTHORITY with it.
xtermxterm: Xt error: Can't open display: DISPLAY=:0xtermxterm: Xt error: Can't open display: set in the shell, never passed to the childexport DISPLAY=:0xterma window opens on the local display
Worth carrying in
- export DISPLAY=:0
- Which X server a client draws on.
host:display.screenis the full form; it must be exported to reach the application. - ~/.Xauthority
- The cookie file
xauthmanages and the server checks.XAUTHORITYnames a different one. - /etc/X11/xorg.conf
- X configuration, when present. Snippets go in
xorg.conf.d/. - /var/log/Xorg.0.log
- What the X server did and why it failed.
- xhost +host
- Host-based access control. Blunt, and best avoided.
- xauth
- Cookie-based access control; what
ssh-X forwarding uses. - setxkbmap de
- Keyboard layout of the RUNNING server; gone with it.
localectl set-x11-keymapis the persistent form. - Wayland
- Compositor replacing the X server; no network transparency of its own.
What the exam does with this
- The X server runs where the screen is. Questions phrase this backwards on purpose.
DISPLAY=:0is the local first display; a remote one is namedhost:0. It has to beexported — set without it, the application never sees it.- Wayland has no DISPLAY-style remote drawing — forwarding an application is not the same mechanism.
- Objective
- 106. User interfaces and desktops
- Share of the exam
- 6.67% (the whole objective)
- Questions in this lesson
- 10
- Signed for by a person
- 0
Partly checked. None of the 10 questions here has been read against the cited source by a person. 10 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.
Drill this lesson
A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.
Practise Installing and configuring a graphical display server
Questions in this lesson
- In the X Window System architecture, which statement correctly describes the roles of the X server and an X client? machine-checked
- From your desktop workstation you run `ssh -X admin@fileserver` and then start `xterm` in that session. The xterm window appears on your workstation's screen. Which machine is running the X server in this arrangement, and which is running the X client? machine-checked
- In a bash shell, type the complete command that sets and exports the environment variable X clients read to find their display, so that they connect to screen 0 of display 0 on the local machine. machine-checked
- Type the command, with no arguments and no options, that prints whether host-based access control is currently enabled on your X server together with the list of hosts and users allowed to connect. machine-checked
- An X11-forwarded ssh session authorises the remote client to talk to your local X server without you ever running an xhost command. Which mechanism provides that authorisation? machine-checked
- A workstation has been fitted with a new graphics card and you must pin the X server to a specific driver by hand in /etc/X11/xorg.conf. In which section of that file does the Driver line for the card belong? machine-checked
- A user's graphical session collapses back to the login screen a second after they authenticate. The X server itself started normally. Which file should you read first, because it collects the standard output and standard error of the programs that the user's session tried to run? machine-checked
- A colleague makes a stubborn remote display problem go away by running `xhost +` on their workstation, with nothing after the plus sign. Your security review flags it. What has that command actually done? machine-checked
- Your distribution has switched the default graphical session from Xorg to Wayland. Select the TWO statements that correctly describe Wayland and its relationship to X11. machine-checked
- A German keyboard has been plugged into a running X session that is currently using the US layout. Type the complete command, with its argument, that switches the keyboard layout of the running X session to the German layout for the rest of the session. machine-checked
Practise Installing and configuring a graphical display server
The rest of objective 106
- Installing and configuring a graphical display server — you are here
- Display managers and desktop sessions
- Display managers and accessibility settings