Certification Objective 6.01: X Server

 < Day Day Up > 



The X Window System is designed as a flexible and powerful client/server-based system. In order to configure and troubleshoot the X Window interface, it is important you understand the client/server nature of the X Window System.

start sidebar
Inside The Exam

The Linux Graphical User Interface

The Red Hat exams test your ability to configure the X Window, presumably for non-administrative users. As stated in the Red Hat Exam Prep guide, RHCE candidates have to successfully complete all RHCT Troubleshooting and System Maintenance requirements, including configuring the X Window System and a desktop environment. Naturally, you need to know how to configure the X Window on a local computer. The X Window may fail if you have problems with the X Font Server.

This is a situation where it may be more efficient to use the Red Hat GUI X Window Display Settings configuration tool, which you can start with the redhat-config-xfree86 command. The language of the X Window configuration file is difficult to master. As time is of the essence on the Red Hat exams, you should use the method that does the job most quickly for you.

The X Window System can work over a network. Once properly configured, you can run GUI applications from a remote computer. To make this work, you need to understand modularity of the X Server and X Clients, as well as the way X Window security is managed on your network.

end sidebar

On The Job 

I use the Display Settings tool and redhat-config-xfree86 command interchangeably; the command is the fastest way to start the tool.

As you might have guessed from the terms client and server, the X Window System is designed to work in a networked environment. The client and server can both reside on your own computer or on separate computers on the network. In other words, not only can you run X applications on your system, you can run X applications on other computers on your network. The graphical displays from those remote applications are sent to your monitor.

In fact, X Window applications handle this task so well that, providing the network is fast enough, you really can't tell from a performance point of view which applications are running locally and which applications are running remotely.

When you configure the X Server, I'll show you the modularity of the system. In brief, components such as keyboards, mice, and monitors are configured separately and all become modular components of the X Server.

Different Meanings for Client and Server

Normally on a network, the local computer is the client, and the remote computer acts as the server. X Window Clients and Servers work on a different paradigm. The X Server controls the graphics on the local computer. The X Server draws images on your screen and takes input from your keyboard and mouse. In contrast, X Clients are local or remote applications such as xclock that you can run on the local X Server.

You can run an X Client locally or remotely. Local X Clients run on your workstation; remote X Clients run on the local X Server. When you run a remote X Window Client application, you start the program on a different computer and send its output to use the X Server on your local computer. Figure 6-1 illustrates a local X Server with one local and one remote X Client.

click to expand
Figure 6-1: Running X Window Clients from remote or local computers

Before we can talk about running X Client applications, we need to look first at configuring an X Server on our system. While RHEL 3 normally configures most hardware configurations during the installation process, you need to know how to edit the X Window configuration file, directly in a text editor or with the Red Hat configuration tool (redhat-config-xfree86).

On The Job 

If you're in the GNOME or KDE desktops, you can also start the Red Hat Display Settings tool with the Main Menu | System Settings | Display command.

Supported Hardware

If a Linux installation program does not successfully configure the X Window System, it can be difficult to configure the GUI on a Linux workstation. Fortunately, RHEL 3 comes with tools and drivers that make this job relatively painless and easy.

But it all depends on the hardware. Linux may not always work with the latest and greatest video card or monitor. Many video cards and monitors include proprietary software; it may take some time before Linux developers are able to 'reverse-engineer' these components. For the latest official information, check the Red Hat Hardware Compatibility List described in Chapter 1.

On The Job 

Linux provides world-class support for graphics. The list of movie studios that use Linux to create feature films is impressive (Disney, DreamWorks, Industrial Light and Magic, Paramount, and so on). If you need motion-picture quality graphics support, you may want to consider some commercial alternatives to XFree86. Two are Metro-X from Metro Link (www.metrolink.com) and Accelerated-X from X-Inside (www.xinside.com).

Hardware: X Server Selection

The X Window Server program shipped with RHEL 3 is an open-source X Server program called XFree86. The XFree86 Server supports hundreds of video cards and monitors. The best place to check to see whether your video card and monitor are supported is the Red Hat Hardware Compatibility List, currently available from hardware.redhat.com/hcl.

Alternatively, navigate to the XFree86 Web site at www.xfree86.org to find the latest support information. As installed, RHEL 3 uses the XFree86-4.3.0 package; you can find more about compatible hardware at www.xfree86.org/4.3.0/Status.html.

On The Job 

As of this writing, RHEL 3 includes only the XFree86 (4.3.0) server. There may be a few video cards that require the older XFree86 server, version 3.3.x. Hopefully, these cases are now rare. If you find that you are unlucky in this way and cannot upgrade your video card, first try a standard VGA or VESA (also known as SVGA) configuration. As a last resort, download the older XFree86 Server from www.xfree86.org.

Servers and XFree86

The latest version of XFree86 includes modules for different video servers. Unlike the XFree86 3.x series, this one doesn't require you to install different packages for each video server. Hardware support for most video servers is already there. If you learn of updates, changes are easy. Just add the module, and then point to it in the /etc/X11/XF86Config configuration file.

If you are using an unsupported video card, support is also included for generic VGA devices. Most video cards and monitors will work with these X Servers.

On The Job 

Recent versions of Red Hat Linux included an /etc/X11/XF86Config-4 configuration file. When Red Hat removed support for XFree86 version 3.x servers, it changed the name of the default X Window configuration file to /etc/X11/XF86Config.

Tools for X Configuration

If you want to configure your X Window System, you have two options. You can edit the X Window configuration file directly, you can use the Red Hat Display Settings tool (redhat-config-xfree86), or you can install and configure the X Window during the installation process.

On The Job 

Older configuration tools, including xf86config, Xconfigurator, and XF86Setup, are not included with RHEL 3 (or Red Hat Linux 9).

Even if you didn't install any graphics software when you installed RHEL 3, you can still use the redhat-config-xfree86 command. When you do, it starts its own default graphics mode if it detects a graphics driver.

Red Hat Display Settings Tool

The Red Hat Display Settings tool is a stand-alone program that you can run at any time from the command line. The basic routines which start with the redhat-config-xfree86 command are also used by the Red Hat installation program if you choose to install and configure the X Window System at that time.

The redhat-config-xfree86 program is a character-based, menu-driven interface that helps you to configure your video hardware. If you're starting from a text console, it automatically probes your video card and selects the appropriate X Server image. If redhat-config-xfree86 cannot detect your graphics card, it allows you to select them from the list of supported video cards.

Running the Red Hat Display Settings Tool

It's easy to start the Red Hat Display Settings tool. Just type redhat-config-xfree86 at a command line interface. It provides a simple GUI, even if you start it from a regular text console. When you start redhat-config-xfree86, you'll see the Display Settings window similar to that shown in Figure 6-2.

click to expand
Figure 6-2: The Display Settings tool, started from the text console

On The Job 

While the look of the Display Settings tool is slightly different when started from the text console or the GUI, the functionality is identical.

If the Display Settings tool successfully identifies your hardware, you'll see it listed under the Display tab. In this case, it detected a VMWare graphics driver with a LCD monitor. You can now set the default resolution and color depth under the Display tab. You can change these settings by clicking on the associated drop-down text box. If your hardware supports it, you can configure:

  • Monitor resolutions between 640X480 and 1920´1440.

  • A color depth of 256, thousands, or millions of colors. Thousands corresponds to 16-bit color, and millions corresponds to 24- or 32-bit color, depending on the capability of your hardware.

But if you want to select a different hardware component, you can select it from a list. Click the Advanced tab, as shown in Figure 6-3.

click to expand
Figure 6-3: Display settings

You'll see options to configure your monitor and video card. Click the Configure button in the Video Card section. This should bring up the Video Card Settings dialog box shown in Figure 6-4. If the Probe Videocard option is active, the Display Settings tool may be able to configure your card for you. Otherwise, search through the list of video cards. If you do not see your graphics card here, it may not be supported. In this case, you have several options:

click to expand
Figure 6-4: Selecting a graphics card

  • Select a video card similar to your model. Alternatively, you may find a generic server such as VESA driver (generic) that is compatible with your video card. Test and if necessary edit the /etc/X11/XF86Config file to complete your changes.

  • Check the Web for other Linux users who are running the X Window System with the same type of hardware. A useful database is available by searching through newsgroup messages at groups.google.com.

  • Use the Unsupported VGA compatible X Window Server.

  • Select one of the more generic cards. With the Custom Memory Size option, you can configure between 1MB and 128MB of video RAM. You can also add one of the many configuration options associated with the /etc/X11/XF86Config file.

  • Go to www.xfree86.org and download the latest drivers. You'll need to edit the /etc/X11/XF86Config file directly to point to this driver.

Once your selections are complete, click OK. This returns you to the Advanced tab. If your video card is so capable, you'll be able to activate the Enable Hardware 3D Acceleration option. Next, configure the Monitor. Click the Configure button in the Monitor section of the Advanced tab. This brings you to the dialog box shown in Figure 6-5.

click to expand
Figure 6-5: Selecting a monitor

If the Probe Monitor button is active, the Display Settings tool may be able to probe your hardware. Otherwise, select the option that most closely matches your monitor. If you don't see the make and model for your monitor, select one of the 'generic' monitors. You can then customize the Horizontal and Vertical settings per your monitor's documentation.

On The Job 

Don't select Probe Monitor if you have an older monitor. And don't configure a horizontal sync or vertical refresh rate beyond the capability of your monitor. Otherwise, your video card may send signals that exceed the capability of your monitor. Especially on a laptop computer, the consequences can be rather costly.

Laptops

Configuring the X Window System to run on a laptop can be more challenging than configuring it to run on a desktop system. If you are planning to install Red Hat Enterprise Linux on a laptop, a good source for tips and additional information is the Linux on Laptops Web site at www.linux-laptop.net.

Configuring the X Window System

With some older or sensitive hardware, configuring the X Window System may be a risk. If the refresh rate that you set is too high, you could potentially damage your hardware. The refresh rate is the frequency at which your graphics card redraws images on your screen.

Refresh rates are expressed in terms of hertz (Hz). A refresh rate of 60 Hz means that an image is redrawn 60 times in one second. Computer monitors have both vertical and horizontal refresh rates. Modern monitors, known as multisync or multiscan monitors, automatically adjust to the vertical and horizontal refresh rates as driven by the graphics card. In either case, refresh rates vary from monitor to monitor.

Caution! If the monitor you configure does not match your actual hardware, it is possible for your video card to overtax your monitor, resulting in a blown monitor. This is a special concern with laptop computers. Laptop display screens are expensive; it is often more cost-effective to replace a laptop computer instead of replacing just the laptop display screen.

It's just as easy to overtax your monitor with any of the Microsoft Windows operating systems.

Using a Two-Button Mouse

The X Window System was designed to work with a three-button mouse. Many PCs come with only a two-button mouse. With the Mouse Configuration tool, you can configure your Linux to emulate the middle button in the GUI by pressing both buttons simultaneously.

Alternatively, if you have a mouse with a scrolling wheel, you may already have a middle mouse button. If you have a mouse of this type, try pressing the scroll wheel. If it clicks, RHEL 3 has probably already configured it as a middle mouse button.

In many cases, the Red Hat installation program automatically configures the scroll wheel. But if you have a problem, you may need to edit the /etc/X11/XF86Config file directly. The following is an excerpt from my version of this file. It describes the mouse settings, with the scroll wheel enabled.

Section "Input Device"       Identifier "Mouse0"       Driver     "mouse"       Option     "Protocol" "IMPS/2"       Option     "Device"   "/dev/psaux"       Option     "ZAxisMapping" "4 5"       Option     "Emulate3Buttons" "no" EndSection

'Mouse0' helps identify the mouse in other parts of this configuration file. The driver is mouse; the device is /dev/psaux. The protocol, IMPS/2, is associated with a standard PS/2 mouse. And the ZAxisMapping variable translates motion from the wheel to standard software mouse buttons 4 and 5, which corresponds to up and down motion in the active window. Mouse buttons 4 and 5 exist in the software even if you have only two physical buttons on your mouse.

X Configuration Files

While there are a wide variety of X Window configuration files in the /etc/X11 directory, the primary X Window configuration file is XF86Config. It's instructive to read the associated man page carefully. It is well documented and includes a number of commented sample commands that can help you configure your system in a number of special ways. For example, it includes tips on how you can

  • Configure different keyboards

  • Set up multiple monitors, in what is known as a 'multi-head' configuration

  • Disable switching from the GUI to other virtual terminals with the following command:

    Option "DontVTSwitch" "on"
  • Disable the CTRL-ALT-BACKSPACE key sequence, which normally exits from the GUI, with the following command:

    Option "DontZap" "on"

This is just a small sample of the things you can do with your X Window configuration. It's possible that you'll see a problem like this on the Troubleshooting and System Maintenance exam. You may also be asked to configure one of these options during the Installation and Configuration Exam.

Starting the X Window

The default server is linked to the X command. X is called up by the startx command. Both of these commands are located in the /usr/X11R6/bin directory. Examine the long listing for the X command. You'll see that it's linked to the version 4 all-in-one server package, XFree86:

# ls -l /usr/X11R6/bin/X lrwxrwxrwx    1 root    root         7 Jul 30 07:33 /usr/X11R6/bin/X ->>  XFree86

The Display Settings tool normally writes its changes to /etc/X11/XF86Config. When the XFree86 X Server starts, it reads this file.

Exercise 6-1: X Server

start example

In this exercise, you will start your X Server without a window manager. You'll then start an X Client application known as xterm. Some of the commands used in this exercise are covered later in the chapter. If the X Window System is not running, you can skip steps 1 and 3.

  1. If the X Window System is running, change to a text console by pressing CTRL-ALT-F1.

  2. If you see a login prompt, log in at the text console as root. Otherwise, press CTRL-C to stop the X Window.

  3. If you logged in as root at the text console, stop the current X Window Server with the following command:

    # init 3
  4. Start the XFree86 X Server by typing the command:

    # X &
  5. Your X Server will start, but all you will see is a blank gray screen, with an 'x' that represents your mouse cursor.

  6. Switch back to your text console session by pressing CTRL-ALT-F1.

  7. Type the following command:

    # xterm -display localhost:0.0  &

    (Note: xterm starts with a lowercase x, and there is only one hyphen before the display switch.)

Switch back to your X Window display by pressing ALT-F7.

You should now have an xterm terminal window. Select the window and enter commands at the xterm command line. Check out the contents of the /usr/X11R6/bin directory. Try starting other X Client applications such as xcalc and xclock from the xterm command line. Reboot your system to return things to normal.

One last keystroke hint for X: pressing the CTRL-ALT-BACKSPACE keys sends a termination signal to the X Server. In some situations, the Linux GUI crashes and it's not possible to start a text console session by pressing CTRL-ALT-F1. In this case, the CTRL-ALT-BACKSPACE key combination can keep you from having to reboot your computer.

end example

Exercise 6-2: Multiple X Servers

start example

In this exercise, you will start two different X Servers. If the X Window System is not running, you can skip steps 1 and 3.

  1. If the X Window System is running, change to a text console by pressing CTRL-ALT-F1.

  2. If you see a login prompt, log in at the text console as root. Otherwise, press CTRL-C to stop X Window.

  3. If you logged in at the text console, stop the current X Window Server by typing this:

    init 3
  4. Start the XFree86 X Server by typing the command:

    # startx &
  5. Your normal GUI will start.

  6. Switch back to your text console session by pressing CTRL-ALT-F1. Return to your GUI by pressing ALT-F7. Switch back again to your text console session. (If these commands do not work, check for a DontVTSwitch option in your /etc/X11/XF86Config file.

  7. Type the following command:

    # startx -- :1  &
  8. You should now have two different GUIs. Switch to the first GUI by pressing CTRL-ALT-F7. Return to the second GUI by pressing CTRL-ALT-F8.

  9. Log out from both GUIs.

end example

XF86Config in Detail

As you learn the intricacies of configuring the Linux X Window Server, it's worth some trouble to examine the /etc/X11/XF86Config file in detail. It's interesting to note that these files are almost identical with RHEL 3 on my VMWare computer and with Red Hat Linux 9 on my desktop computer. The only differences are associated with the different graphics hardware and monitor.

The first line is a comment that indicates whether your X Window system was last configured by the Red Hat installation program or the Display Settings tool. The two options are:

# XFree86 4 configuration created by pyxf86config # XFree86 4 configuration created by redhat-config-xfree86

The first section binds the other sections together. In other words, you'll see sections later in this file, each associated with an Identifier variable: Screen0, Mouse0, Keyboard0, and DevInputMice.

Section "ServerLayout"      Identifier     "Default Layout"      Screen    0    "Screen0" 0 0      InputDevice    "Mouse0" "CorePointer"      InputDevice    "Keyboard0" "CoreKeyboard"      InputDevice    "DevInputMice" "AlwaysCore" EndSection

The next section identifies the location of RGB (red, green, blue) style colors for display in the X Window. It also identifies the standard TCP/IP port for the X Font Server. That provides a key clue: the X Font Server can communicate over a network. You may have problems if a firewall is blocking this port.

Section "Files"      RgbPath     "/usr/X11R6/lib/X11/rgb"      FontPath    "unix/:7100" EndSection

The following section describes font and server extension modules. These are fairly standard; you can review a full list of possible modules in the /usr/X11R6/lib/modules directory (or subdirectories).

Section "Module"      Load  "dbe"      Load  "extmod"      Load  "fbdevhw"      Load  "glx"      Load  "record"      Load  "freetype"      Load  "type1"      Load  "dri" EndSection

Next, we'll look at a couple of different sections, both labeled InputDevice. The first configures your keyboard as a regular US keyboard with 105 keys. The second configures a PS/2 mouse, as described earlier. The Emulate3Buttons option, when active, configures the X Server to activate middle mouse button functionality when you click the left and right mouse buttons simultaneously.

Section "InputDevice"     Identifier  "Keyboard0"     Driver      "keyboard"     Option      "XkbRules" "xfree86"     Option      "XkbModel" "pc105"     Option      "XkbLayout" "us" EndSection Section "InputDevice"     Identifier  "Mouse0"     Driver      "mouse"     Option      "Protocol" "IMPS/2"     Option      "Device" "/dev/psaux"     Option      "ZAxisMapping" "4 5"     Option      "Emulate3Buttons" "no" EndSection

The following InputDevice is included by default, to support the simultaneous use of a USB mouse:

Section "InputDevice"     Identifier    "DevInputMice"     Driver        "mouse"     Option        "Protocol" "IMPS/2"     Option        "Device" "/dev/input/mice"     Option        "ZAxisMapping" "4 5"     Option        "Emulate3Buttons" "no" EndSection

The following Monitor and Device sections are associated with the monitor that you configured during the installation process or with the redhat-config-xfree86 command. Since no Monitor Vendor is specified, this is associated with some generic monitor.

Section "Monitor"     Identifier    "Monitor0"     VendorName    "Monitor Vendor"     ModelName     "LCD Panel 800x600"     HorizSync     31.5 - 37.9     VertRefresh   40.0 - 70.0     Option        "dpms" EndSection Section "Device"     Identifier    "Videocard0"     Driver        "vmware"     VendorName    "Videocard vendor"     BoardName     "VMWare"     VideoRam      16384 EndSection

As you can see, the Screen section associates the 'Monitor' and 'Device' as configured by Identifiers Videocard0 and Monitor0. If the Red Hat installation program or the Display Settings tool gives you the wrong DefaultDepth or inappropriate screen sizes (Modes), you can add them here.

Section "Screen"     Identifier    "Screen0"     Device        "Videocard0"     Monitor       "Monitor0"     DefaultDepth  24     SubSection "Display"             Depth    24             Modes    "800x600" "640x480"     EndSubSection EndSection

Many graphics systems support the 3D direct rendering interface, as shown:

Section "DRI"     Group    0     Mode     0666 EndSection



 < Day Day Up > 



RCHE Red Hat Certified Engineer Linux Study Guide[c] Exam (Rh302)
RCHE Red Hat Certified Engineer Linux Study Guide[c] Exam (Rh302)
ISBN: 71765654
EAN: N/A
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net