Read LPI Linux Certification in a Nutshell Online
Authors: Adam Haeder; Stephen Addison Schneiter; Bruno Gomes Pessanha; James Stanger
Tags: #Reference:Computers
Most Linux distributions install and automatically configure X.Org,
freeing users from much of its installation and configuration. However,
Exam 102 requires specific knowledge of some of the underpinnings of X
configuration.
Be careful about installing an X server on a system that already
has X installed. A backup should be made prior to the
installation
.
X.Org is the standard X Window System implementation for
most distributions of Linux. X.Org is released and maintained by X.Org
Foundation, which is a nonprofit community of developers and
documentation writers. The X11 environment from X.Org is based on the
code developed by
XFree86, which was used as the X Windows implementation in
many Linux distributions.
Freedesktop.org
is a
collaborative project to develop software for X Window System computers.
Get distribution files for X.Org at
http://freedesktop.org
.
The X.Org project provides support for an amazing array of
graphics hardware. This outcome is possible partly due to cooperation by
manufacturers through public release of graphics device documentation
and driver software, and partly due to the tenacity of the X.Org
developers. Fortunately, many manufacturers who were historically
uninterested in offering technical information to the X.Org project have
become cooperative. The result is that most recent video hardware is
well-supported by X.Org.
To avoid problems, it is important to verify XFree86
compatibility with your hardware prior to installation. At the very
least, you should be aware of these items:
As with any software, improvements in X.Org are made over
time, particularly in support for hardware devices. You should
choose a version of X.Org that offers a good balance between the
video support and stability you require. To determine which
version of X you’re running, simply issue the following
command
:
$X -version
X.org X Server 1.6.1.901 (1.6.2 RC1)
Release Date 2009-5-8
X Protocol Version 11, Revision 0
X.Org video drivers are written for graphics
chipsets, not the video cards on which they’re installed.
Multiple video cards from a variety of manufacturers can carry
the same chipset, making those cards nearly identical in
function. You must verify that the chipset on your video card is
supported by X.Org to use advanced graphics features. Supported
chipsets are listed on the X.Org wiki.
X.Org can be configured to handle just about any
monitor, particularly the newer and very flexible multisync
monitors sold today, which can handle preset configurations
provided in the X.Org Foundation configuration utilities.
However
, if you have a
nonstandard monitor, you need to know some parameters describing
its capabilities before configuring X, including your monitor’s
horizontal
sync frequency
(in kHz), vertical refresh frequency (in Hz), and resolution (in
pixels). These items can usually be found in your monitor’s
documentation, but since most monitors conform to standard
display settings such as
XGA
(1024×768
pixels at 60 Hz vertical refresh), you should be able to use a
preset configuration.
It is rare that you’ll actually need to install X.Org by hand,
as X.Org is typically installed during initial system installation for
systems that plan to use X. Most Linux distributions include X.Org
packages on the installation media so you can install them from there
using your distribution’s choice of package managers.
Some applications might require that you install a new release
or development version of X.Org that is not available as a package. In
these cases, you can download the source files or precompiled binaries
from
X.Org mirror
websites
. Refer to
Chapter 5
for more
information on installing applications from packages or source
files.
X.Org configuration differs slightly among versions and
among Linux distributions, but essentially involves the creation of
the
xorg.conf
file customized for your system.
The file is created during the system install as devices are
automatically detected and configured. Typically there is no further
need for modification to the file, as it will be managed by the
system. The X server uses this configuration file when it starts to
set such things as keyboard and mouse selections, installed fonts, and
screen resolutions.
Example 14-1
contains an
xorg.conf
file. (Note that the
xorg.conf
file shown contains example settings
and is not intended for use on your system.)
Example 14-1. A sample xorg.conf file for XFree86 v3.3.3
# /etc/X11/xorg.conf (xorg X Window System server configuration file)
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section "Files"
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
FontPath "/usr/share/fonts/X11/misc"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection
Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbOptions" "lv3:ralt_switch"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/wacom" # Change to
# /dev/input/event
# for USB
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/wacom" # Change to
# /dev/input/event
# for USB
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/wacom" # Change to
# /dev/input/event
# for USB
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection
Section "Device"
Identifier "VMWare Inc [VMware SVGA II] PCI Display Adapter"
Driver "vmware"
BusID "PCI:0:15:0"
EndSection
Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-51
VertRefresh 43-60
EndSection
Section "Screen"
Identifier "Default Screen"
Device "VMWare Inc [VMware SVGA II] PCI Display Adapter"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 1
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 4
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection
Section "DRI"
Mode 0666
EndSection
Various Linux distributors provide their own
configuration utilities. For example,
system-config-display
is distributed by
Red Hat Software. It is an X-based GUI tool that can
probe graphics chipsets and features. In Red Hat Fedora 10, the
xorg.conf
file was dropped. Instead, the
operating system detects system components and configures the X system
accordingly every time the system boots. If you need to configure a
system component manually, you first need to create the
xorg.conf
file. This can be accomplished using
different tools, such as the
system-config-display
package if it is installed.
This can be run interactively as root from the command line, or it may
be run from the display command in the System
→
Adminis
tration
→
Display menu. In either
case, the graphical interactive control for video driver and monitor
selection will open. You can install the
system-config-display
package using a package
controller such as
yum
. Refer to
Chapter 5
for more
information about installing packages. To run the
system-config-display
package from the terminal,
type the following:
#system-config-display
The alternative is to manually create and edit the
xorg.conf
file. This may be done using the
xorg –configure
command, which will create a
basic new
xorg.conf
file using information that
is autodetected from the system. The file will be created in the local
directory.
Example 14-2
shows
the creation of the
xorg.conf
file using the
–configure
option in Fedora Linux.
Example 14-2. Creating the xorg.conf file in Fedora Linux
#Xorg -configure
X.Org X Server 1.6.1.901 (1.6.2 RC 1)
Release Date: 2009-5-8
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.18-128.1.6.el5 i686
Current Operating System: Linux Suffolk 2.6.29.6-213.fc11.i686.PAE #1 \
SMP Tue Jul 7 20:59:29 EDT 2009 i686
Kernel command line: ro root=/dev/mapper/vg_suffolk-lv_root rhgb quiet
Build Date: 18 May 2009 02:47:59PM
Build ID: xorg-x11-server 1.6.1.901-1.fc11
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Wed Aug 12 06:32:31 2009
List of video drivers:
glint
nv
vmware
voodoo
radeon
mach64
geode
sisusb
intel
s3virge
siliconmotion
ati
mga
amd
savage
ast
v4l
i128
neomagic
sis
r128
dummy
rendition
nouveau
ztv
trident
tdfx
cirrus
i740
openchrome
apm
fbdev
vesa
(++) Using config file: "/root/xorg.conf.new"
Xorg detected your mouse at device /dev/input/mice.
Please check your config if the mouse is still not
operational, as by default Xorg tries to autodetect
the protocol.
Your xorg.conf file is /root/xorg.conf.new
To test the server, run 'X -config /root/xorg.conf.new'
The resulting
xorg.conf.new
file will need to be modified and then copied to the
/etc/X11/
directory so it can be used the next
time the system starts:
#cp /root/xorg.conf.new /etc/X11/xorg.conf
The default location for the
xorg.conf
file
is in
/etc/X11
. The file contains a number of
sections, listed next, that describe various parameters of devices
attached to the system. The sections may be in any order.
Files
This section is used to specify the default font path and
the path to the RGB database. Using theFontPath
"path
"
directive multiple times creates a
list of directories that the X server will search for fonts. The
RGB database is an equivalence table of numeric red/green/blue
color values with names. Here’s a short excerpt of the RGB
database:
255 228 196 bisque
255 218 185 peach puff
255 218 185 PeachPuff
255 222 173 navajo white
Hundreds of these names are defined and may be used in the
configuration of X applications where color names are
required.
ServerFlags
This section allows customization of X server
options such as the handling of hotkeys.
InputDevice
This section may be used multiple times in the
configuration file, depending on the types of devices connected
to the system. Normally it will appear at least twice: once for
the keyboard and again for the mouse.
Monitor
MultipleMonitor
sections are used to define
the specifications of monitors and a list of the video modes
they can handle.
Device
MultipleDevice
sections are used to define the video hardware (cards)
installed.
Screen
TheScreen
section ties together aDevice
with a correspondingMonitor
and includes some
configuration settings for them.
ServerLayout
This section ties together aScreen
with one or moreInputDevice
s. MultipleServerLayout
sections may be used for
multiheaded configurations (i.e., systems with more than one
monitor).
On the Exam
You don’t need to memorize details about
xorg.conf
, but it is an important file, and
your familiarity with it will be tested. In particular, be aware of
what each of the sections does for the X server, and remember that
theScreen
section ties together
aDevice
and aMonitor
.