Setting up XFree86 is not difficult in most cases. However, if you happen to be using hardware for which drivers ar under development, or wish to obtain the best performance or resolution from an accelerated graphics card, configuring XFree86 can be somewhat time-consuming.
In this section we will describe how to create and edit the
file, which configures the XFree86 server. In many cases it is best to
start out with a ``basic'' XFree86 configuration, one which uses a low
resolution, such as 640x480, which should be supported on all video cards
and monitor types. Once you have XFree86 working at a lower, standard
resolution, you can tweak the configuration to exploit the capabilities
of your video hardware. The idea is that you want to know that XFree86 works
at all on your system, and that something isn't wrong with your installation,
before attempting the sometimes difficult task of setting up XFree86 for
In addition to the information listed here, you should read the following documentation:
/usr/X11R6/lib/X11/doc(contained within the
XFree86-3.1-docpackage). You should especially see the file
README.Config, which is an XFree86 configuration tutorial.
READMEfiles in the above directory (such as
README.S3). Read one of these if applicable.
The main XFree86 configuration file is
This file contains information on your mouse, video card parameters, and
so on. The file
XF86Config.eg is provided with the XFree86
distribution as an example. Copy this file to
XF86Config and edit
it as a starting point.
XF86Config man page explains the format of this file in detail.
Read this man page now, if you have not done so already.
We are going to present a sample
XF86Config file, piece by piece.
This file may not look exactly like the sample file included in the
XFree86 distribution, but the structure is the same.
Note that the
XF86Config file format may change
with each version of XFree86; this information is only valid for
XFree86 version 3.1.
Also, you should not simply copy the configuration file
listed here to your own system and attempt to use it. Attempting to use
a configuration file which doesn't correspond to your hardware could
drive the monitor at a frequency which is too high for it; there have
been reports of monitors (especially fixed-frequency monitors) being
damaged or destroyed by using an incorrectly configured
file. The bottom line is this: Make absolutely sure that your
XF86Config file corresponds to your hardware before you attempt
to use it.
Each section of the
XF86Config file is surrounded by
the pair of lines
The first part of the
Section "section-name" ... EndSection
Files, which looks like this:
Section "Files" RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/X11R6/lib/X11/fonts/misc/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" EndSection
RgbPath line sets the path to the X11R6 RGB color database,
FontPath line sets the path to a directory containing
X11 fonts. In general you shouldn't have to modify these lines;
just be sure that there is a
FontPath entry for each font type
that you have installed (that is, for each directory in
The next section is
ServerFlags, which specifies several global
flags for the server. In general this section is empty.
Here, we have all lines within the section commented out.
Section "ServerFlags" # Uncomment this to cause a core dump at the spot where a signal is # received. This may leave the console in an unusable state, but may # provide a better stack trace in the core dump to aid in debugging # NoTrapSignals # Uncomment this to disable the <Crtl><Alt><BS> server abort sequence # DontZap EndSection
The next section is
Keyboard. This should be fairly intuitive.
Other options are available as well---see the
Section "Keyboard" Protocol "Standard" AutoRepeat 500 5 ServerNumLock EndSection
XF86Configfile if you wish to modify the keyboard configuration. The above should work for most systems.
The next section is
Pointer which specifies parameters for the
The only options that you should concern yourself with now are
Section "Pointer" Protocol "MouseSystems" Device "/dev/mouse" # Baudrate and SampleRate are only for some Logitech mice # BaudRate 9600 # SampleRate 150 # Emulate3Buttons is an option for 2-button Microsoft mice # Emulate3Buttons # ChordMiddle is an option for some 3-button Logitech mice # ChordMiddle EndSection
Protocolspecifies the mouse protocol that your mouse uses (not the make or brand of mouse). Valid types for
Protocol(under Linux---there are other options available for other operating systems) are:
BusMouseshould be used for the Logitech busmouse. Note that older Logitech mice should use
Logitech, but newer Logitech mice use either
Mousemanprotocols. This is a case in which the protocol doesn't necessarily have anything to do with the make of the mouse.
Device specifies the device file where the mouse can be
accessed. On most Linux systems, this is
/dev/mouse is usually a link to the appropriate
serial port (such as
/dev/cua0) for serial mice, or to the
appropriate busmouse device for busmice. At any rate, be sure
that the device file listed in
The next section is
Monitor, which specifies the characteristics
of your monitor. As with other sections in the
file, there may be more than one
Monitor section. This is useful
if you have multiple monitors connected to a system, or use the same
XF86Config file under multiple hardware configurations.
In general, though, you will need a single
Section "Monitor" Identifier "CTX 5468 NI" # These values are for a CTX 5468NI only! Don't attempt to use # them with your monitor (unless you have this model) Bandwidth 60 HorizSync 30-38,47-50 VertRefresh 50-90 # Modes: Name dotclock horiz vert ModeLine "640x480" 25 640 664 760 800 480 491 493 525 ModeLine "800x600" 36 800 824 896 1024 600 601 603 625 ModeLine "1024x768" 65 1024 1088 1200 1328 768 783 789 818 EndSection
Identifier line is used to give an arbitrary name to the
Monitor entry. This can be any string; you will use it to refer to
Monitor entry later in the
they are listed below.
HorizSync specifies the valid horizontal sync frequencies for
your monitor, in kHz. If you have a multisync monitor, this can be
a range of values (or several comma-separated ranges), as seen above.
If you have a fixed-frequency monitor, this will be a list of discrete
values, such as:
Your monitor manual should list these values in the technical specifications section. If you do not have this information available, you should either contact the manufacturer or vendor of your monitor to obtain it. There are other sources of information, as well;
HorizSync 31.5, 35.2, 37.9, 35.5, 48.95
VertRefresh specifies the valid vertical refresh rates (or
vertical synchronization frequencies) for your monitor, in Hz.
HorizSync this can be a range or a list of discrete
values; your monitor manual should list them.
VertRefresh are used only
to double-check that the monitor resolutions that you specify are in
valid ranges. This is to reduce the chance that you will damage your
monitor by attempting to drive it at a frequency for which it was not
ModeLine directive is used to specify a single resolution mode
for your monitor. The format of
ModeLine name clock horiz-values vert-values
nameis an arbitrary string, which you will use to refer to the resolution mode later in the file.
dot-clockis the driving clock frequency, or ``dot clock'' associated with the resolution mode. A dot clock is usually specified in MHz, and is the rate at which the video card must send pixels to the monitor at this resolution.
vert-valuesare four numbers each which specify when the electron gun of the monitor should fire, and when the horizontal and vertical sync pulses fire during a sweep.
How can you determine the
ModeLine values for your monitor?
VideoModes.doc, included with the XFree86 distribution,
describes in detail how to determine these values for each resolution
mode that your monitor supports. First of all,
correspond to one of the dot clock values that your video card can
produce. Later in the
XF86Config file you will specify these
clocks; you can only use video modes which have a
supported by your video card.
There are two files included in the XFree86 distribution which may include
ModeLine data for your monitor. These files are
Monitors, both of which are found in
You should start with
ModeLine values for the VESA standard monitor
timings, which most monitors support.
modeDB.txt includes timing
values for VESA standard resolutions. In that file, you will see
entries such as
This is a VESA standard timing for a 640x480 video mode. It uses a dot clock of 25.175, which your video card must support to use this mode (more on this later). To include this entry in the
# 640x480@60Hz Non-Interlaced mode # Horizontal Sync = 31.5kHz # Timing: H=(0.95us, 3.81us, 1.59us), V=(0.35ms, 0.064ms, 1.02ms) # # name clock horizontal timing vertical timing flags "640x480" 25.175 640 664 760 800 480 491 493 525
XF86Configfile, you'd use the line
Note that the
ModeLine "640x480" 25.175 640 664 760 800 480 491 493 525
ModeLine(in this case
"640x480") is an arbitrary string---the convention is to name the mode after the resolution, but
namecan technically be anything descriptive which describes the mode to you.
ModeLine used the server will check that the specifications
for the mode fall within the range of values specified with
VertRefresh. If they do not,
the server will complain when you attempt to start up X (more on this
later). For one thing, the dot clock used by the mode should not
be greater than the value used for
Bandwidth. (However, in many
cases it is safe to use modes with a slightly higher bandwidth than your
monitor can support.)
If the VESA standard timings do not work for you (you'll know after
trying to use them later) then the files
Monitors include specific mode values for many monitor types.
You can create
ModeLine entries from the values found in those
two files as well. Be sure to only use values for the specific model
of monitor that you have. Note that many 14 and 15-inch monitors cannot
support higher resolution modes, and often resolutions of 1024x768 at low
dot clocks. This means that if you can't find high resolution modes for
your monitor in these files, then your monitor probably does not support
those resolution modes.
If you are completely at a loss, and can't find working
values for your monitor, you can follow the instructions in the
VideoModes.doc file included in the XFree86 distribution to
ModeLine values from the specifications listed in your
monitor's manual. While your mileage will certainly vary when attempting
ModeLine values by hand, this is a good place to look
if you can't find the values that you need.
describes the format of the
ModeLine directive and other
aspects of the XFree86 server in gory detail.
Lastly, if you do obtain
ModeLine values which are almost, but not
quite, right, then it may be possible to simply modify the values slightly
to obtain the desired result. For example, if while running XFree86 the
image on the monitor is shifted slightly, or seems to ``roll'', you can
follow the instructions in the
VideoModes.doc file to try to fix
these values. Also, be sure to check the knobs and controls on the monitor
itself! In many cases it is necessary to change the horizontal or vertical
size of the display after starting up XFree86 in order for the image to
be centered and be of the appropriate size. Having these controls on the
front of the monitor can certainly make life easier.
You shouldn't use monitor timing values or
values for monitors other than the model that you own. If you attempt to
drive the monitor at a frequency for which it was not designed, you can
damage or even destroy it.
The next section of the
XF86Config file is
which specifies parameters for your video card. Here is an example.
Section "Device" Identifier "#9 GXE 64" # Nothing yet; we fill in these values later. EndSection
This section defines properties for a particular video card.
Identifier is an arbitrary string describing the card;
you will use this string to refer to the card later.
Initially, you don't need to include anything in the
section, except for
Identifier. This is because we will be
using the X server itself to probe for the properties of the video
card, and entering them into the
Device section later.
The XFree86 server is capable of probing for the video chipset,
clocks, RAMDAC, and amount of video RAM on the board.
Before we do this, however, we need to finish writing the
file. The next section is
Screen, which specifies the monitor/video
card combination to use for a particular server.
Section "Screen" Driver "Accel" Device "#9 GXE 64" Monitor "CTX 5468 NI" Subsection "Display" Depth 16 Modes "1024x768" "800x600" "640x480" ViewPort 0 0 Virtual 1024 768 EndSubsection EndSection
Driver line specifies the X server that you will be using.
The value values for
Accel: For the
SVGA: For the
VGA16: For the
VGA2: For the
Mono: For the non-VGA monochrome drivers in the
/usr/X11R6/bin/Xis a symbolic link to the server that you are using.
Device line specifies the
Identifier of the
section corresponding to the video card to use for this server.
Above, we created a
Device section with the line
Therefore, we use
Identifier "#9 GXE 64"
"#9 GXE 64"on the
Monitor line specifies the name of the
section to be used with this server. Here,
"CTX 5468 NI" is
Identifier used in the
Monitor section described above.
Subsection "Display" defines several properties of the
XFree86 server corresponding to your monitor/video card combination.
XF86Config file describes all of these options in detail;
most of them are icing on the cake and not necessary to get the system
The options that you should know about are:
Depth. Defines the number of color planes---the number of bits per pixel. Usually,
Depthis set to 8. For the
VGA16server, you would use a depth of 4, and for the monochrome server a depth of 1. If you are using an accelerated video card with enough memory to support more bits per pixel, you can set
Depthto 16, 24, or 32. If you have problems with depths higher than 8, set it back to 8 and attempt to debug the problem later.
Modes. This is the list of video mode names which have been defined using the
ModeLinedirective in the
Monitorsection. In the above section, we used
"640x480". Therefore, we use a
The first mode listed on this line will be the default when XFree86 starts up. After XFree86 is running, you can switch between the modes listed here using the keys
Modes "1024x768" "800x600" "640x480"
ctrl-alt-numeric -. It might be best, when initially configuring XFree86, to use lower resolution video modes, such as 640x480, which tend to work on most systems. Once you have the basic configuration working you can modify
XF86Configto support higher resolutions.
Virtual. Sets the virtual desktop size. XFree86 has the ability to use any additional memory on your video card to extend the size of your desktop. When you move the mouse pointer to the edge of the display, the desktop will scroll, bringing the additional space into view. Therefore, even if you are running at a lower video resolution such as 800x600, you can set
Virtualto the total resolution which your video card can support (a 1-megabyte video card can support 1024x768 at a depth of 8 bits per pixel; a 2-megabyte card 1280x1024 at depth 8, or 1024x768 at depth 16). Of course, the entire area will not be visible at once, but it can still be used. The
Virtualfeature is a nice way to utilize the memory of your video card, but it is rather limited. If you want to use a true virtual desktop, we suggest using
fvwm, or a similar window manager, instead.
fvwmallows you to have rather large virtual desktops (implemented by hiding windows, and so forth, instead of actually storing the entire desktop in video memory at once). See the man pages for
fvwmfor more details about this; most Linux systems use
ViewPort. If you are using the
Virtualoption described above,
ViewPortsets the coordinates of the upper-left-hand corner of the virtual desktop when XFree86 starts up.
Virtual 0 0is often used; if this is unspecified then the desktop is centered on the virtual desktop display (which may be undesirable to you).
Many other options for this section exist; see the
man page for a complete description. In practice these other options
are not necessary to get XFree86 initially working.