Next Previous Contents

4. The X Window System

4.1 How do I configure X?

If you are running Red Hat, you can try the command Xconfigurator. Otherwise, try using the program XF86Setup (a graphical configuration program that uses TCL/TK). Since XF86Setup does not exist everywhere, xf86config, a command-line tool, can also be used to configure your X setup.

Alternatively, you can edit your XF86Config (which is usually in /etc/ or /etc/X11/) with your favorite text editor.

4.2 How do I upgrade X?

If you are using a distribution such as Red Hat or Debian, we recommend that you look for the appropriate packages and upgrade using that method. Specifically, the Red Hat packages can probably be found at ftp://updates.redhat.com. If you want to compile the source code yourself, please look for the packages at ftp://ftp.xfree86.org or a mirror.

4.3 What is a window manager?

A window manager is the program that determines how things like window borders, icons, and menus are drawn. By changing the window manager you can make your desktop look like nearly anything you want. For example, there are window managers that emulate the look and feel of Windows 95, the Macintosh(tm), NeXT(tm), etc.

4.4 Which window manager do you recommend?

Window Maker is a very popular window manager that has a NeXT-like interface. Other popular window managers include Enlightenment, FVWM, IceWM, and AfterStep. Like distributions, no one window manager is the "best" for everyone. Information about many different window managers, with screenshots, is available at http://www.plig.org/~xwinman/.

4.5 How do I run X at a different color depth?

The easiest way to do this is to start X by using "startx -- -bpp 16" where 16 is the color depth you wish to run. Alternatively, you can manually edit the startx script to always use this color depth, or manipulate your XF86Config (which is usually in /etc/ or /etc/X11/) by removing all references to other color depths. For example, the relevant section in my XF86Config looks like:

Section "Screen"
    Driver      "accel"
    Device      "Matrox Millennium II 4MB"
    Monitor     "Gateway2000 Vivitron 17"
    Subsection "Display"
        Depth       16
        Modes       "1152x864" "1024x768" "800x600" "640x480" "640x400"
    EndSubsection
EndSection

Be sure to back up your XF86Config before attempting modifications.

4.6 How do I remotely run X applications?

If you use ssh, everything should already be set up. Otherwise, a quick tutorial on xauth will tell you something like:

localmachine > xauth list | grep localmachine
localmachine:0 MIT-MAGIC-COOKIE-1 102384102398410923841023481234
... other stuff ...
localmachine > telnet remotemachine
remotemachine > xauth add localmachine:0 MIT-MAGIC-COOKIE-1 102384102398410923841023481234
remotemachine > export DISPLAY=localmachine:0

That's all there is to it. Of course, if you are using csh or tcsh, you will have to use setenv instead of export.

More information is available at http://www.acm.uiuc.edu/workshops/security/x.html.

4.7 XDM is ugly. What can I replace it with?

Some popular alternatives include kdm, gdm, login.app, and wdm.

4.8 What are X resources?

X maintains a global, network-aware resource database that is often referred to as the X resource database. Items are added to this database using the xrdb command, usually from files with names like Xdefaults and Xresources. X resources are used by most X programs for their configuration, and allow extreme levels of customization. However, learning how to manipulate them is somewhat intimidating.

An example of a small .Xresources file:

rxvt.background:   Black
rxvt.foreground:   AntiqueWhite
rxvt.cursorColor:  Red3
rxvt.font:         fixed

Look into the commands xrdb and editres to find out how to manipulate X resources.

4.9 Why should I use xauth instead of xhost?

If you use xhost to remotely display X applications, then you are leaving yourself wide open to easy X session hijacking, password grabbing, and the like. This is because the line "xhost +hostname" allows anybody at the computer named "hostname" to access your X session. "xhost +" allows anybody in the world access to your X session -- a very bad thing indeed.

Xauth is much better than xhost because it requires the attacker to exert more effort to compromise security. By creating a passcode, and using that passcode on the remote computer to access your X session, you are preventing people who don't know the passcode from getting at your machine. Of course, if the connection to the remote computer is unencrypted, they could conceivably steal the passcode. However, that's the least of your worries in that case.

More information is available at http://www.acm.uiuc.edu/workshops/security/x.html.

4.10 How do I get my IntelliMouse(tm) wheel to work in X?

For a PS/2 mouse:

First, you'll need to edit your XF86Config file (in /etc or /etc/X11) to set the Protocol in the Pointer section to IMPS/2 [1]. Now, go to http://solaris1.mysolution.com/~jcatki/imwheel/ and download the imwheel package. Follow the installation instructions, and the wheel should now work. Note that the same procedure is used for Logitech wheel mice, too.

[1] Here's the Pointer section of XF86Config after following the instructions for installing imwheel.

Section "Pointer"
   Protocol        "IMPS/2"
   Device          "/dev/psaux"
   BaudRate        1200
   ZAxisMapping    4 5
   Buttons         3
EndSection


Next Previous Contents