You are on page 1of 6

Article: Setting up the X Window System in Linux

Page 1 of 6

Setting up the X Window System in Linux


Abstract

This article discusses the installation and configuration of the X Window System. It includes an
explanation of the settings you need to configure, and identifies specific documentation that can assist
you in this process. It also provides installation tips, and explains how to start an X Window System
session, end applications that fail to close normally, and export the display of an application to a remote
terminal.

X Window System
The X Window System is the framework on which a graphical user interface (GUI) system
for UNIX and Linux runs.
X11 was the original X Window System. It's still used today, mostly on UNIX systems because it's
optimized for the hardware that UNIX typically runs on, such as Sun stations.
XFree86 is the open-source version of the X Window System and is optimized for the PC platform. It is
used largely on Linux systems, although developers have made inroads towards its use with other
platforms. The 2004 licensing agreement associated with the XFree86 release has had a negative impact
on the use of the XFree86 4.4 version, and alternatives are now increasing in popularity. Most
distributions have turned to X.Org and other sources for alternatives except for few distributions that are
still relying on old versions of XFree86 or on alternatives other than X.Org.
The latest X Window System release is X11R6.7. The www.x.org web site provides information about
new features, as well as bug fixes, for any new releases involving the X86 computer architecture. The site
also provides some code released by Compaq and Sun, which is now included in the main X Window
System package.

Installing XFree86 or X.Org


To install X, you first need to check the hardware lists and Linux documentation to make sure that the X
Window System supports your graphics card and monitor. This information can help you avoid any
problems.
You can download the latest version of XFree86 from the main XFree86 site, www.xfree86.org.
Generally, if you are using a distribution with any kind of package management system, you should get it
through the distributor of your Linux system. You can download the latest release of X.Org from
http://www.x.org.
This is better in the long term because it ensures that problems won't occur because of dependency
issues.

The X configuration file


The X configuration file contains all X Window System configuration information. When using XFree86,
the file is named /etc/X11/XF86Config, and in X.Org it is /etc/X11/xorg.conf. It includes 12 sections that

http://library.skillport.com/courseware/cbtlib/259938/260044/eng/article/lp1/pages/nito.html? 9/9/2013

Article: Setting up the X Window System in Linux

Page 2 of 6

define the type, configuration and arrangement of your video hardware, your mouse, your keyboard and
any other hardware used by a GUI.
The video adapter section defines the name, make, and model of your video card, as well as its
capabilities. The monitor section defines what your monitor is capable of displaying. The modes section
contains settings such as color depth, the number of bits of color, pixels, and resolution. The screen
section includes settings for the monitor and the video adapter.

Configuration tools
The main configuration tools for XFree86 are xf86config and xf86setup. The xf86config tool is a step-bystep, command-based tool, whereas xf86setup is menu-based. You can use these tools across most
distributions. Other tools include, for example, xset, xvidtune, Xconfigurator, XFdrake, SaX, and SaX2, as
well as tools packaged with specific distributions. Red Hat recently replaced the Xconfigurator tool with a
new Display Settings window, which you launch using the command redhat-config-xfree86.
If you need to alter existing configuration settings, it's generally best to use a configuration tool designed
for your distribution. Red Hat comes with XFree86, the Cisco distribution includes SaX2, and Mandrake
comes with DrakX, for example. You can find out about each tool in the relevant documentation. If a tool
does not work properly for your particular setup, you should then try using the xf86setup tool. If for some
reason that also doesn't work, you may have to use xf86config.
If you use the xf86config tool, you need to set up your GUI very carefully. To change a setting you have
already configured, you have to start the configuration again. This can be time-consuming if you're trying
to configure a complicated setting. The graphical xf86setup tool makes configuration much easier. In
addition to providing menus that enable you to alter settings, it automatically runs basic graphical settings
that almost any machine can handle.

Installation tips
You may encounter problems when installing the X Window System because of the need to support
different combinations of hardware. It can also be difficult to configure the X Window System to support
specific types of hardware that it isn't configured to recognize, such as a three-button serial mouse.
If errors occur during an initial installation of Linux, you can choose to skip the installation of the X
Window System and then install it only once the Linux system is operational. If serious problems occur,
you should try pressing Reset and starting the installation again.

Installing a joystick and a touch screen


If you have a serial touch screen, you should read the "X touch screen HOWTO" advice.
To install other devices, you add entries to the X configuration file, and then load the appropriate drivers.
If there is a joystick driver installed on your machine, you need to load it into the kernel and use the
commands lsmod and insmod for information.

http://library.skillport.com/courseware/cbtlib/259938/260044/eng/article/lp1/pages/nito.html? 9/9/2013

Article: Setting up the X Window System in Linux

Page 3 of 6

Installation dangers
If you fail to configure the GUI correctly, you may damage hardware. The damage may occur over time
without your being aware of it, if for instance you accidentally configured the incorrect chipset. So it's
important to configure the correct settings for your video card and monitor.
Fortunately, most current hardware supports several monitor settings and video cards. However it's still
possible to buy hardware that doesn't. If you're attempting to install unknown video hardware, it's safest to
use the Super Video Graphics Array (SVGA) X server, because most modern video hardware supports
SVGA. By default, the installer chooses the most basic GUI usually the SVGA server.
Recent versions of X.Org now have the ability to automatically detect your hardware at run-time and use
safe settings without user interaction. While it is still possible to manually specify settings that could
potentially damage your hardware, most modern hardware is far less susceptible to damage from this
type of error than it was in the past.

X Font Server
If a number of people using one machine or multiple machines served by the same machine need to
access different fonts, an X Font Server is a good choice.
You need to install the X Font Server itself if it hasn't already been installed by default. You also need to
install and activate a display manager, and to ensure that settings in the configuration file point to the
server and to the X configuration file.
There are several fonts available under the X Window System, including PostScript fonts and TrueType
fonts. You can download a lot of these fonts from the Internet. Only the administrator can make fonts
available to everyone, but any user can download and add new fonts for their own use. The "X Window
System user HOWTO" describes where to go for various types of fonts and gives details of what's
needed to add fonts to various files.
You may encounter compatibility issues when adding fonts. For example, if you are using PostScript fonts
for printing, you need to have a PostScript printer.

Configuring XDM
The X Display Manager (XDM) is the default display manager for the X Window System. In addition to
managing the GUI display, it displays a graphical dialog box that lets users log in to their accounts.
The XDM has four configuration files xdm-config, Xresources, Xaccess, and Xservers. The xdm-config
file enables you to turn XDM on or off. Xresources enables you to modify settings such as the welcome
message that XDM displays. To set up XDM for X Window System stations, you need to edit both the
Xaccess and Xservers files. This is because the stations need permission to access the server, and the
server needs permission to access the stations.
The XDM is only one part of the X Window System. To install the full system, you also need other
components, such as a window manager.

http://library.skillport.com/courseware/cbtlib/259938/260044/eng/article/lp1/pages/nito.html? 9/9/2013

Article: Setting up the X Window System in Linux

Page 4 of 6

Window managers
In many ways, a window manager is a personal choice. You may choose a particular window manager
because of its particular method of handling windows, for example.
However, suppose that your machine doesn't have a lot of RAM or you don't want your GUI to consume a
lot of resources because, for example, you're running it on a mail server. In this situation, you need to
choose a window manager that doesn't use a lot of memory, such as Blackbox.
You can also choose to use the default window managers packaged with the GNU Object Modeling
Environment (GNOME) or the K Desktop Environment (KDE). KDE works best with its own window
manager. GNOME makes use of the Metacity window manager, and is packaged with it by default.
The www.themes.org web site is dedicated to providing various customized graphics, but also provides
setups for all the various window managers.

Customizing menus
Each window manager enables you to customize window management menus differently. In general,
though, you need to find the file windowmanagername_ rc, for example blackbox_rc. Within that file, you
can either build the menus or call another file that contains the menu items.

X terminals
You can select and configure X terminals, such as Xterm RXVT or ATERM, using the XDMConfig file.
This file enables you to select which terminal program you want to use whenever you run a console
window in the X Window System.

Library dependencies
You can check for and resolve library dependencies for X Window System applications manually, or using
an autoconfiguration script that comes with the application.
To check library dependencies manually, you need to read all relevant documentation, for example the
readme file, and follow the steps it describes.
The autoconfiguration script is usually named configure. You can run it from within the source code by
entering the ./configure command to check that you have the correct components. It will inform you if
you are missing some components. If you are installing it from a Debian or RPM file, Debian or RPM
themselves will inform you if you don't have everything you need.

Starting an X Window System session


Your machine can boot into two different modes from the command line or the GUI. It's recommended
that you boot from the command line before testing a GUI.
To start an X Window System session and launch the GUI from the command line, you enter the
command startx.

http://library.skillport.com/courseware/cbtlib/259938/260044/eng/article/lp1/pages/nito.html? 9/9/2013

Article: Setting up the X Window System in Linux

Page 5 of 6

Exporting a display
Let's say that you want to export application output from the host machine, called mike.example.com, to a
machine called jane.example.com.
On the host machine, you type
export DISPLAY=jane:0.0
On Jane's machine, you type
xhost +mike.example.com
When you start an application, for example xeyes, on the host machine, the display on the host machine
appears on the GUI of Jane's machine.
You can also export an X Window System session between Linux and UNIX. To export an X Window
System session to Windows, you need special tools, which are available on the Web.

Ending applications
If an X Window System application won't shut down in the normal way, you can try to terminate the
application by
right-clicking the taskbar of the application
right-clicking, left-clicking, or middle-clicking the application itself
pressing Ctrl+Alt and a function key to go to a Linux console and terminating the program from
there
pressing Ctrl+Alt and the Backspace key to terminate the entire X Window System session
You should try to shut down the application using Ctrl+Alt as a last resort. Sometimes this may not work
because the keys are trapped, although this key combination generally shuts down the GUI. If it's still in
your process list, you may have to terminate the process. When you shut down an application in this
manner, your work may not be saved. You may, for example, be using a word processor and find that the
program hangs and won't respond. To avoid losing work, you should save your work frequently, just as in
any other operating system.

Saving work
Depending on the program you are using, you can save your work using either a shortcut key or a menu
selection. The occasional program crash is unavoidable even in Linux. To minimize program crashes, you
need to read the application documentation to ensure that the software packages are installed in the
correct environment, and use favored programs, libraries, or versions. If you use various software
packages with vastly different needs, you should run them on different accounts or even on separate
machines.

Documentation
In the Linux Documentation Project, there are several types of HOWTOs that provide valuable information
about installing and configuring the X Window System.

http://library.skillport.com/courseware/cbtlib/259938/260044/eng/article/lp1/pages/nito.html? 9/9/2013

Article: Setting up the X Window System in Linux

Page 6 of 6

The "Linux XDMCP HOWTO" deals with setting up your X server to accept connections from remote
terminals. The X server can then display the GUI on these remote terminals.
The "Linux XFree86 HOWTO" is hardly ever used because people rarely download and install the X
Window System from scratch. However, you may need it if you are carrying out complicated
customization or if you want to install a newly released version that's not available in any other format.
The "X Window System architecture overview HOWTO", also called the "X Window overview HOWTO",
explains the many individual components of the X Window System and how they work together.
The "X Window user HOWTO" provides information about settings that users can configure.
If you're having problems with setting up a three-button serial mouse, you should consult the "threebutton serial mouse HOWTO".
If your backspace and Delete keys aren't functioning as you want them to, you can tweak them using the
information in the "Linux backspace delete mini HOWTO".
The "remote X action mini HOWTO" explains how to display applications on remote terminals.
The "XDM and X terminal mini HOWTO" specifically covers the XDM, which handles features like
graphical logins.
If you plan to use two mouse devices, you should consult the "second mouse and X mini HOWTO".

Summary
The X Window System is the framework for the graphical user interface (GUI) in Linux and UNIX. The
main tools for configuring the XFree86 are the command-line xf86config tool and the menu-based
xf86setup tool. Several other tools, including those packaged with specific Linux distributions, are also
available.
Installing a GUI for Linux involves configuring X with appropriate hardware specifications, and installing
and configuring an appropriate window manager or desktop environment. It also involves checking for
library dependencies, and installing and configuring specific devices.

2012 SkillSoft Ireland Limited

http://library.skillport.com/courseware/cbtlib/259938/260044/eng/article/lp1/pages/nito.html? 9/9/2013