CH06 — PRESENTATION

Initialization & X Windows

Trace the Linux boot process from BIOS to login screen: UEFI, GRUB bootloader, kernel initialization, systemd, runlevels and targets. Then explore the X Window System architecture, Wayland, display managers, and locale internationalization settings.

Slide 1 — The Linux Boot Process
1
BIOS / UEFI — Firmware Initialization
Power-on: firmware initializes hardware, runs POST (Power-On Self Test), detects CPU, RAM, storage devices. BIOS (legacy) uses MBR partitioning; UEFI (modern) supports GPT partitions and Secure Boot. Identifies the bootable device and hands control to the bootloader.
2
GRUB / Bootloader — Kernel Selection
GRUB2 (Grand Unified Bootloader) is the most common Linux bootloader. It displays a menu allowing kernel selection, loads the chosen kernel image and initial RAM disk (initrd/initramfs) into memory, and transfers control to the kernel. Config: /etc/default/grub, updated with update-grub.
3
Kernel Initialization
The kernel decompresses itself, initializes CPU and memory subsystems, detects and loads device drivers, mounts the initramfs (temporary root filesystem for early boot), then mounts the real root filesystem and switches to it. Kernel messages visible with dmesg.
4
systemd (PID 1) — Service Orchestration
The kernel executes /sbin/init (which is systemd on modern distros) as the first userspace process (PID 1). systemd reads its unit files, resolves dependencies, and starts all required services in parallel to reach the configured target (runlevel equivalent). Boot completes when the target is reached.
5
User Login — Console or Display Manager
If multi-user.target: a login prompt appears on the console (tty). If graphical.target: a Display Manager (GDM, LightDM, SDDM) presents a graphical login screen. After authentication, the user session starts — shell or desktop environment.
Slide 2 — Runlevels and systemd Targets
SysV Runlevelsystemd TargetStateDescription
0poweroff.targetHaltShutdown and power off the system
1rescue.targetSingle UserMinimal single-user mode for recovery. Root shell, no network.
2multi-user.targetMulti-UserMulti-user text mode, no NFS (Debian/Ubuntu)
3multi-user.targetMulti-User NetFull multi-user text mode with networking. Standard server target.
5graphical.targetGraphicalFull graphical desktop environment. Default on desktop systems.
6reboot.targetRebootShut down and restart the system
# Working with systemd targets $ systemctl get-default # Show current default target $ sudo systemctl set-default multi-user.target # Change default (server mode) $ sudo systemctl isolate rescue.target # Switch to rescue mode now $ systemctl list-units --type=target # List all active targets # Reboot and shutdown $ sudo systemctl reboot # Graceful reboot $ sudo systemctl poweroff # Graceful shutdown $ sudo shutdown -h +5 "Maintenance" # Shutdown in 5 minutes with message
Slide 3 — The X Window System (X11)

The Graphical Foundation of Linux Desktops

The X Window System (X11 or simply "X") provides the graphical infrastructure for Linux desktop environments. Developed at MIT in 1984, X11 uses a client-server architecture — the X Server manages display hardware (screen, keyboard, mouse), while X Clients are the GUI applications that talk to the server to draw their windows.

Crucially: X uses a network-transparent protocol. An X application running on a remote server can display its windows on your local screen — the foundation for remote desktop workflows in Linux environments.

X Server

Manages the physical display, keyboard, and mouse. Draws pixels on screen based on requests from X clients. Handles input events and routes them to the appropriate application window. Runs as a privileged process (usually as root or via xorg group).

X Clients

Any GUI application: Firefox, terminals, file managers. They request the X Server to display windows and receive input events. Clients communicate with the server via the X11 protocol over a socket (or network). Each client has no direct hardware access.

Window Manager

Controls window appearance, placement, and behavior. Draws title bars, handles minimize/maximize, manages focus. Examples: GNOME Shell, KDE Plasma, i3 (tiling), Openbox. Can be replaced independently — a core Linux flexibility.

Display Manager

Provides the graphical login screen. Authenticates users and launches their chosen desktop session. Sits before the desktop environment in the startup sequence. Examples: GDM, LightDM, SDDM, XDM.

Slide 4 — Wayland: The Modern Display Protocol

Replacing X11 After 40 Years

X11 was designed in 1984 for hardware and security models that no longer exist. Wayland is a modern display protocol designed from scratch to address X11's limitations: simpler architecture, better security (applications cannot spy on each other's windows), better performance, and native support for modern hardware acceleration.

Key difference: In Wayland, each application talks directly to the Wayland compositor (which replaces both the X Server and Window Manager). There is no network transparency by default — but XWayland provides backward compatibility for X11 applications.

Current state: GNOME defaults to Wayland since version 3.22. KDE Plasma 6 defaults to Wayland. Most major distros are transitioning. Some applications (especially older games, screen recorders, remote desktop) still require X11/XWayland.

# Check if running X11 or Wayland $ echo $XDG_SESSION_TYPE # "x11" or "wayland" $ loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type # X11 configuration $ ls /etc/X11/xorg.conf.d/ # Config drop-in directory $ sudo systemctl restart display-manager # Restart X/Wayland session $ cat /etc/X11/default-display-manager # Which DM is configured # Switch display manager (Debian/Ubuntu) $ sudo dpkg-reconfigure gdm3 # Interactive DM selector $ sudo systemctl enable lightdm --force # Switch to LightDM # X11 forwarding over SSH (run GUI remotely) $ ssh -X user@server xterm # Forward X11, open xterm $ ssh -Y user@server firefox # Trusted X11 forwarding
Slide 5 — Display Managers
GDM (GNOME Display Manager)
Default for GNOME desktop environments (Ubuntu, Fedora). Feature-rich, integrates with GNOME settings. Supports both X11 and Wayland sessions.
LightDM
Lightweight, fast, flexible. Default on Xubuntu, Lubuntu, Linux Mint Xfce. Supports multiple greeters (login screen themes). Well-suited for resource-constrained systems.
SDDM (Simple Desktop DM)
Default for KDE Plasma. QML-based theming engine. Supports both X11 and Wayland. Clean, modern login experience.
XDM (X Display Manager)
The original X11 display manager. Minimal and basic. Rarely used directly today but foundational to understanding how display management works.
Slide 6 — Localization and Internationalization

Adapting Linux to Language and Region

Internationalization (i18n) — designing software to support multiple languages and regions. The "18" is the count of letters between "i" and "n" in "internationalization".

Localization (l10n) — adapting software for a specific language and region. Translating text, formatting dates/times/currency/numbers according to local conventions.

Linux locale settings control: language for system messages, date/time format, numeric format (decimal separator), currency symbol, character encoding (UTF-8 is standard), and keyboard layout.

# Check locale settings $ locale # Show all locale variables $ locale -a # List all available locales $ localectl # Show system locale and keyboard # Set system locale $ sudo localectl set-locale LANG=en_US.UTF-8 $ sudo localectl set-locale LANG=fr_FR.UTF-8 # French $ sudo localectl set-locale LANG=ja_JP.UTF-8 # Japanese # Generate locales (Debian/Ubuntu) $ sudo locale-gen en_US.UTF-8 $ sudo update-locale LANG=en_US.UTF-8 # Keyboard layout $ sudo localectl set-keymap us # Set console keyboard layout $ sudo localectl set-x11-keymap us # Set X11 keyboard layout $ localectl list-keymaps # List available keymaps # Timezone configuration $ timedatectl # Show current time/timezone/NTP status $ timedatectl list-timezones # All available timezones $ sudo timedatectl set-timezone America/New_York $ sudo timedatectl set-timezone UTC # Servers usually use UTC $ sudo timedatectl set-ntp true # Enable NTP time sync
SERVER BEST PRACTICE: ALWAYS USE UTC

Production servers should always be configured to UTC timezone — never a local timezone. Reasons: log timestamps across servers in multiple timezones are directly comparable without conversion; daylight saving time transitions do not cause duplicate or skipped timestamps in logs; forensic analysis across global infrastructure is unambiguous. Set sudo timedatectl set-timezone UTC and enable NTP (sudo timedatectl set-ntp true) on every server you deploy. For display purposes, user interfaces can convert UTC to local time — the source of truth should always be UTC. This is not a preference — it is a sysadmin non-negotiable.

Presentation Complete

Mark complete to save your progress and unlock the Chapter 6 quiz.

Progress saved. Head to the quiz to test your knowledge.