- Shopping Bag ( 0 items )
Ships from: Englewood, CO
Usually ships in 1-2 business days
[Figures are not included in this sample chapter]
[Figures are not included in this sample chapter]
This hour looks at getting your X11 Window system up and running. X Window is
the graphical windowing system that Linux and many other UNIX systems use. It is
analogous to the windowing environment in Windows, OS/2, or Macintosh.
One of the differences between X11 Window and the other environments is that it
was designed to be a machine/OS independent networked client/server program. As a
result, the system is broken up into two major components: the X11 Window server
that runs on the machine and interacts directly with the monitor and the video card,
and the various clients that are displayed on the X11 server. These clients can range
from terminal emulators (xterm) to eye candy (xpat2), or can manage the look and
feel of the screen (the X11 Window Manager).
This hour begins by setting up the X Window system server that was skipped during
the install, and finishes up by familiarizing you with the look and feel of the default
windows that Red Hat offers. A later hour deals with customizing the system to different
personal tastes. You need any documentation you have on your computer's video card
and its monitor.
The default X Window server that most Linux boxes come with (and the one on this
book's CD) is supplied by the XFree86 Project. Other servers are provided from various
commercial vendors and are discussed later in the hour.
First, check to make sure all of the files you need were installed during Hour
2, "Installing Linux." To see what X11 packages have been installed on
the machine, you need to use the rpm command and pipe it through the grep
command to find the lines that begin with X. The commands are covered in more detail
throughout the rest of the book. If you enter the command
rpm -qa | grep ^X
you should receive output similar to the following:
JUST A MINUTE Pay special attention to the last line in the preceding listing.
The S3 portion of the line indicates the use of a video card with the S3
chipset. Knowing how the files are named makes it easier if you have to install a
package for your video card later.
You're seeing what groups of packages were installed on the system. If you don't
get any output but another hash prompt, there were no packages installed on the machine
that begin with the letter X. If you don't get a list similar to the preceding one
you need to install some extra packages to the system to get X11 up and running.
JUST A MINUTE If you followed the instructions carefully in Hour 2, you should
have all the files you need to begin configuring your system.
In order to install the files you need, you must load the CD-ROM for Linux to
see it, then get data off of it.
Insert the Red Hat CD-ROM and at the # prompt type the following:
After a few seconds you should see some activity on the CD-ROM and the #
prompt, letting you know that you can continue. Change your current working directory
to that of the CD-ROM's RPM area by typing the following command:
Further data, configuration options, and bug tips can be found at the following
If no X items were installed, you need to install several RPM packages by using
the rpm command. At the prompt, type the following commands one at a time,
pressing Enter after each:
rpm -ivh X11R6-contrib*
rpm -ivh Xaw3d-1.3*
rpm -ivh Xconfig*
rpm -ivh XFree86-3*
rpm -ivh XFree86-75*
rpm -ivh XFree86-libs*
The preceding command lines will install everything you need except for the X
server, which supports your specific video card. To install the correct server type
in the following:
rpm -ivh Xfree86-YY *
Replace YY in your command line with the server name for your video card. Table
3.1 gives you a brief rundown of the servers and what chipsets they support.
|Server||What video chipsets this covers (short list)|
|Mono||2 color black-and-white.|
|VGA16||16 color VGA mode. Supports VGA with 256KB memory.|
|SVGA||Trident, Cirrus Logic, Chips and Technology, ET4000, S3V, and others.|
|Mach8||ATI boards with Mach8 chipset.|
|Mach32||ATI boards with Mach32 chipset.|
|Mach64||ATI boards with Mach64 chipset.|
|8514||IBM 8514/A boards and true clones.|
|S3||#9 boards, older Diamonds, others.|
|S3V||S3 Virge boards. Support is in SVGA.|
|AGX||All XGA graphic boards.|
|P9000||Diamond Viper (but not the 9100) and others.|
|W32||ET4000/W32 but not ET4000s.|
TIME SAVER If you're not sure which X server to install, run the Xconfiguator
program (detailed in the following section) and it will detect most supported PCI
video cards, letting you know which server to install.
At the # prompt, run the Xconfigurator command. You will get
a welcome screen with an Ok button at the bottom, explaining the program.
Pressing Enter starts a PCI probe to see if Xconfigurator finds any video
cards in your system. If it finds any, it shows which chipset and which X server
need to be used. Pay special attention to this--if you installed the incorrect X
server you are given the opportunity to correct your mistake. See Figure 3.1 for
an example of the output when Xconfigurator successfully probes for a card.
If the program can't find a card when probing, it brings up a list of cards and servers
Figure 3.1.Pay special attention to the information in this screen..
JUST A MINUTE If you manually installed the X server earlier and it doesn't
match what the Xconfigurator finds, the configuration program aborts. Install
the proper X server and then begin the configuration process again.
If you can't find your card on the list of servers, you should try to use the
SuperProbe program. Running that probes the card directly and outputs what video
chipset, amount of memory, and RAMDAC chipset it found.
CAUTION The SuperProbe command can lock up the machine and with a
very few cards cause other problems. Read the man page on SuperProbe (man
SuperProbe), and if you aren't comfortable with the possible risk, don't
If you still haven't found a chipset that matches your system, you need to use
the VGA16 or Mono server, as these are the lowest common denominators available.
When choosing a video card, you also should be aware that video card manufacturers
like to use name recognition but also use the best technology available for their
card. Sometimes this results in two cards with similar names having very different
chipsets--and it's the chipset Linux cares about. So, you may set up the servers
thinking you have one chipset, and when finally starting the server get errors telling
you that the card is not being detected.
This section shows you how to configure the X server to choose your monitor type.
You need to have the monitor specifications for your computer.
CAUTION Be very careful to select the settings that conservatively match your
monitor. Choosing bad values can seriously damage your monitor.
After selecting a video card, you are asked to set up the monitor of the computer.
You should then be presented with a screen, shown in Figure 3.2, that asks about
the monitor on your system. Scroll down the list and choose a monitor name if it
exactly matches your monitor's brand and model. If you know that your monitor is
very similar to one in the list, you might be able to choose that one also.
If you don't find your monitor listed, you need to select a generic monitor or the
Figure 3.2. The monitor selection screen.
If you choose to use a custom monitor, you are presented with a screen explaining
that you will be asked for the vertical and horizontal sync rates of your monitor.
Your monitor's manual should give these listings, usually in the Specifications section.
Select Ok to continue.
You are then asked for the horizontal sync range of the monitor. In choosing a
rate, you should be very conservative about the type of settings if you don't see
what your monitor is capable of. Most monitors should be able to display what is
called Standard VGA. Next, you need to select the vertical range your monitor is
capable of, and you again need to be conservative.
The next screen depends on whether a PCI video card was detected or not. If one
was detected, you are told that the installation will probe for correct video settings
and ranges that are available. If no PCI card was detected, you are given a choice
of probing or not. The reason for the choice is that some older ISA video cards do
not accept probing and lock up the system if it is attempted.
Choosing to probe the system causes the screen to blink several times as Xconfigurator
figures out what the card's available color depths are. You then see another screen
that informs you what screens Xconfigurator recommends as a default setting,
and gives you the choice to take those values or select others. In selecting others,
you are given a selection of all video sizes and color depths that can be supported
by the X server and monitor (see Figure 3.3).
Toggle through the check boxes you want (640x480 choices are always good selections).
The 2/4/8/16/24 color depth is a listing of the number of colors that can be displayed
at once. 4 bit is a 16-color choice of the original VGA selections. 8 bit allows
for 256 colors, 16 bits allows for 65,000+ colors, and finally the 24-bit color allows
the display of several million sets of colors. If your card is capable of higher
sets of colors, then the more memory the card has, the higher the possible resolution
of colors and screen size. When you have selected the screen sizes you want, select
OK and the new /etc/X11/XF86Config file is written to your computer.
Figure 3.3. Select the modes you want to use.
If you chose not to probe the monitor system, the next screen asks you how much video
memory your card has. From either the documentation on the card or from the SuperProbe
command, choose the amount of memory and select Ok. You are then asked to
select a clock chip for the monitor. If your manual or the SuperProbe command
didn't indicate a clock chip, you should choose the recommended no chip selection
and continue on.
You are then presented with a screen that asks you to select the screen resolutions
and color depths for your X environment. Choose a set of screen sizes and color depths
that are suitable for you to work with. 640x480 resolution is always a good choice
because most monitors can handle this setting. Upon selecting the screen sizes, a
new /etc/X11/XF86Config file is written for your computer.
Now that you have created X configuration settings that hopefully work for your
computer, it's time to test them. To start the X server, run the startx
command. This command sets up the internal environment, starts the server, and executes
any client programs that need to be run.
CAUTION If the screen goes into what looks like a bad mode (flickering, garbage
colors, and so on), press the following key sequence immediately: CTRL-ALT-BACKSPACE.
This should exit you from the X server immediately. You should then check that your
monitor is operating normally, and run the Xconfigurator command to make
sure that the settings are all right. Choose a 640x480 setting to see if that works.
You should get a gray screen of little overlapping Xs (depending on the resolution
you're running at, you may or may not be able to make out the Xs) This is the default
X Window screen, and should be replaced after a short while by a blue-green screen
and then a start bar at the bottom of the screen. If the color changes to a blue-green
but no start bar appears, see if the bar is "off" the screen. X supports
virtual desktops that are larger than what you can actually see on the screen. Moving
the mouse to the bottom of the screen might show movement and a gray start bar at
This section covers most of the common problems you'll experience when starting
X Window, and how to solve them.
Wait for 30 seconds or so. On a 486/66 or slower machine X Window can take a while
to start. For some video cards, the driver may be having problems using it properly.
Type Control-Alt-Backspace and re-run Xconfigurator.
This is a worst-case scenario. You need to reboot the machine and let the machine
check the disk drives for errors. The Linux filesystem keeps track of what parts
are allocated and when a machine is shut down in a bad state, it needs to run the
fsck command to fix these items. Most times the start-up scripts can handle
this without user intervention.
In the case of very large overlapping Xs, the X server has probably gone into
320x200 mode versus 640x480. This problem occurs when the video card is not detected
correctly by the server. Exit out of X either with the hot keys Ctrl-Alt-Backspace
or cleanly via the Start button at the bottom of the screen. Check the file startx.out
by using the command less startx.out and seeing if any errors
that might help set up matters correctly were listed. Sometimes the problem is that
you may need to select a different RAMDAC or some other option for that card.
If the mouse doesn't respond correctly to user input, it can be due to several
problems. The first is that the pointer section of the file was misconfigured by
mouseconfig and Xconfigurator. Xconfigurator gets the
values for the mouse from the settings that are set by the mouseconfig program.
You should check the settings in the file /etc/sysconfig/mouse or via the
mouseconfig program and then either rerun Xconfigurator or edit
the /etc/X11/XF86Config file. The section of the file should look something
like the following:
The protocol says which type of mouse X should try to use and the device says
which port it should look at. Further information on the types of mice supported
can be found by running the command man XF86Config.
Another common reason for the mouse to fail is that the mouse is requiring special
initializations or is conflicting with another program (usually gpm, which
is a text mouse control program). In the case of possible conflicts, you should try
stopping the gpm program (/etc/rc.d/init.d/gpm stop) and then try
starting X again. If this solves the problem, you may find that you want to disable
gpm altogether. To do this, run the ntsysv command and toggle gpm
For mice that need special configuration options the problem can sometimes be
avoided by treating the mouse as a modem and using a serial program to turn it on.
In these cases, changing mice can often be simpler.
Many Linux commands have documentation in one of several places. Most commands are
documented as a manual page that can be found with the man command. To quickly
find all the items that are related to XFree86, try man -k XF86. This gives
you a list of the documents to be called. A second place to look for documentation
is in the directories /usr/doc and /usr/doc/HOWTO. The /usr/doc
area contains documentation for packages that were installed onto your system. The
/usr/doc/HOWTO contains a reference area of various HOWTOs and helpful tips
on setting up items.
If you always want your machine to start the X Window manager so you don't have
to type startx when you log in, you only have to edit one file.
Log in as root and edit the /etc/inittab file. This file is used by init
to start various utilities. Changing the line beginning with id enables
X to always start on boot.
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
The default run level of a Linux box is 3. Changing the number to 5, as it is
in the preceding example, starts the X Window system, using the xdm program
to manage logins.
Getting to a Virtual Terminal from X
While in X you can get back to a text virtual terminal by using the Control-Alt keystrokes
versus the normal Alt keystrokes. To change from the X window (opened on terminal
7) to another console, press Ctrl-Alt-F2 to get to the second virtual terminal. To
get back, press Alt-F7.