Configuring the X Window System
Configuring your X Window System is the next step after installing it. The configuration process has a reputation for being quite difficult and complicated. A while ago it would have taken you quite a bit of reading and trial and error to get X up and running. But this is no longer the case; the XFree86 team developed two programs that aid the configuration of X. The first is a text-based configuration tool called xf86config; the second is a graphically-based tool called XF86Setup. Both tools do the job pretty well, but the ultimate configuration tool has been developed by the SuSE teamSaX.
SaX is a graphical configuration tool that is very user-friendly and intelligent at the same time. SaX attempts to detect most of your configuration for you, narrowing down your role to mere supervision rather than total configuration. We will explain how to configure X using all three tools, so you can then choose the one with which you are most comfortable.
SaX
SaX is an intelligent piece of software. It will try to minimize the time it takes to configure X using other X configuration programs. It has a large database containing information about most of the graphic cards currently available on the market. It also has a large database of monitors, which makes it easy for a novice user to select a monitor type without having to know detailed information about his monitor.
You can run SaX in two ways. The first way to launch SaX is by typing SaX on the command line. The second way is by using YaST to configure your X server. If you try to start SaX while you are in normal user mode, it will ask for the root password. Enter the root password and SaX will start.
To start SaX using YaST, choose System Administration, Configure XFree86. In the confirmation dialog, select SaX.
When SaX starts, it will try to probe your system for your correct display card. If it fails to detect it, it will try to use the VGA mode to start in 16-color mode. If SaX fails to start because of an incorrect VGA card detection, you might have to start it using a special parameter, -s. Using the -s parameter, you specify to SaX which X server to use. An X server is a convention used to describe your display driver on the SuSE Linux operating system. If SaX doesn't start because it fails to find your graphic card, try using the following command to start it. This command specifies that SaX should start in VGA 16-color mode, which should run on all graphic boards:
bash#sax -s /usr/X11/bin/XF86_VGA16
Mouse Configuration Using SaX The first dialog that appears after you start SaX is the mouse configuration dialog. The mouse configuration dialog is pretty self-explanatory (see Figure 3.1). You only have to enter the advanced tabs in specific cases in which you want to modify certain settings that apply to your mouse. The following steps will configure your mouse.
FIGURE 3.1 When SaX first starts, it needs to know some information about your mouse. This will help you use your mouse throughout the SaX configuration process.
The first mouse configuration dialog in SaX helps you configure your mouse to be used within SaX. You still need to perform the same mouse configuration again for the X server. To do so, follow these steps:
- Select your mouse type from the protocol box. From the Device group, select the mouse device. If you have configured your mouse using YaST before, the mouse device should be /dev/mouse.
Click Apply to test the mouse setting you configured. If the mouse works fine, click OK.
If the mouse does not work after you have clicked Apply, use the Tab key to select the combo box. After it is selected, use the up and down arrows to change the settings in the combo box to your correct mouse settings. Click Apply and try again. If the mouse works, click OK to move on to the next step.
Now that you have prepared your mouse to be used with SaX, you must configure your mouse to be used within the X server (see Figure 3.2). Select your mouse vendor from the Vendor list and select your mouse type from the Name list. You also should select the mouse port that SaX shows in DOS style ports, such as COM1, COM2, and so forth. The last step is choosing the number of buttons your mouse has. If your mouse has three buttons, check the 3 Buttons radio button in the Buttons group.
FIGURE 3.2 SaX provides an easy-to-use mouse configuration dialog. Remember to test your settings by clicking Apply before clicking the Next button. You still can use the keyboard if anything goes wrong while configuring the mouse.
Note
Your mouse may have only two buttons. However, because the X Window System uses the third mouse button for many operations, primarily the paste operation, you should activate the third button emulation. To do so, click Expert, select the Options tab, and check the Emulate 3 Buttons checkbox. This enables you to generate a third button click by clicking both the right and left mouse buttons at the same time.
When you finish filling in the information about your mouse, the Next button will be activated, enabling you to move on to the next step in configuring your X Window System. Click Next to continue.
Keyboard Configuration Using SaX The next step in the SaX configuration process is to configure your keyboard (see Figure 3.3). SaX does not detect your keyboard automatically, so you will have to do it yourself. SaX starts off by preselecting a standard keyboard in the Model list. If you have a different keyboard model, scroll through the list to select your keyboard. After you have selected the model, you can select the keyboard language by highlighting the language you prefer from the Language list.
If you're happy with your settings, click Apply and test your keyboard by typing anything in the line edit field. If your keyboard works fine, move on to the next step by clicking Next. If the keyboard settings do not match your expectations, try other configurations of the model and language.
FIGURE 3.3 You can select your keyboard model and language from the keyboard configuration tab within SaX. Click Apply and test the settings in the test field before you move on to the next step.
Card Configuration Using SaX After you have configured your keyboard, you should configure your display card. SaX will show you two lists, the Vendor list and Name list (see Figure 3.4). SaX uses the following three methods to configure the card:
-
AutodetectionIn this method, SaX will try to figure out the card and its settings.
-
Per card settingIn this method, you must find your card in the list by selecting the vendor name from the Vendor list and then selecting the card name from the Name list.
-
By X serverIn this method, you select the X server you want SaX to use by selecting Generic from the Vendor list and the X server you want from the Name list.
FIGURE 3.4 SaX provides the easiest way to configure your display card through the autodetection option.
In all cases, you can still enhance the performance of your display by clicking the Expert button and applying advanced changes to the settings made by SaX. Note that you should have sufficient knowledge of the capabilities of your display card and the X Window System before you attempt to do so.
Note
If SaX fails to detect your display card memory, you should click the Expert button and change it manually from the Server-Settings tab. In some graphic cards, you might have to turn on the software cursor if the cursor shape is missing while using X. To enable the software cursor, click the Expert button and open the Options tab. Select the sw_cursor option and click the Run test button to ensure that it works on your system (see Figure 3.5). Note that you should use this option only if the shape of your mouse cursor is not correct in X.
FIGURE 3.5 By selecting the sw_cursor option, you force the X Window System to draw the cursor using software options, thus overriding any hardware bugs.
Monitor Configuration Using SaX You can select your monitor from a wide database of monitor vendors and models. If you do not know the monitor model or vendor, you can select your monitor from a VESA list in which you must supply your monitor information (see Figure 3.6).
CAUTION
Unless you know what you're doing, do not try to change the settings in the Expert mode of the monitor settings. You might harm your monitor if you enter an incorrect value.
FIGURE 3.6 If you do not know the monitor model or your monitor is not listed, you can choose the resolution your monitor supports at the correct refresh rates from the VESA list.
Desktop Configuration Using SaX Using the Desktop configuration tab, you can set up the X Window System resolutions you will be using. If you are going to use only one resolution, you can configure your desktop by following these steps:
Select the color depth you want to use from the Colors combo box (see Figure 3.7).
Select the resolution you want to use from the Resolution combo box.
Click Configure this mode to start the SaX resolution configuration program.
FIGURE 3.7 You can quickly set up the color depth and resolution you want to use in your X sessions from the Desktop tab in SaX.
Alternatively, if you want to use more than one resolution when using the X Window System, you must configure it using the Expert mode. Click the Expert button to open the Expert mode dialog and perform the following steps (see Figure 3.8).
-
Select the color depth you want to use.
-
Click the l>> button to add any resolutions you want to be able to use. Remember, your monitor should be capable of using the resolutions you select.
-
Click the up and down arrows to manage the arrangement of the resolutions. X will start off with the first one in the list.
-
Click OK when you're satisfied with your settings. In the main window, click Next to start configuring the resolutions you have selected.
FIGURE 3.8 While using the X Window System, you can use the Ctrl+Alt and the + or - (on the numeric keypad) combinations to change the screen resolution, but only if you set up more than one resolution when you configured X.
Resolution Configuration Using SaX While configuring the resolution mode, you have the ability justify your desktop to your optimal setting without having to worry about making any screen adjustments. Use the arrow buttons to put the screen in place. Note that the screen edges are marked with blocks, except the upper-left corner, which contains the screen title. These blocks ensure that you can see the whole screen width and height. Make sure that the three blocks and screen title are visible. Use the stretch buttons to stretch your screen, and when you're satisfied with your screen position, save your settings. If you have chosen to use more than one resolution, click the Configure next mode button until you have configured all the resolutions you selected. After you have completed this whole process, click Save and Exit to save your X configuration file.
Note
If your screen does not show anything or goes black, you should use the Ctrl+Alt+Backspace key combination to stop the X server from being tested. After the test stops, you return to SaX. Fix any configuration problems and then test your configuration again. The problem could be one of the following:
-
Resolution is not supported by monitor.
- Color depth is not supported by monitor.
In addition, any card setting problems will cause the test to exit to SaX automatically.
XF86Setup
The X Window System comes equipped with a powerful tool that helps you configure the X Window System without having to perform configuration file editing. You can start the XF86Setup from the command line while running as root or from YaST. To start XF86Setup from bash, enter the following command:
bash#XF86Setup
Or, to start XF86Setup using YaST, choose System Administration, Configure XFree86. In the confirmation dialog, select XF86Setup.
When XF86Setup starts, it brings up a welcome message from the XFree86 group (see Figure 3.9).
FIGURE 3.9 The XF86Setup program that comes with the X Window System enables you to configure your X. While it does not perform any detection of your card, other utilities that come with X do that for you.
Mouse Configuration Using XF86Setup Although you can access all the tabs in the XF86Setup program in any order, we will discuss the tabs starting from left to right. The first tab on the left is the Mouse tab, which you can access by pressing Alt+M on the keyboard or by clicking the Mouse tab. The Mouse tab is shown in Figure 3.10.
FIGURE 3.10 Using XF86Setup, you easily can select your mouse from a wide variety of mice supported by X.
You can change the settings for your mouse by selecting the mouse protocol and mouse button number. If your mouse has only two buttons, you should click the Emulate three buttons button or press e. If your mouse does not work, you can use the arrow keys to move between mouse protocols to select the one that applies to your mouse. After you have selected a correct mouse protocol, press a on the keyboard to apply the settings. Or, you can click the Apply button if your mouse is functioning.
After you have ensured your mouse is functioning properly, click the Keyboard tab and move to the next section to learn how to configure your keyboard.
Keyboard Configuration Using XF86Setup Keyboard configuration using XF86Setup is as easy as selecting the configuration of two combo boxes. Select the keyboard model from the Model combo box and the keyboard language from the Layout (language) combo box (see Figure 3.11). Click Apply to apply your settings. Most people do not need to set up the advanced functions on the right side of the screen because these are used to map keys for special keyboards.
FIGURE 3.11 Keyboard configuration using XF86Setup.
Card Configuration Using XF86Setup Display card configuration using XF86Setup can be performed in the following two ways:
-
Detailed SetupBefore using the detailed setup in Figure 3.12, you should have some knowledge of the X Window System servers. You should select the X server for your display card using the buttons at the top of the screen. You also should configure the appropriate settings for your X server. You can specify options for the X server using the Options combo box, which enables multiple selections. You can click the Card List button to select your card from a large list of cards, which takes less time than guessing which settings apply to your display card.
-
Card ListIn the Card List mode, all you have to do is to search for your display card in the card list (see Figure 3.13). After you have selected your card, you can move on to the next step or you can press the Detailed Setup button to add options to the settings that were applied when you selected the card.
Note
We recommend you specify the memory manually rather than making the X server probe for it. Use the Detailed Setup to specify the memory on your graphic card. In some graphic cards, you might have to turn on the software cursor if the cursor shape is missing while using X. To enable the software cursor, click the Options combo box and select sw_cursor. You should use this option only if the shape of your mouse cursor is not correct in X.
FIGURE 3.12 Configuring a graphic card using Detailed Setup enables you to set up options for your graphic card.
FIGURE 3.13 Using the Card List mode, you can select your card from the card list without having to perform any manual configuration.
Monitor Configuration Using XF86Setup You must configure the X Window System to properly use your monitor using the Monitor tab, which contains a list of preconfigured settings that apply to a large number of monitors (see Figure 3.14). We advise you to have your monitor handbook nearby to check the refresh rate your monitor supports so you can be sure to choose the correct monitor configuration. You can modify the settings by editing the Horizontal and Vertical Sync fields to fit your monitor. However, this can be dangerousdo not enter incorrect values because they can harm your monitor. Make sure that the values you enter are the correct values you got from the monitor handbook.
Mode Configuration Using XF86Setup Mode configuration is important when it comes to configuring the color depths and resolutions you want to use during an X session. In the Modeselection tab, you will find a list of the color depths and modes you can select (see Figure 3.15). Select the color depths you want to use by clicking the color depth button and then choose the modes you want to use by clicking them.
FIGURE 3.14 Monitor configuration in XF86Setup enables you to choose the correct refresh rate for your monitor.
FIGURE 3.15 You can choose the resolution modes and color depths you want to use in X using the Modeselection tab.
Other Configurations Using XF86Setup XF86Setup enables you to configure advanced options you want the X server to use. As shown in Figure 3.16, the settings are as follows:
-
Allow server to be killed with hotkey sequence (Ctrl-Alt-Backspace)If you check this option, you will be able to close the X server using this combination. It is a good idea to turn on this option.
-
Allow video mode switchingThis option enables you to use the Alt+Ctrl+(+) and Alt+Ctrl+(-) key combinations to switch between video modes.
-
Don't Trap SignalsUncheck this option if it is checked.
-
Allow video mode changes from other hostsUncheck this option if it is checked.
-
Allow changes to keyboard and mouse settings from other hostsUncheck this option if it is checked.
FIGURE 3.16 On the Other tab, you can set up server- specific operations.
Mode Tuning Using xvidtune Now that you have completed all the steps of configuring XF86Setup, you should put it into practice. Click the Done button to apply the changes. Then, when XF86Setup asks for confirmation, click the Okay button to configure the position of your screen on each of the resolutions you have selected using the xvidtune program.
Note
If your screen does not show anything or goes black, you should use the Ctrl+Alt+Backspace combination to stop the X server. After you have killed the X server, restart the XF86Setup and go through the whole configuration again. This time, try to select different monitor configurations.
xf86config
The last tool you can use to configure your X Window System is xf86config. This tool is text-based and pretty old, but it is very good at configuring X. Very seldom will this tool fail in configuring X; even if all the others fail, you can still count on this one to succeed. That is, of course, provided your card is supported by X; if it isn't, nothing can help you.
To configure X using xf86config, follow these steps:
-
Log in as root.
-
Run xf86config by typing the following on the command line:
#xf86config
-
The screen scrolls with introductory text about xf86config. When you finish reading that introduction, press Enter to continue and start the actual configuration process. If you want to quit at any point in the program, just press Ctrl+C.
-
The program will warn you that you have a directory called /usr/X386/bin, which means you have an older version of X installed. Don't worry about this warningyou do not have an old version of X, this directory exists only for compatibility reasons. Press Enter to continue.
-
The first menu you see is the mouse type menu, which enables you to choose the type of your mouse. If you have a two-button mouse, you should select the first option, Microsoft-compatible (2-button protocol). Enter the number that corresponds to your mouse or one that is compatible with it and press Enter.
-
The program asks you whether you want to enable ChordMiddle. If your mouse is a three-button mouse, you should answer yes here to enable the third mouse button. Otherwise, answer no. Enter y for yes or n for no and press Enter to continue.
-
The next question asks you whether you want to enable Emulate3Buttons. If your mouse does not have three buttons, you can emulate a third button by pressing the two mouse buttons simultaneously. To enable this, answer yes to this option. Enter y for yes or n for no and press Enter to continue.
-
Now, the program asks you about the mouse device, which is the device file for the mouse under /dev/. This should be /dev/mouse, which is the default answer to this question. Press Enter to accept this default and continue.
-
Next is the keyboard type configuration. The program asks you whether you want to use XKB. XKeyboard is a new extension that was added to X to manage the keyboard layout. It is highly recommended that you use XKB, so answer yes here. Enter y for yes or n for no and press Enter to continue.
-
An introductory message will be displayed. It tells you that you will now be presented with a list of preconfigured keyboard layouts. Press Enter to continue.
-
The program will give you a list of keyboards you can use. Find the keyboard that matches yours and enter its number. You probably will choose the second one because it's the standard these days. Enter the number of the keyboard that matches yours and press Enter to continue.
-
The next section concerns your monitor. The program shows you some introductory text on the subject. Press Enter to continue.
-
You will be shown a list of monitor settings supported by XFree86. Before you attempt to select any of these, you should try to find the technical specifications of your monitor in its manual. Then, select the one closest to yours. The sixth setting works with most monitors because it uses conservative settings. If you cannot find your manual, you might want to choose this setting. If you know the exact numbers for your monitor, you can enter them by choosing the eleventh choice.
-
If you have chosen any setting other than the eleventh, skip this step. The eleventh option is where you enter your monitor's settings manually. The program will ask you for the Horizontal Sync range. Enter it as written in your manual. Press Enter to continue.
-
The program will now ask you for the Vertical sync range of your monitor. You should get this information from your monitor's manual. If you can't find the manual, you should select a conservative choicethe third one works for most monitors. If you know the exact numbers for your monitor, choose the fifth option to enter them manually.
-
If you have picked any setting other than the fifth, skip this step. The program will now ask you to enter your monitor's Vertical Sync range. Enter it as written in your manual and press Enter to continue.
-
The program asks you to enter some descriptive names for your monitor. These will not affect your configuration in any way at all. They will be used only in the configuration file to name the sections properly. These strings are as follows, in the order in which they are requested by the program: Identifier of the monitor, vendor name of the monitor, and model name of the monitor. You can press Enter for every one of them to accept the defaults.
-
The program now enters the video card configuration section, in which you will choose your video card. The program displays some introductory text; at the bottom of the text it asks you whether you want to look at the card database, you should answer yes to this. Enter y for yes and press Enter to continue.
-
The program will give you a list of all the cards supported by the current version of XFree86. To scroll through the list, press Enter. After you find your card, enter its number in the list and press Enter to continue.
-
The program will display the option you selected to confirm it. Press Enter to continue and accept it.
-
The program now will ask you to choose a server to use for this card. You have five options: the XF86_Mono, which is a monochrome server; the XF86_VGA16, which supports only 16 colors; the XF86_SVGA, which supports 256 colors but is accelerated on some cards and can support high colors; the accelerated servers; and choosing the server from your cards definition. The fifth option is recommended because it selects the server based on which card you selected in the previous step. Type 5 and press Enter to continue.
-
The program now will ask you whether it should create a symbolic link to the X server. Answer yes by typing y and pressing Enter.
-
The program then asks whether you want that symbolic link to be created in /var/X11R6/bin. Answer yes by typing y and pressing Enter.
-
The program needs to know how much memory is on your cards. You are given a list from which to choose. If your card has more than 4MB of memory, select choice number six to enter the amount of RAM manually. The value should be in KB, so if your card has 8MB, you would enter 8192, which is 8x1024K.
-
The program asks you to enter some descriptive names for your video card. These will not affect your configuration in any way at all. They will be used only in the configuration file to name the sections properly. These strings are as follows, in the order in which they are requested by the program: Identifier of the video card, vendor name of the video card, and model name of the video card. You can press Enter for every one of them to accept the defaults.
-
The program then asks you enter your Clockchip setting. This enables XFree86 to program your card's clock. Most cards do not support this, but if yours does, you should select it from the list. Otherwise, press Enter to disable Clockchip.
-
Next, the program asks whether it should attempt to probe your card's clock settings. The program asks "Do you want me to run 'X -probeonly' now?" The answer to this question lies in the line that appears onscreen above this question. In most cases, this line is "The card definition says to NOT probe clocks." If this is the case, you should answer no; otherwise, answer yes. Enter y for yes or n for no and press Enter to continue.
-
Now, it's time to set the resolutions you want to use. The program enables you to configure the resolutions you want to use per color depth. You can change the resolutions for 256 color mode, 32k/64k color mode, 24 bit color and packed pixel mode, and 24 bit color mode. The program will show you the current settings for each color mode at the top of the screenfor example, "640x480" "800x600" "1024x768" for 8bpp. This line means that the X server, when run in 8bpp (256 colors) mode, will start off in 640x480. Pressing Ctrl+Alt+PlusKey(+) will switch the resolution to 800x600 and then to 1024x768. If you like the current settings, choose the fifth option and then press Enter.
-
If you picked the fifth option in the previous step, skip this step. Choosing any other option but the fifth one means you want to manually configure this color mode. The program will display a list of all the resolutions it can support. Enter the numbers of all the resolutions you want to use for this color mode. For example, entering 42 means the X server will start with 1024x768 initially, and when you press Ctrl+Alt+PlusKey(+), it will switch to 800x600. The program then asks whether you want to set a virtual screen that is larger than your desktop. Press y for yes or n for no and press Enter to continue.
-
Finally, the program asks whether you want to save your configuration. Press y for yes or n for no and press Enter to continue.
-
That's it. You are finished configuring your XFree86.
You can now test your configuration by running X:
$ startx
If you configured your X properly, it should start without any problems.