Linux X Configuration
If installing X, install it in "/usr/X11R6/…".
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.
Device "Actix GE32+ 2MB"
Monitor "Generic Monitor"
ViewPort 0 0
Virtual 1280 1024
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:
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.
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: