Help answer threads with 0 replies.
Go Back > Linux Answers > Applications / GUI / Multimedia
User Name


By trickykid at 2003-07-10 14:26
1. Information

To start the configuration after an initial install of your Linux OS or the actual files for XFree86, the most basic way is to use the xf86config command logged in as root of course. The first step though before logging in as root and running any commands though is to get as much specific details about your hardware, specifically your video card and monitor.

The minimum basics you should have is a video card manufacturer, model, chipset (not always needed) and the RAM size for the card. For the monitor you should at least have a make, model and the specs for the sync ranges. Not knowing the sync ranges that your specific monitor can handle can lead to damages to it so this is a big must have. Knowing the make and model is not as important as the sync ranges in most cases. If you can't find your specific sync ranges, refer to your manufacturer for these before moving on with the configuration, or you will have a fun time playing a guessing game when time to configure these settings.

***This howto is not covering any additional drivers or the actual installation of files onto your system needed to use XFree86. It is covering the basic configuration assuming any additional files or drivers are already in place.***

*Note: Most newer distributions will configure X during the initial install. This howto is more inclined to help you configure after an installation of XFree86 or a distribution like Slackware that does not configure during the


2. Configuration

If you know all your hardware specs, at this time if your logged in as root, now we can just run the command xf86config (does not matter what your present working directory is as this command should be in root's path, if not, then you can find this in /usr/X11R6/bin/) usually in to start the configuration. Below I've listed just about every screen detail you will run into when configuring X. From this point on its pretty basic, most of the time a 'yes' or 'no' from you to complete the config.

This program will create a basic XF86Config file, based on menu selections you make.

The XF86Config file usually resides in /usr/X11R6/etc/X11 or /etc/X11. A sample XF86Config file
iis supplied with XFree86; it is configured for a standard VGA card and monitor with 640x480
 resolution. This program will ask for a pathname when it is ready to write the file.

You can either take the sample XF86Config as a base and edit it for your configuration, or
 let this program produce a base XF86Config file for your configuration and fine-tune it.

Before continuing with this program, make sure you know what video card you have, and
preferably also the chipset it uses and the amount of video memory on your video card. 
SuperProbe may be able to help with this.

Press enter to continue, or ctrl-c to abort.
This is the first screen, basically just going over where the configuration file is located at, editing and so on. Just hit <enter> to continue at this point.

First specify a mouse protocol type. Choose one from the following list:

 1.  Microsoft compatible (2-button protocol)
 2.  Mouse Systems (3-button protocol)
 3.  Bus Mouse
 4.  PS/2 Mouse
 5.  Logitech Mouse (serial, old type, Logitech protocol)
 6.  Logitech MouseMan (Microsoft compatible)
 7.  MM Series
 8.  MM HitTablet
 9.  Microsoft IntelliMouse

If you have a two-button mouse, it is most likely of type 1, and if you have a three-button mouse,
iit can probably support both protocol 1 and 2. There are two main varieties of the latter type:
mice with a switch to select the protocol, and mice that default to 1 and require a button to
be held at boot-time to select protocol 2. Some mice can be convinced to do 2 by sending
a special sequence to the serial port (see the ClearDTR/ClearRTS options).

Enter a protocol number:
This is where you select what type of mouse you have by selecting the number next to the description listed. If your not sure, most these days are a PS/2 mouse, so you could type 4 and <enter> to be safe and to move on with the configuration.

If your mouse has only two buttons, it is recommended that you enable Emulate3Buttons.

Please answer the following question with either 'y' or 'n'.
Do you want to enable Emulate3Buttons?
This is where you can select to emulate 3 buttons if you only have a mouse with only 2 actual buttons, basically the third button would be pressing both left and right to emulate it. This comes in handy when at a console to cut and paste and so on. In most cases type 'y' and <enter>

Now give the full device name that the mouse is connected to, for example /dev/tty00. 
Just pressing enter will use the default, /dev/mouse.

Mouse device:
This is where you can specify the actual /dev/ location for your mouse. Usually 99% of the time you can just hit <enter> for the default value of /dev/mouse and this should be sufficient enough for your mouse to work properly as this is usually a link to your actual device file during the initial Linux installation.

Please select one of the following keyboard types that is the better description
of your keyboard. If nothing really matches, choose 1 (Generic 101-key PC)

  1  Generic 101-key PC
  2  Generic 102-key (Intl) PC
  3  Generic 104-key PC
  4  Generic 105-key (Intl) PC
  5  Dell 101-key PC
  6  Everex STEPnote
  7  Keytronic FlexPro
  8  Microsoft Natural
  9  Northgate OmniKey 101
 10  Winbook Model XP5
 11  Japanese 106-key
 12  PC-98xx Series
 13  Brazilian ABNT2
 14  HP Internet
 15  Logitech iTouch
 16  Logitech Cordless Desktop Pro
 17  Logitech Internet Keyboard
 18  Logitech Internet Navigator Keyboard
 19  Compaq Internet
 20  Microsoft Natural Pro
 21  Genius Comfy KB-16M
 22  IBM Rapid Access
 23  IBM Rapid Access II
 24  Chicony Internet Keyboard
 25  Dell Internet Keyboard

Enter a number to choose the keyboard.
Self explanatory process of selecting your type of keyboard. If your not sure, usually any of the Generic top 4 choices will work fine, depending on how many keys you have on it. Not sure how many keys your keyboard has, well, better start counting them.

  1  U.S. English
  2  U.S. English w/ ISO9995-3
  3  U.S. English w/ deadkeys
  4  Albanian
  5  Arabic
  6  Armenian
  7  Azerbaidjani
  8  Belarusian
  9  Belgian
 10  Bengali
 11  Brazilian
 12  Bulgarian
 13  Burmese
 14  Canadian
 15  Croatian
 16  Czech
 17  Czech (qwerty)
 18  Danish

Enter a number to choose the country.
Press enter for the next page
Put in your location by typing in the number next to the listed country. Not sure where your at, maybe ask your neighbor or someone near you.

Please enter a variant name for 'us' layout. Or just press enter for default variant
You can get away with just pressing <enter> probably 100% of the time on this step.

Please answer the following question with either 'y' or 'n'.
Do you want to select additional XKB options (group switcher, group indicator, etc.)?
An extention to the X protocol to make smarter use of keyboard mappings. Xkb allows sopisticated manupulation of the character map. Usually in most cases you can just type 'n' and <enter> as most do not setup their keyboards for special mappings. If you do want the option, select 'y' here.

Now we want to set the specifications of the monitor. The two critical parameters
are the vertical refresh rate, which is the rate at which the the whole screen is refreshed,
and most importantly the horizontal sync rate, which is the rate at which scanlines are

The valid range for horizontal sync and vertical sync should be documented in the manual
of your monitor. If in doubt, check the monitor database /usr/X11R6/lib/X11/doc/Monitors
to see if your monitor is there.

Press enter to continue, or ctrl-c to abort.
This basically is just information before proceeding to the monitor configuration. Press <enter> to move on with the configuration.

You must indicate the horizontal sync range of your monitor. You can either
select one of the predefined ranges below that correspond to industry-standard
monitor types, or give a specific range.

It is VERY IMPORTANT that you do not specify a monitor type with a horizontal sync 
range that is beyond the capabilities of your monitor. If in doubt, choose a conservative

    hsync in kHz; monitor type with characteristic modes
 1  31.5; Standard VGA, 640x480 @ 60 Hz
 2  31.5 - 35.1; Super VGA, 800x600 @ 56 Hz
 3  31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600)
 4  31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz interlaced, 800x600 @ 56 Hz
 5  31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz
 6  31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz
 7  31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz
 8  31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz
 9  31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz
10  31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz
11  Enter your own horizontal sync range

Enter your choice (1-11):
This is where you need to give your specific horizontal sync range for you monitor. If nothing in the list matches your monitor exactly, choose 11 and it will prompt you for your range in which you will want to put in this format say if you needed 50 to 180 khz: 50-180

If your totally unsure, you can guess by selecting one of the options though, noting that this can be dangerous to your monitor. To be safe, you can always select the safest choice which would be choice one with the Standard VGA mode until you find the exact specs you should be using for your monitor.

You must indicate the vertical sync range of your monitor. You can either select
one of the predefined ranges below that correspond to industry-standard monitor types,
or give a specific range. For interlaced modes, the number that counts is the high one 
(e.g. 87 Hz rather than 43 Hz).

 1  50-70
 2  50-90
 3  50-100
 4  40-150
 5  Enter your own vertical sync range

Enter your choice:
This is basically the same step as the horizontal sync range except for your vertical sync. You should follow the same steps here as you did for the horizontal ranges. If not for sure, you might want to select 1 with the 50-70 range until you find your exact specs for your monitor.

You must now enter a few identification/description strings, namely an identifier,
a vendor name, and a model name. Just pressing enter will fill in default names.

The strings are free-form, spaces are allowed.
Enter an identifier for your monitor definition:
This is where you will supply the identification and description strings for you monitor. In most cases you can just press <enter> for the default values. Unless you want your specific make and model in your configuration file, just press <enter> to move on with the configuration.

Now we must configure video card specific settings. At this point you can choose
to make a selection out of a database of video card definitions. Because there can be
variation in Ramdacs and clock generators even between cards of the same model, it
iis not sensible to blindly copy the settings (e.g. a Device section). For this reason, 
after you make a selection, you will still be asked about the components of the card,
with the settings from the chosen database entry presented as a strong hint.

The database entries include information about the chipset, what driver to run, the Ramdac 
and ClockChip, and comments that will be included in the Device section. However, a lot 
of definitions only hint about what driver to run (based on the chipset the card uses) 
and are untested.

If you can't find your card in the database, there's nothing to worry about. You should
only choose a database entry that is exactly the same model as your card; choosing one
that looks similar is just a bad idea (e.g. a GemStone Snail 64 may be as different from 
a GemStone Snail 64+ in terms of hardware as can be).

Do you want to look at the card database?
At this time, unless you know the number of your specific video card in the database, its a good idea to say 'y' at this prompt to pick your card from the video card database list.

  0  * Generic VESA compatible                         (null)
  1  * Generic VGA compatible                          (null)
  2  * Unsupported VGA compatible                      (null)
  3  2 the Max MAXColor S3 Trio64V+                    (null)
  4  2-the-Max MAXColor 6000                           ET6000
  5  3DLabs Oxygen GMX                                 PERMEDIA 2
  6  928Movie                                          S3 928
  7  AGX (generic)                                     AGX-014/15/16
  8  ALG-5434(E)                                       CL-GD5434
  9  AOpen PA2010                                      Voodo Banshee
 10  ASUS 3Dexplorer                                   RIVA128
 11  ASUS PCI-AV264CT                                  ati
 12  ASUS PCI-V264CT                                   ati
 13  ASUS Video Magic PCI V864                         (null)
 14  ASUS Video Magic PCI VT64                         (null)
 15  AT25                                              Alliance AT3D
 16  AT3D                                              Alliance AT3D
 17  ATI 3D Pro Turbo                                  ati

Enter a number to choose the corresponding card definition.
Press enter for the next page, q to continue configuration.
A basic listing of the database to choose your card. Just hit <enter> to scroll thru the pages, type in number and then <enter> to choose your specific card.

Your selected card definition:

Identifier: * Generic VGA compatible
Chipset:    (null)
Driver:     vga

Press enter to continue, or ctrl-c to abort.
Basic output after selecting your card. Make sure its correct and press <enter> to continue. If not, press ctrl-c to abort.

* Note: Just to mention that if you do ctrl-c anytime during this install, it will bring you back to a shell prompt, making you start all over. So read and choose carefully, one mistake and you move on, you have to start all over
or after it writes the file, you could hand edit the XF86Config file, but that option can be tedious and confusing for a newcomer to using Linux.


Now you must give information about your video card. This will be used
for the "Device" section of your video card in XF86Config.

You must indicate how much video memory you have. It is probably a good idea
to use the same approximate amount as that detected by the server you intend 
to use. If you encounter problems that are due to the used server not supporting
the amount memory you have (e.g. ATI Mach64 is limited to 1024K with the
SVGA server), specify the maximum amount supported by the server.

How much video memory do you have on your video card:

 1  256K
 2  512K
 3  1024K
 4  2048K
 5  4096K
 6  Other

Enter your choice:
Type the number next to the amount of RAM your video card has. If not on the list, just choose 6 and it will prompt you for a numeric value for your RAM. You won't need to type a k at the end but you do want to put the value in kilobytes, not megabytes, etc. Not sure what the value is, well, 1024 kilobyte = 1 megabyte so hopefully you can do the math and addition from there to insert your value for your card.

You must now enter a few identification/description strings, namely an
identifier, a vendor name, and a model name. Just pressing enter will fill in default
names (possibly from a card definition).

The strings are free-form, spaces are allowed.
Enter an identifier for your video card definition:
This step you've pretty much basically done already after choosing your card. If you selected the correct card, just press <enter> here to move on with the configuration. Otherwise you can put in your own information for you make, model, etc of your particular card.

For each depth, a list of modes (resolutions) is defined. The default
resolution that the server will start-up with will be the first listed
mode that can be supported by the monitor and card.
Currently it is set to:

"640x480" "800x600" "1024x768" "1280x1024" for 8-bit
"640x480" "800x600" "1024x768" "1280x1024" for 16-bit
"640x480" "800x600" "1024x768" "1280x1024" for 24-bit

Modes that cannot be supported due to monitor or clock constraints will
be automatically skipped by the server.

 1  Change the modes for 8-bit (256 colors)
 2  Change the modes for 16-bit (32K/64K colors)
 3  Change the modes for 24-bit (24-bit color)
 4  The modes are OK, continue.

Enter your choice:
This is the step to select your default resolutions for each color depth. In most cases you can just change the resolutions for the depth you will be using. In most cases, most will use 16-bit as their default depth so you would want to choose 2 to change your default resolutions in any particular order.
It will come to a screen and prompt you with a numerical ordered list to choose what order you want. For
instance if I wanted my resolutions to be "1280x1024" "1024x768" "800x600" in that order where "1280x1024" would be the first choice when starting X, I would type in 543 and press <enter> to then it would look like this on that list:

"640x480" "800x600" "1024x768" "1280x1024" for 8-bit
"1280x1024" "1024x768" "800x600" for 16-bit
"640x480" "800x600" "1024x768" "1280x1024" for 24-bit
If I'm going to use 16-bit color depth and those are the modes I am going to use, then I can select option 4 now and move on with the configuration. If I want to change, well, you can select the option to change again.

Please specify which color depth you want to use by default:

1 1 bit (monochrome)
2 4 bits (16 colors)
3 8 bits (256 colors)
4 16 bits (65536 colors)
5 24 bits (16 million colors)

Enter a number to choose the default depth.[/code]Like mentioned above, this is where you will select your
default color depth. Select your color depth and press <enter>.

I am going to write the XF86Config file now. Make sure you don't accidently
overwrite a previously configured one.

Shall I write it to /etc/X11/XF86Config?
Now its time to finish the configuration of X. If all is good
and you have good faith you picked all the right choices, then type 'yes" and press <enter>. This will write
the default file to be read in /etc/X11 directory named XF86Config.

If you don't then the following step will come up with a prompt to place the file as follows:
Please answer the following question with either 'y' or 'n'.
Shall I write it to the default location, /usr/X11R6/etc/X11/XF86Config?
And if you specify no once
again, it will usually ask you to place in either the present working directory or ask for a location.

File has been written. Take a look at it before running 'startx'. Note that
the XF86Config file must be in one of the directories searched by the server
(e.g. /etc/X11) in order to be used. Within the server press
ctrl, alt and '+' simultaneously to cycle video resolutions. Pressing ctrl,
alt and backspace simultaneously immediately exits the server (use if
the monitor doesn't sync for a particular mode).

For further configuration, refer to the XF86Config(5) manual page.
After writing the file, you should get
this info printed to the screen and then back to a shell prompt. From this point, if all is good and
configured, you should be able to logout as root and then type startx to begin using X.

3. Additional Information

On a side note, if you want your system to start up in X upon bootup, you'll need to make the necessary changes
in your /etc/inittab file. In most cases if your booting to a console, you'll be in runlevel 3 and you'll need
to change your default runlevel to 5 to start in X. Usually this will look like this in your inittab file:


Hope this quick howto and or guide helps you in configuring X for your Linux Operating System.

Some related links for XFree86:

XFree86 Main site
Support and Documentation for XFree86
The X Window System in which XFree86 is based from.

by moses on Wed, 2003-07-16 02:20
With XFree86 4.x, "X -configure" will answer most of the questions xf86config poses and build you an file in your home directory.
Generally, I run
X -configure
(as root), edit the resulting ~/ file to my specific needs, and then copy that to /etc/X11/XF86Config.
"The specific needs" seems to, usually, be the biggest problem for most people who haven't done that a million times.
One gotcha is that XFree86 still expects the mouse device to be /dev/mouse, and it is for most people. However, if you set up devfs and followed the recommendations in the Documentation, you probably don't have a /dev/mouse anymore. You'll need to fix that in the XF86Config file. . .

The HOW-TO doesn't (and I don't think it's designed to) answer questions about setting up OpenGL acceleration. That's a topic that might be ready for a HOW-TO. I don't know if I can do a good job, but I'll consider writing something up, maybe this weekend. . .

by trickykid on Wed, 2003-07-16 15:14
Originally posted by moses
The HOW-TO doesn't (and I don't think it's designed to) answer questions about setting up OpenGL acceleration. That's a topic that might be ready for a HOW-TO. I don't know if I can do a good job, but I'll consider writing something up, maybe this weekend. . .
Yah I should have stated in the howto that it would not cover any special instructions to setup any additional drivers or even compiling XFree86 from scratch. This howto was designed to be as basic as possible on a non-specific distribution using xf86config and etc, the basic commands that come with it.

But yah, thanks for the tips regarding the mouse. Yah, in most cases it will link to /dev/mouse but not in all cases. You can actually specify this during the configuration instead of waiting to edit the file afterwards. That's if you know the path to the device.

Thanks for the feedback and response moses.

by moses on Thu, 2003-07-17 02:20
I also screwed up above.
 X -configure
should be:
XFree86 -configure
I still think this may be an easier way for newbies to configure their XF86Config file. . . It doesn't ask any questions that could potentially confuse the user. For example, with xf86config, there are 566 options for video cards, but XFree86 -configure will load modules itself, and it will usually FIND the correct driver. I know that when I used to use xf86config, I'd have to page through several times before I found the correct driver, and if I typed in the wrong number, I'd have to ^c out and start over.
While "my" way isn't perfect, it does nice things like set up dual heads if it discovers two video cards. There are still things missing, like the ability to find the correct mouse if it isn't /dev/mouse, ask about keyboard or languag, but on the whole, it's a pretty nice way of setting up X. . .

by grym on Thu, 2003-07-17 15:05
Nice run thru for a basic setup. However, not all distros use runlevel 5 for X. One notable exception:

# These are the default runlevels in Slackware:
# 0 = halt
# 1 = single user mode
# 2 = unused (but configured the same as runlevel 3)
# 3 = multiuser mode (default Slackware runlevel)
# 4 = X11 with KDM/GDM/XDM (session managers)
# 5 = unused (but configured the same as runlevel 3)
# 6 = reboot

This is from the actual default Slackware inittab file since no matter how many times I post it someone always says "Oh no so and so is right it's 5".
Guess some people are still in the "it can only be done one way" windows type mentality. Other than that I feel it is a good article for newer users.
It would be nice to have some new user comments tho to see if they could follow it easily.

by trickykid on Thu, 2003-07-17 15:26
Yeah, I could have sworn I added that in my howto, must have been thinking it but didn't type it. Thanks for the heads up though.

by arunshivanandan on Sun, 2003-08-03 01:32
When it asks whether you want to look at the card data base,if you just press enter ,what will happen??And what if you dont have your card in the list and no other card in that matches your card's specs??

by grym on Sun, 2003-08-03 07:59
I remember right pressing enter scrolls thru the selections in the card database. You have to enter a number for a driver and press enter to select a specific driver.

by arunshivanandan on Sun, 2003-08-03 22:59
but when it asked me whether i want to look at the card database,i just pressed enter.
the result:it didnt include my card in the new XF86Config,it contained only my monitor
(no cards)and a vga driver!

by JZL240I-U on Tue, 2003-08-05 06:19
I don't want to run my equipment at max specs. My monitor can do 120 vertical refreshes / second but I want only 90. How then do I set up 800 * 600 @ 90 hz when I could do 1200*1078 @120 and have only the max specs from the manufacturer? What I mean is, how do I calculate the (reduced) maximum horizontal and vertical refresh rates? Or is it done in a different way?

by trickykid on Wed, 2003-09-10 17:36
Originally posted by arunshivanandan
but when it asked me whether i want to look at the card database,i just pressed enter.
the result:it didnt include my card in the new XF86Config,it contained only my monitor
(no cards)and a vga driver!
You do have to manually type yes then enter to look at the card database. If your card isn't listed, you'll want to try a generic driver until you can find a suitable driver to use, by either downloading and installing, etc.


All times are GMT -5. The time now is 11:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration