4.1. Installing and Selecting a Desktop

Debian does not install "a desktop" as a single package. It groups the packages for each environment into a task, and tasksel installs or removes those tasks. A task is a metapackage such as task-xfce-desktop; the package manager still resolves the actual dependencies, display manager, session files, and helper services. The choice therefore affects more than the look of the panel. It determines which display manager is normally installed, whether a Wayland session is available, how many packages must be updated, and which settings tools and accessibility components are present.

4.1.1. Choosing GNOME, KDE Plasma, or a Lightweight Environment

The three largest desktop tasks make different trade-offs. GNOME provides a consistent, keyboard-oriented shell and a large set of integrated applications. KDE Plasma exposes many configuration options and uses Qt applications. Xfce keeps a traditional panel and application menu, starts fewer background services, and is a common choice for virtual machines, older hardware, and remote desktops. Debian also publishes LXQt, MATE, Cinnamon, GNOME Flashback, and LXDE tasks; the same selection method applies, but the package sets and session details differ.

tasksel form Description
tasksel --list-tasks List task names, install state, and short descriptions.
tasksel install TASK Install the named task and its dependencies.
tasksel remove TASK Remove the task's packages, subject to dependency resolution.
$ tasksel --list-tasks
i desktop   Debian desktop environment
u gnome-desktop GNOME
i xfce-desktop  Xfce
u gnome-flashback-desktop   GNOME Flashback
u kde-desktop   KDE Plasma
u cinnamon-desktop  Cinnamon
u mate-desktop  MATE
u lxde-desktop  LXDE
u lxqt-desktop  LXQt
u web-server    web server
u ssh-server    SSH server
u laptop    laptop
u blendsel  Choose a Debian Blend for installation

The leading i means installed and u means not installed. The desktop task pulls in packages common to graphical environments; the specific task supplies the environment itself. On this machine the Xfce task is installed and the others are not, which is the state the rest of the chapter assumes.

The main desktop choices differ in scale, session technology, and the amount of integration they provide:

Environment Debian task Session and display manager normally selected Character Useful when
GNOME task-gnome-desktop GNOME Shell; Wayland by default with an X11 fallback; gdm3 Largest integrated stack, GNOME applications, strong accessibility integration The machine is current, the user wants a consistent GNOME environment, and the package and memory cost are acceptable
KDE Plasma task-kde-desktop Plasma; Wayland and X11 sessions; sddm Large, highly configurable Qt desktop with many separate settings modules The user needs detailed control over appearance, input, and desktop services
Xfce task-xfce-desktop Xfce 4.20; X11 session plus a separate Wayland session file; lightdm Smaller traditional desktop with a panel, file manager, and session manager Resources are limited, the machine is virtual, or a familiar panel is preferred

The task names are facts about Debian's package selection. The display manager is pulled in by the task's dependencies rather than chosen by tasksel as a separate question, and an administrator can replace it later. In the Debian 13 archive the versions in these tasks are GNOME Shell 48.7, Plasma Desktop 6.3.6, and Xfce 4.20.2.

tasksel install xfce-desktop is the normal way to add the Xfce task to an installed system; it expects the task name without the task- prefix and runs the package manager in the foreground, showing the usual download and progress output and possibly asking configuration questions for individual packages. The example machine already had the Xfce task installed during setup, so this chapter verifies the result instead of reproducing the installation transcript. The same operation is available directly as sudo apt install task-xfce-desktop, because the task is an ordinary metapackage:

$ apt-cache policy task-xfce-desktop task-gnome-desktop task-kde-desktop
task-xfce-desktop:
  Installed: 3.81
  Candidate: 3.81
  Version table:
 *** 3.81 500
        500 https://deb.debian.org/debian trixie/main amd64 Packages
        100 /var/lib/dpkg/status
task-gnome-desktop:
  Installed: (none)
  Candidate: 3.81
  Version table:
     3.81 500
        500 https://deb.debian.org/debian trixie/main amd64 Packages
task-kde-desktop:
  Installed: (none)
  Candidate: 3.81
  Version table:
     3.81 500
        500 https://deb.debian.org/debian trixie/main amd64 Packages

Before committing to a large task, simulate it. apt-get -s resolves the transaction and prints it without downloading or changing anything; the summary line is worth reading before the real installation:

apt-get option Description
-s Simulate the operation and print the resolved transaction without changing the system.
update Refresh the package index from the configured repositories.
upgrade Install available upgrades without removing packages.
$ apt-get -s install task-gnome-desktop | grep -E "^[0-9]+ upgraded"
0 upgraded, 331 newly installed, 1 to remove and 0 not upgraded.

The pipeline has two stages: apt-get -s prints the whole simulated transaction, and grep selects the summary line. On this machine, adding GNOME to the existing installation would install 331 more packages and remove one as part of dependency resolution. KDE Plasma was larger:

$ apt-get -s install task-kde-desktop | grep -E "^[0-9]+ upgraded"
0 upgraded, 949 newly installed, 0 to remove and 0 not upgraded.

For comparison, simulating the already-installed Xfce task reports nothing to do:

$ apt-get -s install task-xfce-desktop | grep -E "^[0-9]+ upgraded"
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

These counts were taken with Xfce and the chapter's diagnostic tools already present, so they measure the incremental distance from this particular machine to each task, not the total size of a desktop on a bare system, and not download volumes or disk use. Run the simulation on the actual machine before choosing; the number it reports is the one that matters.

The lightweight choice is not automatically the right choice for every workload. Xfce still runs a compositor, a settings daemon, a file manager, and a session bus. A very small machine may benefit more from choosing fewer applications or disabling background indexing than from switching between two desktops with similar package sets. Conversely, GNOME's accessibility and input integration can be a better investment on a workstation that a person depends on every day. Compare the services a desktop starts, not only the installer's package count.

4.1.2. Desktop Tasks, Display Managers, and Login Sessions

A display manager is a system service that owns a seat and starts a greeter. When a user authenticates, it reads an X11 or Wayland session file and starts that session. The session manager then launches the panel, window manager, and desktop services. On Debian, session descriptions live in two directories:

$ ls -l /usr/share/xsessions /usr/share/wayland-sessions
/usr/share/wayland-sessions:
total 16
-rw-r--r-- 1 root root   94 Apr 25  2025 weston.desktop
-rw-r--r-- 1 root root 9175 Mar 29  2025 xfce-wayland.desktop

/usr/share/xsessions:
total 16
-rw-r--r-- 1 root root   86 Nov 15 11:25 lightdm-xsession.desktop
-rw-r--r-- 1 root root 10257 Mar 29  2025 xfce.desktop

Each .desktop file is a desktop entry with a Name, an Exec command, and usually an icon and translations. The two Xfce entries show the difference between the X11 and Wayland paths:

$ grep -H '^Exec=' /usr/share/xsessions/xfce.desktop /usr/share/wayland-sessions/xfce-wayland.desktop
/usr/share/xsessions/xfce.desktop:Exec=startxfce4
/usr/share/wayland-sessions/xfce-wayland.desktop:Exec=startxfce4 --wayland

startxfce4 is a session launcher, not the display server itself. In the X11 entry it starts the Xfce session on the display provided by the display manager; the Wayland entry passes --wayland, which starts Xfce's Wayland session and compositor when the required components are installed. The weston.desktop entry belongs to the Weston package used for the headless compositor exercise in Section 4.1.3; it is not part of the Xfce task.

The display manager is enabled independently of the task's package set. graphical.target is the systemd target that starts a display manager at boot; multi-user.target is the normal text-login target. Switching between them with systemctl set-default is a persistent change, useful on a server or while diagnosing a display manager, but it does not stop a running graphical session. On a machine administered only over SSH, check that a console getty or serial getty remains enabled before changing the target. The example machine boots to graphical.target, which the baseline snapshot in Section 4.6 records.

LightDM was installed by the Xfce task and enabled at boot. Starting it produces no terminal output, and the service reports itself active:

$ sudo systemctl start lightdm
$ systemctl is-active lightdm
active

The enablement state and the running state answer different questions:

$ systemctl is-enabled lightdm
enabled

enabled means the unit has a boot-time dependency in graphical.target; it does not show that the greeter is currently running. The unit status shows the running process and the Xorg server it started:

$ systemctl status lightdm --no-pager -l | head -12
● lightdm.service - Light Display Manager
     Loaded: loaded (/lib/systemd/system/lightdm.service; enabled; preset: enabled)
     Active: active (running) since Wed 2026-11-18 11:49:22 UTC; 47s ago
 Invocation: 9f3c774f518a4a5b89b2f082f9595980
       Docs: man:lightdm(1)
   Main PID: 425794 (lightdm)
      Tasks: 7 (limit: 1108)
      Memory: 28.2M (peak: 28.5M)
        CPU: 265ms
      CGroup: /system.slice/lightdm.service
             ├─425794 /usr/sbin/lightdm
             ├─425801 /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

The display-manager.service name is an alias that resolves to the installed display manager's unit, so either name works for status and restart operations. Debian ships several display managers; installing more than one is possible, but only one can own the alias at a time. The package configuration asks which one should be used, dpkg-reconfigure changes the selection later, and replacing a display manager does not remove the session files in /usr/share/xsessions and /usr/share/wayland-sessions:

Display manager Debian package Commonly associated with Notes
lightdm lightdm 1.32.0-6+deb13u1 Xfce and lightweight tasks Small greeter; the X11 greeter shown above; supports several greeter themes
gdm3 gdm3 GNOME Starts GNOME's Wayland and X11 sessions; larger dependency set
sddm sddm KDE Plasma Qt greeter; supports Wayland and X11 sessions

logind tracks the greeter as a session with its own class and seat. On the example machine the listing also shows sessions of the separate management account used to reach this guest, plus john's own shell sessions; the row that matters for the display is the lightdm greeter on seat0:

$ loginctl list-sessions
SESSION  UID USER    SEAT  LEADER CLASS         TTY IDLE SINCE
  15764 1000 vagrant -     397582 manager       -   no   -
  15786 1000 vagrant -     398389 user          -   no   -
  17172 1001 john    -     425603 manager       -   no   -
  17181  110 lightdm -     425816 manager-early -   no   -
  17204 1000 vagrant -     426370 user          -   no   -
  17205 1001 john    -     426388 user          -   no   -
    c27  110 lightdm seat0 425810 greeter       -   no   -

7 sessions listed.

The greeter is not a logged-in desktop user; Class=greeter records that LightDM owns the session until someone authenticates. Asking for the greeter's type, display, and service shows the X11 path. The session identifier c27 is assigned by logind and differs elsewhere:

$ loginctl show-session c27 -p Type -p Display -p Active -p Service -p Class
Display=:0
Service=lightdm-greeter
Type=x11
Class=greeter
Active=yes
loginctl form Description
list-sessions List current sessions, classes, seats, and leaders.
show-session ID Show properties for one session.
-p PROPERTY Restrict show-session output to the named property.
--no-legend Suppress column headings, useful in scripts.
lock-session [ID] Ask the session's locker to lock the session.
terminate-session ID End all processes in a session.

A user session begins after authentication, when the display manager starts the session program from the chosen .desktop file. The session has its own environment, D-Bus session bus, and user service manager. loginctl is the system-wide view; systemctl --user is the view inside one user's session. A graphical application launched from an SSH shell does not automatically join the desktop session's bus or get access to the seat, which is why display and authentication errors appear even when the same user is logged in graphically.

4.1.3. Wayland and X11 Application Compatibility

X11 is a network display protocol with a long-lived server, a shared coordinate space, and global input and window management. A client connects to an X server through DISPLAY=:0, authenticates with an X authority cookie, and asks the server to create windows. Any client that can connect can usually see the global window tree and receive global input events, subject to access control. Wayland replaces that model with a compositor and per-client surfaces: the compositor owns input, output, and presentation, and clients receive only the events and buffers the compositor chooses to give them.

Debian's desktop tasks increasingly default to Wayland, but both session types can be installed at once; the two Xfce session files shown above are one example. At the login screen, the session menu chooses between them, and the display manager starts the corresponding Exec command. For a user session, loginctl show-session reports Type=x11 or Type=wayland, while the greeter's type describes the greeter itself. No user graphical login was performed on the example machine, so the session-type switch at the greeter and XWayland application behavior are described from the session files rather than from a captured login.

A Wayland compositor can run X11 applications through XWayland, an X server that presents X11 client windows as Wayland surfaces to the compositor. The application still believes it is talking to X11, but it does not control the whole display, and it may not be able to capture the screen, read global hotkeys, or position windows outside the compositor's policy. Native Wayland applications use the compositor's protocols and portals for those operations. The compatibility package is small and installed with the desktop tasks:

$ dpkg-query -W xwayland
xwayland    2:24.1.6-1

dpkg-query -W prints the installed version of each named package, which is the quickest way to check which display stack a machine actually has.

Session path Input and windows Screen capture and global hotkeys Application compatibility When to choose
Native Wayland Compositor controls input and per-client surfaces Through compositor protocols and portals; policy varies by desktop Applications must support Wayland or use XWayland Default on current GNOME and Plasma; best isolation and per-output scaling
XWayland inside Wayland The X11 application sees an X server; the compositor still owns the seat Global X11 capture and hotkeys are limited or redirected Good for most legacy X11 applications, not identical to X11 A Wayland session is required but one application is X11-only
X11 session Xorg owns the screen; clients share a global window tree X11 tools can capture and inject events, subject to access control Broadest compatibility with older applications Legacy applications, remote X11, or a desktop whose Wayland session is not ready

The table describes mechanisms, not a guarantee about a particular application: a browser may run natively on Wayland while a screen-sharing plugin still needs a portal, and an X11 application under XWayland may work but ignore the compositor's scaling. Test the specific application in the session that will be used, and keep an X11 session available during a transition.

X11 access control is separate from Wayland's per-client model. On the example machine the greeter owns display :0, and its X authority file lives under /var/run/lightdm/root/. To let a shell outside the session reach that display, the administrator grants temporary local access; the elevated invocation sets the display and authority variables for xhost, which only an authorized client may run:

$ sudo DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 xhost +SI:localuser:john
localuser:john being added to access control list

The +SI:localuser: selector grants the named local user access to this X server for as long as the server runs; it is a temporary grant, not a persistent desktop policy, and a shell inside the user's own session never needs it because the session exports DISPLAY and the authority cookie itself. The graphics captures in Section 4.2 were taken through exactly this grant against the greeter's display, which is why those commands carry an explicit DISPLAY=:0. xhost + with no selector disables access control for every client that can reach the server and should not be used as a convenience fix; revoke a temporary grant with the matching xhost -SI:localuser:john form.

The Wayland stack can be exercised without a monitor by running Weston, the reference compositor, with its headless backend. The exercise is optional: it verifies that a Wayland compositor loads its backend, creates an output, and starts its shell; it is not a user desktop session and does not test XWayland clients, portals, or session integration. Wayland requires a per-user runtime directory with restrictive permissions, so create one in the workspace. Both commands are silent:

$ mkdir -p /home/john/debian-handbook/desktop-baseline/weston-run
$ chmod 700 /home/john/debian-handbook/desktop-baseline/weston-run

Start the compositor with that directory as XDG_RUNTIME_DIR, bounded by timeout 5 so it stops after five seconds instead of running until killed. --socket names the Wayland socket, --idle-time=0 disables idle blanking, and --log writes the compositor's log to the workspace:

$ XDG_RUNTIME_DIR=/home/john/debian-handbook/desktop-baseline/weston-run timeout 5 weston --backend=headless-backend.so --socket=ch04-wayland --idle-time=0 --log=/home/john/debian-handbook/desktop-baseline/weston.log
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'

The command returned exit status 124, which is timeout reporting that it stopped the compositor after the requested interval - the expected result for a compositor that was meant to run until terminated. The cursor warnings are cosmetic in a headless run. The log records what the compositor actually did:

$ head -20 /home/john/debian-handbook/desktop-baseline/weston.log
Date: 2026-11-18 UTC
[11:50:18.724] weston 14.0.2
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 14.0.2
[11:50:18.724] Command line: weston --backend=headless-backend.so --socket=ch04-wayland --idle-time=0 --log=/home/john/debian-handbook/desktop-baseline/weston.log
[11:50:18.724] OS: Linux, 6.12.86+deb13-amd64, #1 SMP PREEMPT_DYNAMIC Debian 6.12.86-1 (2026-05-08), x86_64
[11:50:18.724] Flight recorder: enabled
[11:50:18.724] Starting with no config file.
[11:50:18.724] Output repaint window is 7 ms maximum.
[11:50:18.725] Loading module '/usr/lib/x86_64-linux-gnu/libweston-14/headless-backend.so'
[11:50:18.729] Registered plugin API 'weston_windowed_output_api_headless_v2' of size 16
[11:50:18.729] Color manager: no-op
                 protocol support: no
[11:50:18.729] Output 'headless' attempts EOTF mode SDR and colorimetry mode default.
[11:50:18.729] Output 'headless' using color profile: stock sRGB color profile
[11:50:18.729] Output 'headless' enabled with head(s) headless
[11:50:18.729] Compositor capabilities:
               arbitrary surface rotation: no
               screen capture uses y-flip: no

The log establishes that a Wayland compositor loaded its backend, created an output, and began publishing capabilities. It does not establish that a physical monitor, input device, or XWayland application worked. When a real session fails, read its log the same way: the first failing module, backend, or protocol is more informative than the final "compositor started" line. The weston-run directory and weston.log are disposable; remove them with rm -rf under the workspace when the exercise is finished.