Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Linux Magazine: The source for advanced Linux know-how

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents
Up to --> Linux Tutorial

· The X Windowing System
· Configuring the X-Windows Server
· The Basics of X
· Resources
· Colors
· Displaying Clients
· Fonts
· The Window Manager
· Remote Access

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 71 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

Linux Tutorial - The X Windowing System - Configuring the X-Windows Server
  The X Windowing System ---- The Basics of X  

Configuring the X-Windows Server

On all current distributions (as far as I can tell), you will be getting a copy of the Xfree86 X-Windows system. Although this is almost completely compatible with commercial versions, this one is free like other products under the GNU public license.

Although you can get away with 4Mb of physical RAM and an additional 12Mb of swap space, you won't be happy. With this minimal configuration, you will probably get X started and a couple of windows open and then you will want to start swapping. Experience has taught me that without at least 16Mb of physical RAM, the system is too slow to be enjoyable to work in. Considering how low RAM prices have dropped, there really isn't any excuse any more to purchase more RAM.

When you install your copy of Linux, you will (should) be asked a series of questions about your video system to configure your X server. Even if you don't know what video chipset you use or the video card manufacturer, you can get away with using the standard SVGA card. However, the performance and appearance will dramatically improve if you are able to specify exactly what you have.

Even if there isn't an exact match, you can try something close and still get decent performance. If it is an exact match, I would recommend using a low resolution, like 640x480, to test the configuration. Once you are sure that everything works correctly, you can move to higher resolutions.

Once X-Windows is running, you can use the configuration program xf86config, which will again ask you a series of questions about your configuration. Here you really ought to know about the hardware, including your monitor. What hardware X-Windows supports is listed in the latest Xfree86 HOWTO, which you should find on your CD-ROM.

When you install your X server, note that you are not running just a single program. Instead, quite a few different programs are running. Which one runs depends on the options you specified during the configuration. Because most only run on a single video card or chipset, you definitely need to know about your hardware.

Keep in mind that just because you can run the Linux command line does not mean that Linux supports your video card. The command line is run in text mode, which uses well-known standard video modes to access the video card. However, once the X server is running, you are accessing the video card directly and need to know all the details.

Also available are several commercial X servers such as Accelerated-X and Metro-X, which provide better performance than the default X servers Xfree86 provides.

The primary configuration file for your X server is (normally) /etc/XF86Config or /etc/X11/XF86Config. This is a text file, which is generated new every time you run xf86config. This is broken down into three sections. The Screen section is the primary section and often comes last. It defines what you see on the screen based on the other two sections. The Device section describes your video card (which is often referred to as a video device). The Monitor section describes, as you might expect, your monitor.

Each section has a header line that defines what section it is and an EndSection line to close it up. The general form is

Section "SectionName" section info EndSection

Because the X server decides what to show on the screen based on the Screen section, that is probably a good place for me to start. Within the Screen section, the server can give you several subsections for each of the "Display" types. The subsections are the logical configurations of your monitor and determine such things as the number of colors that can be displayed, the resolution, and whether there is a "logical" screen.

The Screen section on one of my machines looks like this:

Section "Screen" Driver "accel" Device "SPEA Mercury 64" Monitor "Sony17sf" Subsection "Display" Depth 8 Modes "800x600" "1024x768" ViewPort 0 0 Virtual 800 600 EndSubsection Subsection "Display" Depth 16 Modes "800x600" "1024x768" ViewPort 0 0 Virtual 1024 768 EndSubsection Subsection "Display" Depth 32 Modes "800x600" ViewPort 0 0 Virtual 800 600 EndSubsection EndSection

The Driver line indicates which X server will be used. In this case, I am using the "accel" driver for "accelerated" servers, which basically means that they have faster performance than other cards. The other kinds of drivers are vga2 (for vga cards in 2-color mode), vga16 (16-color vga), and svga (super-VGA, 256 color, 640x480).

The Device line indicates the name of the video card. Because that's the card I have, this line is set to "SPEA Mercury 64." The monitor indicates the monitor type. Note that in my case there was a specific entry for the SPEA Mercury card. However, there was no specific entry for my monitor, though one was close. The system uses this information to choose the best driver for you. However, you can still choose another driver.

As I mentioned previously, the Display subsection determines what is displayed on your screen. In this case, we have three different Display subsections, which are distinguished by the Depth line, which defines the color depth, or number of colors, that can be displayed. This indicates the number of bytes that are used to describe the colors. Therefore, in the first entry, we have 8 bits, or a total of 256 possible colors.

The Modes line defines the possible resolutions that your monitor can support. Normally, the lower the depth, the more modes the server can handle. In my case, the system did not configure this. Each of the modes has an entry for 640x480. Because I never wanted my server coming up in that mode, I was able to remove the modes. (Note that this is one option in the xf86config program.)

When it starts up, the X server will take the first entry it finds. In my case, this is 800x600 and 256 colors. However, you can use options to startx, which then passes the first entry on to xinit. If I wanted to increase the color depth to 24 bits, I could start the server like this:

startx -- -bpp 24

The Device section describes the characteristics of your video card. On my machine, it looks like this:

Section "Device" Identifier "SPEA Mercury 64" VendorName "Unknown" BoardName "Unknown" VideoRam 2048 EndSection

The Identifier entry is used in other sections to match displays with Devices. Although the VendorName in this case is SPEA and the BoardName is Mercury 64, it does not matter that these two fields are empty.

Last, we get to the Monitor section. An except from the monitor section on my system follows (with a lot of things removed to save spaces). Note that you could have multiple Monitor sections if you were going to connect different monitors.

Section "Monitor" Identifier "Sony17sf" VendorName "Sony" ModelName "17sfII" HorizSync 31.5 - 57.0 VertRefresh 50-70 # 640x400 @ 70 Hz, 31.5 kHz hsync Modeline "640x400" 25.175 640 664 760 800 400 409 411 450 # 640x480 @60 Hz, 31.5 kHz hsync Modeline "640x480" 25.175 640 664 760 800 480 491 493 525 # 800x600 @ 56 Hz, 35.15 kHz hsync ModeLine "800x600" 36 800 824 896 1024 600 601 603 625 # 1024x768 @ 87 Hz interlaced, 35.5 kHz hsync Modeline "1024x768" 44.9 1024 1048 1208 1264 768 776 784 817

Like the Devices section, the Identifier is used to match monitors and displays. Here the physical characteristics of the monitor are described, including the vertical refresh rate (how many times per second the screen can be redrawn) and the horizontal synchronization (which is based on the resolution and vertical refresh rate).

The most important part of the Monitor section are the modeline entries. If you have a common video card and monitor, you don't have to worry about this because the xf86config utility will create them for you. If you do need to create them, you should check the latest Xfree86 HOWTO.

 Previous Page
The X Windowing System
  Back to Top
Table of Contents
Next Page 
The Basics of X


Test Your Knowledge

User Comments:

You can only add comments if you are logged in.

Copyright 2002-2009 by James Mohr. Licensed under modified GNU Free Documentation License (Portions of this material originally published by Prentice Hall, Pearson Education, Inc). See here for details. All rights reserved.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial can use your help.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.10 Seconds