Understanding xorg.conf
The X.Org Server (home page) is the official reference implementation of the X Window System. The current stable release is 1.4.0, released as part of X11R7.3 on 6 September 2007. It is both open source and free software. The project is supported and overseen by the X.Org Foundation and is hosted by freedesktop.org.
There’s a file in your linux system within /etc/X11/ called xorg.conf. X.org (also called the X11) server is mostly controlled through a configuration file, xorg.conf, for its initial setup. This controls much of the video output for your linux machine but also controls various peripherals as well. We’re not going to cover the entire file as there is far to much to cover but we will introduce the structure of the file and common areas new users to linux might have to face.
The xorg.conf file is composed of a number of sections which may be present in any order. Each section has the form:
Section "SectionName"
SectionEntry
...
EndSection
The section names are:
Files File pathnames ServerFlags Server flags Module Dynamic module loading InputDevice Input device description Device Graphics device description VideoAdaptor Xv video adaptor description Monitor Monitor description Modes Video modes descriptions Screen Screen configuration ServerLayout Overall layout DRI DRI-specific configuration Vendor Vendor-specific configuration
The following obsolete section names are still recognised for compatibility purposes. In new config files, the InputDevice section should be used instead.
Pointer Pointer/mouse configurationKeyboard Keyboard configuration
The Files Section
The Files section is used to specify some path names required by the server. Some of these paths can also be set from the command line. The command line settings override the values specified in the config file. The Files section is optional, as are all of the entries that may appear in it.
The entries that can appear in this section are:
- FontPath “path”
The FontPath sets the search path for fonts. This path is a comma separated list of font path elements which the Xorg server searches for font databases. Multiple FontPath entries may be specified, and they will be concatenated to build up the fontpath used by the server. Font path elements may be either absolute directory paths, or a font server identifier. Font server identifiers have the form:
<trans>/<hostname>:<port-number>
where <trans> is the transport type to use to connect to the font server (e.g., unix for UNIX-domain sockets or tcp for a TCP/IP connection), <hostname> is the hostname of the machine running the font server, and <port-number> is the port number that the font server is listening on (usually 7100). When this entry is not specified in the config file, the server falls back to the compiled-in default font path.
- RGBPath “path“
sets the path name for the RGB color database. When this entry is not specified in the config file, the server falls back to the compiled-in default RGB path, which is:
/tmp/Xorg-KEM/lib/X11/rgb
Note that an implicit .txt is added to this path if the server was compiled to use text rather than binary format RGB color databases.
- ModulePath “path“
The Module path sets the search path for loadable Xorg server modules. This path is a comma separated list of directories which the Xorg server searches for loadable modules loading in the order specified. Multiple ModulePath entries may be specified, and they will be concatenated to build the module search path used by the server.
The Serverflags Section
The ServerFlags section is used to specify some global Xorg server options. All of the entries in this section are Options, although for compatibility purposes some of the old style entries are still recognised. Those old style entries are not documented here, and using them is discouraged. The ServerFlags section is optional, as are the entries that may be specified in it. Options specified in this section (with the exception of the “DefaultServerLayout” Option) may be overridden by Options specified in the active ServerLayout section. Options with command line equivalents are overridden when their command line equivalent is used.
The Module Section
The Module section is used to specify which Xorg server modules should be loaded. This section is ignored when the Xorg server is built in static form. The types of modules normally loaded in this section are Xorg server extension modules, and font rasteriser modules. Most other module types are loaded automatically when they are needed via other mechanisms. The Module section is optional, as are all of the entries that may be specified in it.
The Input Device Section
The config file may have multiple InputDevice sections. There will normally be at least two: one for the core (primary) keyboard, and one of the core pointer. If either of these two is missing, a default configuration for the missing ones will be used. Currently the default configuration may not work as expected on all platforms.
InputDevice sections have the following format:
Section "InputDevice"
Identifier "name"
Driver "inputdriver"
options
...
EndSection
The Identifier and Driver entries are required in all InputDevice sections. All other entries are optional.
The Identifier entry specifies the unique name for this input device. The Driver entry specifies the name of the driver to use for this input device. When using the loadable server, the input driver module “inputdriver” will be loaded for each active InputDevice section. An InputDevice section is considered active if it is referenced by an active ServerLayout section, if it is referenced by the -keyboard or -pointer command line options, or if it is selected implicitly as the core pointer or keyboard device in the absence of such explicit references. The most commonly used input drivers are “keyboard” and “mouse”.
In the absence of an explicitly specified core input device, the first InputDevice marked as CorePointer (or CoreKeyboard) is used. If there is no match there, the first InputDevice that uses the “mouse” (or “keyboard” or “kbd”) driver is used. The final fallback is to use built-in default configurations.
The Device Section
The config file may have multiple Device sections. There must be at least one, for the video card being used.
Device sections have the following format:
Section "Device"
Identifier "name"
Driver "driver"
entries
...
EndSection
The Identifier and Driver entries are required in all Device sections. All other entries are optional.
The Identifier entry specifies the unique name for this graphics device. The Driver entry specifies the name of the driver to use for this graphics device. When using the loadable server, the driver module “driver” will be loaded for each active Device section. A Device section is considered active if it is referenced by an active Screen section.
The Monitor Section
The config file may have multiple Monitor sections. There should normally be at least one, for the monitor being used, but a default configuration will be created when one isn’t specified.
Monitor sections have the following format:
Section "Monitor"
Identifier "name"
entries
...
EndSection
The only mandatory entry in a Monitor section is the Identifier entry.
The Identifier entry specifies the unique name for this monitor. The Monitor section provides information about the specifications of the monitor, monitor-specific Options, and information about the video modes to use with the monitor. Specifying video modes is optional because the server now has a built-in list of VESA standard modes. When modes are specified explicitly in the Monitor section (with the Modes, ModeLine, or UseModes keywords), built-in modes with the same names are not included. Built-in modes with different names are, however, still implicitly included.
Some of the entries that may be used in Monitor sections are described below.
- VendorName “vendor“
- This optional entry specifies the monitor’s manufacturer.
- ModelName “model“
This optional entry specifies the monitor’s model.
- HorizSync horizsync-range
gives the range(s) of horizontal sync frequencies supported by the monitor. horizsync-range may be a comma separated list of either discrete values or ranges of values. A range of values is two values separated by a dash. By default the values are in units of kHz. They may be specified in MHz or Hz if MHz or Hz is added to the end of the line. The data given here is used by the Xorg server to determine if video modes are within the specifications of the monitor. This information should be available in the monitor’s handbook. If this entry is omitted, a default range of 28-33kHz is used.
- VertRefresh vertrefresh-range
gives the range(s) of vertical refresh frequencies supported by the monitor. vertrefresh-range may be a comma separated list of either discrete values or ranges of values. A range of values is two values separated by a dash. By default the values are in units of Hz. They may be specified in MHz or kHz if MHz or kHz is added to the end of the line. The data given here is used by the Xorg server to determine if video modes are within the specifications of the monitor. This information should be available in the monitor’s handbook. If this entry is omitted, a default range of 43-72Hz is used.
There are other sections to this but these are the main ones new users should concern themselves with.
The Modes Section
The config file may have multiple Modes sections, or none. These sections provide a way of defining sets of video modes independently of the Monitor sections. Monitor sections may include the definitions provided in these sections by using the UseModes keyword. In most cases the Modes sections are not necessary because the built-in set of VESA standard modes will be sufficient.
Modes sections have the following format:
Section "Modes"
Identifier "name"
entries
...
EndSection
The Identifier entry specifies the unique name for this set of mode descriptions. The other entries permitted in Modes sections are the Mode and ModeLine entries that are described above in the Monitor section
The Screen Section
The config file may have multiple Screen sections. There must be at least one, for the “screen” being used. A “screen” represents the binding of a graphics device (Device section) and a monitor (Monitor section). A Screen section is considered “active” if it is referenced by an active ServerLayout section or by the -screen command line option. If neither of those is present, the first Screen section found in the config file is considered the active one.
Screen sections have the following format:
Section "Screen"
Identifier "name"
Device "devid"
Monitor "monid"
entries
...
SubSection "Display"
entries
...
EndSubSection
...
EndSection
The Identifier and Device entries are mandatory. All others are optional.
The Identifier entry specifies the unique name for this screen. The Screen section provides information specific to the whole screen, including screen-specific Options. In multi-head configurations, there will be multiple active Screen sections, one for each head.Each Screen section may optionally contain one or more Display subsections. Those subsections provide depth/fbbpp specific configuration information, and the one chosen depends on the depth and/or fbbpp that is being used for the screen. The Display subsections normally has two options. Depth, and Modes. Defaultdepth will chose which one of the Depth’s to use and the Modes under that identify what screen resolutions are available for each Depth. Example:
Section “Screen”
Identifier “Default Screen”
Device “nVidia Corporation NV11 [GeForce2 MX/MX 400]”
Monitor “MX70″
Defaultdepth 24
SubSection “Display”
Depth 1
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
SubSection “Display”
Depth 4
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
SubSection “Display”
Depth 8
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
SubSection “Display”
Depth 15
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
SubSection “Display”
Depth 16
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
SubSection “Display”
Depth 24
Modes “1024×768″ “800×600″ “640×480″
EndSubSection
EndSection
The Server Layout Section
The config file may have multiple ServerLayout sections. A “server layout” represents the binding of one or more screens (Screen sections) and one or more input devices (InputDevice sections) to form a complete configuration. In multi-head configurations, it also specifies the relative layout of the heads. A ServerLayout section is considered “active” if it is referenced by the -layout command line option or by an Option “DefaultServerLayout” entry in the ServerFlags section (the former takes precedence over the latter). If those options are not used, the first ServerLayout section found in the config file is considered the active one. If no ServerLayout sections are present, the single active screen and two active (core) input devices are selected as described in the relevant sections above.
ServerLayout sections have the following format:
Section "ServerLayout"
Identifier "name"
Screen "screen-id"
...
InputDevice "idev-id"
...
options
...
EndSection
Each ServerLayout section must have an Identifier entry and at least one Screen entry.
The Identifier entry specifies the unique name for this server layout. The ServerLayout section provides information specific to the whole session, including session-specific Options. The ServerFlags options (described above) may be specified here, and ones given here override those given in the ServerFlags section.
Dir Section
This optional section is used to provide some information for the Direct Rendering Infrastructure.
Vender Section
The optional Vendor section may be used to provide vendor-specific configuration information. Multiple Vendor sections may be present, and they may contain an Identifier entry and multiple Option flags. The data therein is not used in this release.
Files Section
For an example of an xorg.conf file, see the file installed as /tmp/Xorg-KEM/lib/X11/xorg.conf.eg.
All of this information can be found here in far more detail. This manual page was largely rewritten by David Dawes <dawes@xfree86.org>.







