Show Table of Contents
C.5. Runlevels and X
In most cases, the Red Hat Enterprise Linux installer configures a machine to boot into a graphical login environment, known as runlevel 5. It is possible, however, to boot into a text-only multi-user mode called runlevel 3 and begin an X session from there.
The following subsections review how X starts up in both runlevel 3 and runlevel 5. For more information about runlevels, see Section 12.1, “Configuring the Default Runlevel”.
C.5.1. Runlevel 3
When in runlevel 3, the best way to start an X session is to log in and type
startx. The startx command is a front-end to the xinit command, which launches the X server (Xorg) and connects X client applications to it. Because the user is already logged into the system at runlevel 3, startx does not launch a display manager or authenticate users. See Section C.5.2, “Runlevel 5” for more information about display managers.
- When the
startxcommand is executed, it searches for the.xinitrcfile in the user's home directory to define the desktop environment and possibly other X client applications to run. If no.xinitrcfile is present, it uses the system default/etc/X11/xinit/xinitrcfile instead. - The default
xinitrcscript then searches for user-defined files and default system files, including.Xresources,.Xmodmap, and.Xkbmapin the user's home directory, andXresources,Xmodmap, andXkbmapin the/etc/X11/directory. TheXmodmapandXkbmapfiles, if they exist, are used by thexmodmaputility to configure the keyboard. TheXresourcesfile is read to assign specific preference values to applications. - After setting the above options, the
xinitrcscript executes all scripts located in the/etc/X11/xinit/xinitrc.d/directory. One important script in this directory isxinput.sh, which configures settings such as the default language. - The
xinitrcscript attempts to execute.Xclientsin the user's home directory and turns to/etc/X11/xinit/Xclientsif it cannot be found. The purpose of theXclientsfile is to start the desktop environment or, possibly, just a basic window manager. The.Xclientsscript in the user's home directory starts the user-specified desktop environment in the.Xclients-defaultfile. If.Xclientsdoes not exist in the user's home directory, the standard/etc/X11/xinit/Xclientsscript attempts to start another desktop environment, trying GNOME first, then KDE, followed bytwm.
When in runlevel 3, the user is returned to a text mode user session after ending an X session.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.