CHAPTER 7 — PRESENTATION

Display Managers

Understand GDM, LightDM, and SDDM — the gatekeepers between the Linux kernel and your graphical desktop session. Master user environment configuration and .Xsession customization.

Slide 1 — What Is a Display Manager?

The Login Gateway to Your Graphical Session

A Display Manager (DM) is the program that runs after the Linux kernel and systemd finish booting. It presents the graphical login screen, authenticates the user via PAM (Pluggable Authentication Modules), and then launches the chosen desktop environment or window manager session.

Without a display manager, you land in a text-mode console. The DM is what transforms that console into the polished GUI login screen you see on Ubuntu, Fedora, or KDE systems.

The DM is responsible for three distinct jobs: rendering the login UI, authenticating credentials, and handing control to the chosen graphical session.

Boot Flow: From Power-On to Desktop

HARDWARE
BIOS/UEFI
BOOTLOADER
GRUB2
INIT SYSTEM
systemd
DISPLAY MGR
GDM / LightDM / SDDM
SESSION
X11 or Wayland
DESKTOP ENV
GNOME / KDE / Xfce
KEY CONCEPT

systemd starts the display manager as a system service (e.g., gdm.service). The DM then owns the display hardware and launches the graphical environment. This is why restarting the display manager restarts only the GUI, not the entire OS.

Slide 2 — Common Linux Display Managers
🖥 GNOME

GDM — GNOME Display Manager

Default on GNOME-based distributions (Ubuntu, Fedora, RHEL). Deeply integrated with GNOME Shell and Wayland. Supports accessibility features and multi-seat configurations. Heavier resource footprint than alternatives.

LIGHTWEIGHT

LightDM — Light Display Manager

Designed to be lean and modular. Default on Xfce, MATE, and LXDE distributions (Ubuntu MATE, Linux Mint Xfce). Uses "greeters" (UI plugins) — the gtk-greeter and slick-greeter are popular choices. Highly configurable via /etc/lightdm/.

🌊 KDE PLASMA

SDDM — Simple Desktop Display Manager

Default for KDE Plasma. Written in QML/Qt, offering smooth animations and theme support. Works well with both X11 and Wayland. Modern replacement for the older KDM display manager.

💻 LEGACY / MINIMAL

XDM — X Display Manager

The original X11 display manager. Minimal and functional, no frills. Still used on extremely lightweight or embedded systems. LXDM (LXDE Display Manager) is a similar lightweight option used on low-resource machines.

Slide 3 — Managing Display Managers

systemctl — Starting, Stopping, Enabling Display Managers

Display managers are systemd services. All standard service management commands apply.

# Check which display manager is currently active systemctl status display-manager # Check the session type (X11 or Wayland) echo $XDG_SESSION_TYPE # Restart GDM (applies config changes without rebooting) sudo systemctl restart gdm # Restart LightDM sudo systemctl restart lightdm # Enable a display manager to start at boot sudo systemctl enable gdm sudo systemctl enable lightdm sudo systemctl enable sddm

Changing the Default Display Manager

On Debian/Ubuntu systems, the default-display-manager file and the dpkg-reconfigure command control which DM runs at boot.

# View the current default display manager cat /etc/X11/default-display-manager # Change default DM using dpkg (Debian/Ubuntu) sudo dpkg-reconfigure gdm3 sudo dpkg-reconfigure lightdm # On Red Hat / Fedora systems, use systemctl set-default sudo systemctl set-default graphical.target
Display ManagerDefault OnService NameConfig Dir
GDMUbuntu, Fedora, RHELgdm.service/etc/gdm3/
LightDMXfce, MATE, Mintlightdm.service/etc/lightdm/
SDDMKDE Plasmasddm.service/etc/sddm.conf.d/
XDMMinimal installsxdm.service/etc/X11/xdm/
Slide 4 — Graphical Sessions: X11 vs Wayland

X11 (X Window System)

  • Original Unix graphical display protocol (1984)
  • Client-server model: X Server manages hardware, X Clients are apps
  • Network-transparent — GUIs can run on remote machines
  • Session type: XDG_SESSION_TYPE=x11
  • Config file: /etc/X11/xorg.conf or /etc/X11/xorg.conf.d/
  • Decades of compatibility — nearly universal app support

Wayland

  • Modern replacement for X11 (first stable 2012)
  • Compositor is both display server and window manager
  • No X Server intermediary — apps communicate directly
  • Session type: XDG_SESSION_TYPE=wayland
  • Better security: apps cannot spy on other apps
  • Smoother rendering, better HiDPI and touchscreen support
PRACTICAL NOTE

Most modern Linux desktops default to Wayland where supported. If a graphical app behaves strangely, it may not yet have Wayland support. Set WAYLAND_DISPLAY="" or launch the session in X11 mode from the login screen gear icon to fall back to X11.

Slide 5 — User Environment & .Xsession

Session Startup Files

When a user logs in through a display manager, several scripts execute in sequence to configure the user environment, set PATH variables, load daemons, and initialize the window manager or desktop environment.

# System-wide X session initialization (runs first) /etc/X11/Xsession /etc/X11/Xsession.d/ # drop-in scripts, run in order # Per-user session customization file ~/.xsession # override desktop environment choice ~/.xinitrc # used by xinit/startx (non-DM sessions) # Environment variables loaded at login ~/.profile ~/.bash_profile ~/.pam_environment # PAM-based env vars (older systems) # Example ~/.xsession to start Openbox instead of default: exec openbox-session

Configuring the User Environment

Beyond session startup, the user environment is shaped by shell configuration and environment variables set at login time.

# Check current locale (language/formatting settings) locale locale -a # list all available locales # Set system-wide locale (requires root) sudo localectl set-locale LANG=en_US.UTF-8 # Set keyboard layout sudo localectl set-keymap us # Set timezone sudo timedatectl set-timezone America/New_York sudo timedatectl set-ntp true # sync with NTP # Verify display manager and session variables echo $DISPLAY # e.g. :0 for first X session echo $XDG_SESSION_TYPE # x11 or wayland echo $DESKTOP_SESSION # e.g. gnome, plasma, xfce
ADMIN TIP

The DISPLAY environment variable tells X clients which display server to connect to. The value :0 means the first local display. When running commands via SSH or cron that need to interact with a graphical session, you must export DISPLAY=:0 or the commands will fail with "cannot open display."

Slide 6 — Troubleshooting Display Managers

Common Display Manager Failures and Solutions

SymptomLikely CauseFix
Black screen after loginCorrupt ~/.xsession or wrong WMDelete ~/.xsession, restart DM
Login loop (returns to login screen)Bad .bashrc or disk full /homeCheck ~/.xsession-errors, df -h
DM not starting at bootService disabled or graphical.target not setsystemctl enable gdm; set-default graphical.target
Wayland app crashesApp not Wayland-compatibleForce X11 session from login screen
No graphical login after driver installGPU driver conflict with X serverBoot to runlevel 3, reconfigure driver
# Check error logs when display manager fails journalctl -u gdm --since today journalctl -u lightdm -n 50 # Check user session errors (most useful for login loops) cat ~/.xsession-errors # If GUI is broken, switch to a virtual console to troubleshoot # Press Ctrl+Alt+F2 to switch to tty2, Ctrl+Alt+F7 to return to GUI # Disable display manager temporarily (boot to text mode) sudo systemctl set-default multi-user.target sudo reboot # Re-enable graphical login: sudo systemctl set-default graphical.target

Chapter 7 Complete

Mark this presentation complete to record your progress and unlock the quiz.

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