Previous Page | Next Page

  1. Introduction
  2. About Linux
  3. Installation and getting started
  4. Logging in and out
  5. Basic Linux Commands
  6. Linux Files and File Permissions
  7. Linux Directory Structure
  8. Finding Files
  9. Linux Help
  10. Setting Time
  11. Devices
  12. Tips
  13. Accessing Other Filesystems
  14. Accessing Removable Media
  15. Making and Managing Filesystems
  16. Emergency Filesystems and Procedures
  17. LILO and Runlevels
  18. Init
  19. Environment, Shell Selection, and Startu
  20. Linux Kernel
  21. Package Installation and Printing
  22. Configuration, Logging and CRON
  23. Keys and Terminal Configuration
  24. Sound Configuration
  25. Managing Users
  26. Passwords
  27. Process Control
  28. Configuration and Diagnostic Tools
  29. Overall Configuration
  30. Using PAM
  31. Basic Network Setup
  32. Tools and Terms
  33. Novell and Printing
  34. Inetd Services
  35. Xinetd Services
  36. Other Network Services
  37. FTP and Telnet
  38. Samba
  39. Identd (auth)
  40. X Configuration
  41. X Use
  42. Using X Remotely
  43. X Documentation
  44. DNS
  45. DHCP and BOOTP
  46. Apache
  47. NFS
  48. PPP
  49. Mail
  50. Routing
  51. IP Masquerading
  52. Proxy Servers and ipchains
  53. UUCP
  54. News
  55. NIS
  56. Network Security
  57. Secure Shell
  58. Text Processing
  59. Shell Programming
  60. Emacs
  61. VI
  62. Recommended Reading
  63. Credits

Linux X Configuration


If installing X, install it in "/usr/X11R6/…".

Configuration Files


This file has the following sections. They are Files, ServerFlags, Keyboard, Pointer, Monitor, Device (may be more than 1), and Screen (may be more than 1).

Files, Keyboard and Pointer Sections:
The files section sets up the paths for X to use for files that specify screen colors and fonts. If the directory specified here doesn't exist or is empty XFree86 will crash or generate error messages. The "Keyboard" section specifies the keyboard protocol, usually standard, and key repeat rates. The "Pointer" section includes a Protocol and Device line. The device is the mouse device such as /dev/mouse (This may be a softlink to another device). The Protocol is one of BusMouse, Logitech, Microsoft, MMSeries, Mouseman, Mousesystems, PS/2, or MMHitTab.
The monitor section:
In the monitor section the Identifier can be any unique identifier string to identify that particular monitor. The VendorName and ModelName are for reference. The HorizSync is in Khz and may be one number, multiple numbers separated by commas, or a range. Ex: 30-54. Ex 31.5, 35.2. VertRefresh is in Hz and can be specified similar to HorizSync. VertRefreah and HorizSync specify valid rates for your monitor. An example "Modeline is shown below:

Modeline "1024X768" 65.00 1024 1032 1176 1344 768 771 777 806 –hsync –vsync

The name is "1024X768", an arbitrary string used to refer to the modeline in the screen section.
The dot-clock is 65.00 which is the video card's driving clock frequency in MHz for that resolution mode. It is the rate that the video card should send pixels to the monitor for that screen mode.
The next four numbers 1024, 1032, 1176, and 1344 are the horizontal values and the last four are the vertical values. These values specify when the monitor should fire it's electron gun and when the horizontal and vertical sync pulses occur.
Read the file /usr/X11R6/lib/X11/doc/VideoModes.doc. It explains how to configure this section. Also, the file, Monitors shows examples of modelines for specific monitors.

The device section:
This section describes video cards. The Identifier, VendorName, BoardName and optional Chipset are strings and are only used for identification. The VideoRam specifies the amount of video memory in Kb. The data in Clocks should come from the video board manual. The file Devices in the documentation section should help with device setup. If your video card is found in the Devices file, that section may be copied into the XF86Config file. Note: Sometimes the card may use a programmable clock chip, in which case there may be a line specifying "ClockChip" rather than "Clocks". Some cards may specify a "Ramdac" line. Some video cards also require other special options using an "Option" line. these options are described in the README file for the particular chipset.
The screen section:
The section, "screen" is where you can specify what XFree86 server runs with your X server.
Section "Screen:
     Driver     "accle"
     Device    "Actix GE32+ 2MB"
     Monitor  "Generic Monitor"
     SubSection  "Display"
          Depth      8
          Modes     "640x480"
          ViewPort 0 0
          Virtual  1280 1024
      SubSection "Display"
           Depth     16
           Weight    565
           Modes "640x480"
           ViewPort 0 0
           Virtual   1024 768

The values for driver can be Accel, SVGA, VGA16, VGA2, or Mono. Accel supports XF86_S3, XF86_Mach32, XF86_Mach8, XF86_8514, XF86_P9000, XF86_AGX, and XF86_W32 servers. SVGA supports the XF86_SVGA server. The driver specifies the X server to use.

Depth sets the number of pits per pixel. Modes displays a list of the video mode names defined in the ModeLine option in the Monitor section. The virtual option specifies the virtual desktop size. Use this if you have enough RAM on the video card but a monitor that won't support the greater resolution. ViewPort defines the coordinates of the upper left corner of the virtual desktop when XFree86 starts. In the Screen section, the driver name indicates the type of X server you are running. The X server is the program that runs with your monitor, mouse, and keyboard, regardless of the platform or location. It could be running on the same machine, or on another machine on a network or on a serial port. For example if I am running a svga server program(XF86_SVGA), the screen section that will apply would be the one labeled as follows in the screen section:

Driver    "svga"

I believe the X server program that runs is determined by the "xserverrc" file either in the user's home directory or in the directory "/usr/X11/xinit/". I do not believe this is used anymore since the Xwrapper program is set up to be the X server program on current systems. If it is used, it is used to pass parameters to the Xwrapper program. On my system the X server falls through to the default "X" file which is a link to the Xwrapper program. See the "How Linux Works CTDP Guide" for more information.
You can use Ctrl-Alt-+ to change the resolution. X starts with the poorest one you select (by default), you can change that manually by editing /etc/X11/XF86Config.

Configuration tools:

Programs to configure X are:

  • XF86Setup - A newer X configuration program with a GUI interface which modifies the "/etc/X11/XF86Config" configuration file.
  • xf86config - An older X configuration program with a text based interface. It also modifies the "/etc/X11/XF86Config" configuration file.
  • Xconfigurator - The Redhat tool used during system setup to configure X.
  • xvidtune - This program will test video modes on the fly without modification to your X configuration. Read the usr/X11R6/lib/X11/doc/VideoModes.doc file before running this program.
  • SuperProbe - A program that probes the video card to determine its type for use with setting up X. xvidtune - This program will test video modes on the fly without modification to your X configuration.

The programs reside in "/usr/X11R6/bin" and "/usr/bin/X11". The programs XF86Setup, xf86config, and Xconfigurator modify the "/etc/X11/XF86Config" configuration file. XF86Setup is the newer configuration program with a GUI interface and xf86config is older with a text based interface. I advise users to use XF86Setup when possible, but use xf86config when they have problems with XF86Setup. To get it configured, you must provide information about your keyboard, mouse, video card and monitor. You must also select a screen resolution mode. Usually if you can't find a configuration for your video card you can select a generic driver such as SVGA. Later to improve performance, you may want to make manual modifications to your configuration with settings that more closely match your video card. The main information about your video monitor includes the maximum vertical and horizontal scan rates. You will want to refer to your monitor's manual for this information. If you have problems with X and it won't work, one thing to try is reducing your video mode from a higher to lower resolution. Ex: Change from 1200X1024 to 800X600. Usually if you can't use higher resolution it is due to monitor scan frequencies. Your video card memory determines a combination of your maximum resolution and maximum colors. For example 1200X1024 with 65535 colors requires 1200 times 1024 times 2 bytes of video memory which is 2.4576 M of video memory. Your video card needs 4M to run this mode.

A handy program for determining your video card type and video RAM is "SuperProbe". This program could crash your system, but should do no harm, other than having to reboot and clean the system. It is recommended that you backup your files prior to running this program, however.
The program xvidtune will let you test video modes on the fly without modification to your X configuration. Read the /usr/X11R6/lib/X11/doc/VideoModes.doc file before running this program.
The instructions for configuring X are spread out over several text files. Check the README, VideoModes.doc, README.Config, and README.Linux. Read the man pages for Xconfig, XF86Config, XFree86, and Xfree86kbd. Many documentation files for various packages are in "/usr/doc". Many of these files are too in depth for the average user and describe many X Consortium standards.

Running in terminal mode in run level 5:

You can set the runlevel in the "/etc/inittab" program to run in runlevel 5, which means you will have the X font server running. This way you can provide remote services in X to other machines. If you want to boot into terminal mode, however, you must modify the file "/etc/X11/xdm/Xservers". Comment out the line that shows:

:0 local /usr/X11R6/bin/X

To provide X services to a remote boot machine according to the Linux Terminal Server Project (LTSP):
Modify the file /etc/rc.d/init.d/xfs. Modify two lines around 22 and 41:

Redhat 6.0
Change the lines that start with <daemon –check xfs su xfs –c \"xfs –port –1\" –s /bin/sh> to <daemon –check xfs su xfs –c \"xfs –port 7100\" –s /bin/sh>
Redhat 6.1
Change the lines that start with "daemon xfs –droppriv –daemon –port –1" to "daemon xfs –droppriv –daemon –port 7100
Change the file /etc/X11/XF86Config:
Change the line <FontPath "unix/:-1"> to <FontPath "tcp/localhost:7100">
Change the file /etc/X11/xdm/Xaccess at line 40
# *                            #any host can get a login window
Remove the first # to enable remote workstation access.

Configuring the Xresources file

In the script file xinitrc explained in the section on "How X works" in the "How Linux Works" manual is a line like:


There is also a line like:


These resource files are made available to the system with lines like:

	xrdb -merge $sysresources
	xrdb -merge $userresources

This section briefly explains the format of the Xresources file. Each X application belongs to an application class. Applications use resources such as background, foreground, font, and geometry. The X programs may have their own resources. The manual page for X programs specify which resources they use. Resources are also arranged into classes. A resource line in the Xresources file is in the form:

(ApplicationClass or ApplicationName)*(ResourceClass or ResourceName) : value

The xterm program belongs to the XTerm class.
A sample Xresources file follows:

	! Defaults
	XTerm*Foreground:	white
	Xterm*Background:	blue
	Clock*Geometry:	80x80+10+10
	! Specifics
	xterm-1*background:	black