IT lexicon › Infra & Ops › xinit and startx

xinit and startx

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

The bare-bones way to start X from a text console: one server, one script, and a session that lives exactly as long as the script does.

xinit launches an X server and then runs ~/.xinitrc as its client. The script starts whatever you want — a few xterms, a clock — and finishes with a window manager, ideally via exec. When the script ends, xinit shuts the server down. That is why the last line matters: quitting the window manager logs you out, and forgetting to run it in the foreground makes the whole desktop vanish half a second after it appears.

startx is a shell wrapper around xinit that finds the right files and sets up authorisation. It was the standard way into X on Linux in the 1990s, before graphical logins were a given, and survives among people who like to know exactly what is being started.

← Back to the lexicon