gnome-session
Start the GNOME desktop environment session
SYNOPSIS
gnome-session [OPTIONS]
PARAMETERS
--session=SESSION_NAME
Specifies which GNOME session to load. Session names correspond to .session files, e.g., gnome or gnome-classic.
--debug
Enables verbose debug output to assist with troubleshooting session startup issues.
--systemd-session
Instructs gnome-session to use systemd for managing the user session services, which is the default and recommended method in modern GNOME.
--disable-acceleration-check
Bypasses the check for 3D acceleration. Useful for testing or environments where acceleration is unavailable or problematic.
--version
Displays the version information of the gnome-session package and exits.
--help
Shows a brief help message with available command-line options and exits.
DESCRIPTION
The gnome-session command is the core session manager for the GNOME desktop environment. Its primary function is to launch and manage the essential components that constitute a GNOME user session, including the window manager (Mutter), the GNOME Shell, various background services, and autostart applications. It typically gets invoked automatically by a display manager like GDM upon successful user login.
gnome-session is responsible for reading session configuration from files such as those in /usr/share/gnome-session/sessions, /etc/xdg/autostart, and ~/.config/autostart, ensuring that the correct desktop experience is initialized. It also oversees the proper shutdown and logout sequence, attempting to gracefully terminate applications and services. In modern GNOME, it heavily leverages systemd for user session management and D-Bus for inter-process communication, making it a critical component for both X11 and Wayland-based GNOME sessions.
CAVEATS
gnome-session is primarily invoked by display managers like GDM and is not typically run manually by users. Direct invocation can lead to unexpected behavior if the environment is not properly set up. It relies heavily on systemd user units and D-Bus for its functionality, and issues with these underlying components can prevent a successful session startup. Custom .xsessionrc files or environment variables can also impact its behavior, sometimes unintentionally.
SESSION CONFIGURATION FILES
gnome-session determines which applications and services to start by reading configuration files from several locations. These include /usr/share/gnome-session/sessions/ (defining session types), /usr/share/xsessions/ (for X session definitions), and particularly /etc/xdg/autostart/ and ~/.config/autostart/, which contain .desktop files specifying applications to launch automatically at session startup. Administrators and users can customize their sessions by modifying or adding files in these directories.
ENVIRONMENT VARIABLES
The behavior of gnome-session and the applications it launches can be influenced by various environment variables. For instance, DISPLAY is crucial for X11 sessions, while variables like XDG_CURRENT_DESKTOP provide hints to applications about the current desktop environment. Users can set these variables in files like ~/.xsessionrc or through display manager configuration to affect the session's startup environment.
HISTORY
The gnome-session command has been a fundamental part of the GNOME project since its early days in the late 1990s, evolving from a simple X session manager into a sophisticated desktop session orchestrator. Its development has closely mirrored the progression of the GNOME desktop itself. Significant milestones include deeper integration with D-Bus for application communication, and more recently, a pivotal shift to using systemd for managing user session services. This latter change was crucial for streamlining startup, shutdown, and resource management, especially with the advent of Wayland as the default display protocol.
SEE ALSO
gdm(8), startx(1), systemd(1), dbus-daemon(1), gnome-shell(1)