Starting X
Summary:- General Settings
- Configuration Files
- Starting From Console
- Starting Graphically
Starting X - General
There are basically to ways to start X: from the console or via a graphical login manager. It depends upon the default runlevel set in '/etc/inittab' which method is used. The lineid:3:initdefault:
id:5:initdefault:
Configuration Files
The X Window System consists of two components: a client and a server. Because of this architecture, there are two sets of configuration files, one set for the client side and one set for the server side. Client side configuration can be overruled by special files in a user's home directory. Client side configuration:- '/etc/X11/Xsession': This script determines which window manager or desktop environment is run on X. Settings can be overruled by '.xinitrc' or '.xsession' (although the later is rarely used these days) or by options to the 'startx' command (see below).
- '/etc/X11/wmsession.d/': This directory contains the start scripts for the window managers and desktop environments installed on this system. Sessions can be checked, added and deleted via the 'chksession' command. See man chksession.
- '/etc/X11/XF86Config-4': This file contains the hardware configuration and settings like default screen resolution or color depth. Usually you do not edit it by hand but with tools like 'XFdrake'. See man XF86Config.
- '/etc/X11/xdm/Xservers': This file contains the command line to start up the X server(s). Might be interesting when you want to start more than one server or turn off X' network capatibilities for security reasons ('-nolisten' option). A list of options and syntax is available in man Xserver.
- '/etc/X11/fs/config': The configuration file for the 'xfs' font server. See man xfs.
- '/etc/X11/Xressources' and files in '/etc/X11/app-defaults': These files determine the appearance of some of programs which are part of the XFree86 suite (like 'xterm'). Settings can be overruled by '~/.Xdefaults'. Since almost everybody uses GTK+ or Qt substitutes these days, these are of a rather marginal interest. See man xrdb.
- '/etc/X11/Xmodmap' contains some default key mappings for the 'Backspace' and the 'Windows' keys. See the article on Keyboard on X.
- '/etc/X11/~XftConfig' contains the configuration for anti-aliasing text via the RENDER extension. See the article on X Fonts.
Starting From Console
After logging in, you are in your home directory. In order to start X, enter startxStartup in detail
'startx' is but a starter script for 'xinit', the X initializing program.After initializing the server with the options listed in '/etc/X11/xdm/Xservers', 'xinit' looks for a file '.xinitrc' in your home directory. If there isn't such a file, it looks up its own configuration file '/etc/X11/xinit/xinitrc'. This file in turn points 'xinit' to '/etc/X11/Xsession', the central startup configuration script.
- '/etc/X11/Xsession' sets a default background color, starts the SSH agent if available, processes user preference files like '.Xresources' and '.Xdefaults' and sets the $BROWSER variable.
- It then executes to see which window managers and desktop environments are available on the system. 'chksession' gets this list from the scripts in '/etc/X11/wmsession.d', the order is determined by the two digits in front of each file name.
/usr/sbin/chksession -l
- Next the scripts in '/etc/X11/xinit.d' are processed (usually the menu update and some minor keyboard stuff).
- The next bit checks if you have specified any window manager or desktop environment on the command line. If not, it checks if you've done so in a ~/.desktop file. If not, '/etc/sysconfig/desktop' is checked for a setting. If one of these steps is successful, the variable $DESKTOP is set.
- The script the goes on to check if a XIM input server is needed (mainly for Asiatic languages) and if the 'first time wizard' should be launched.
- The window manager or desktop environment specified in the $DESKTOP variable set above. The appropriate startup script in /etc/X11/wmsession.d is executed.
- If the script failed to set the $DESKTOP variable, ' is executed. This prints the first available session entry which is then started.
'/usr/sbin/chksession -F
- If that fails, too, the script checks for the 'icewm' window manager and starts that window manager.
- If 'icewm' shouldn't be installed either, it checks for 'icewm-light', then for 'twm' (XFree's own very basic window manager).
Options
As you can see, you can influence the startup process in several ways:- By supplying options to the 'startx' command. There are two sets of options which can be passed via 'startx', options to the client and options to the server. Options to the client usually state the session name of window manager to use:
Options provided with 'startx' overrule all options specified elsewhere.
- By writing an '.xinitrc' file. An .xinitrc file tells X which scripts or programs to execute and which window manager to start. Here's an example:
xmodmap ~/.Xmodmap<br> xterm &<br> exec wmaker
The second starts an instance of the xterm terminal emulator. Notice the '&' at the end of the line, it is needed if you start graphical programs via '.xinitrc' to send those programs 'in the background'. Otherwise the startup process would simply hang as long until the program is terminated.
The last line uses the shell's 'exec' command, which replaces the current shell with the command which follows. This command is the executable name of the window manager (here Window Maker).
- Via a '~/.desktop' file. Create a file with the name '.desktop' in your home directory with this line in it:
DESKTOP=session_name
Starting Graphically
Graphical logins are handled by so-called display managers. Mandrake Linux comes with three display managers: KDM (KDE Display Manager), GDM (GNOME Display Manager) and XDM (guess … ;-)), KDM being the default. Display managers offer greater convenience when it comes to starting and leaving X sessions. They also allow remote session logins. Especially GDM offers a wealth of options. On the other hand they are consuming system resources during the whole X session and might pose a security risk when configured wrongly. KDM is part of the 'kdebase' RPM, GDM comes in its own 'gdm' RPM and XDM is part of the XFree86 package. GDM does not require GNOME to be installed.Startup in detail
If runlevel 5 is set as the default runlevel in '/etc/inittab', a special command for that runlevel is executed:x:5:respawn:/etc/X11/prefdm -nodaemon
Configuration
Both GDM and KDM can be configured via their configuration modules in the respective desktop command centers. Check their online help systems. The central configuration file for GDM is '/etc/X11/gdm/gdm.conf', KDM uses '/usr/share/config/kdm/kdmrc'.GDM can also be configured as 'root' via the gdmconfig command or via the menu ('Configuration' - 'Boot and Init'). It offers much more configuration options than KDM, especially in regard to remote login options.
However, you should be very careful and considerate in regard to those options since a wrong configuration can make it very easy for intruders to take control of your system. If you install GDM and are using KDE, remember to set
DISPLAYMANAGER=GDM
Related Resources:
Startx Marks The Spotman inittab
man startx
man XF86Config
man xinit
The kdm Handbook
GDM Reference Manual in /usr/share/help/gnome Revision / Modified: June 17, 2002
Author: Tom Berger Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Starting X
Version 1.6 last modified by Flink on 21/01/2005 at 19:41
Version 1.6 last modified by Flink on 21/01/2005 at 19:41
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!



