Installing X Windows
path › xlifecolumns20011217

Installing X Windows

Xlife column for December 17, 2001:
Summary:
Find out how to install X Windows and video-card specific drivers, decide on a windows manager and if you decide on BlackBox you can see how to get it set up.
1 Introduction
2 Which window manager?
3 Installing X
3.1 The default font 'fixed' problem
3.2 Installing NVidia drivers
3.3 The computer freeze problem
4 Installing BlackBox
5 Start X
6 Some pointers about using BlackBox

1 Introduction

Here, I'm gonna describe how you can install X Windows (short "X"). X is quite important for a home computer, because if provides all kinds of cool and useful applications for both entertainment and work.

There's one major difference between Microsoft Windows and X Windows. Microsoft Windows is the operating system, in other words the graphical interface is a solid part of the OS. Earlier versions of MS Windows (3.x, 9x) inherited some level of cooperation with MS-DOS, thus allowing you to switch to it as a "lesser" operating system. All later versions are fully graphical as their native state and they only emulate a DOS prompt for those who can't live without it; but in fact, MS-DOS is gone for good from these versions.

X-Windows, on the other hand, is not part of the operating system. It's just an application like any other, a complex application, granted, but just that. You start it up from the command prompt when you need it, or you make it start upon Linux startup, whatever suits you.

Being a free, open-source application, X-Windows benefits from quite a large variety of options. The main part, the "core" of the application, is the thing that makes it possible for Linux to go graphical. The most succesful core at present time is XFree86.

Besides the core, you need something that knows how to use it; something that organizes your screen into windows, manages them, gives them a certain look, and finally, makes up the interface (keys combinations and mouse behaviour). This thing is called a window manager.

2 Which window manager?

Hold on to your trousers, 'cause there's no way near a shortage of these. People choose a window manager based on tradition, level of complexity, ease of handling, what applications run on it, looks, and so on.

I could give you a list of the most popular such interfaces, but it's no use. You'll need to find the one you like yourself. However, here's a starting point. Do watch it, however. Some interfaces, such as Gnome and KDE, are very good looking and extremely feature-rich, but they take their toll on computer performance. Other interfaces, such as WindowMaker, are simplistic while being faster.

For my own, I've long settled on BlackBox. I've decided I don't want fancy icons, cool graphics, a big taskbar with lots of gizmos and buttons and menus and generally any such screen cluttering stuff. Actually, what I want is exactly what BlackBox gives me:

  • an empty desktop, which does have a taskbar, but a small one which auto-hides;
  • a desktop pager (a smaller replica of what's on the desktop, for easier handling), which also auto-hides;
  • a menu which only appears when you right-click on the desktop; I get to control the menu contents completely;
  • a free, clean look for the windows, with only the absolut minimum amount of graphics;
  • fully customizable keyboard shortcuts;
  • a fast, small, and yet powerful window manager, which speeds up my work and keeps low on system resources.

Now don't get me wrong. BlackBox can and does look pretty, just take a look here. While it doesn't allow use of actual graphics and icons, it has builtin decorations you can customize, and you can also set a desktop background image. Also, most applications from other windows managers, such as Gnome or KDE, will also work under BlackBox if installed properly.

3 Installing X

I'm gonna start by first installing the core, the XFree86. For this I go to their website and find a FTP site close to me, which mirrors the full distribution. Once you find the actual distribution you'll realize there are actually several pre-compiled ones. Which one to choose?

It depends on what compiler (glibc) libraries you have installed (on Red Hat 7.1 I have glibc22). You can find out by downloading just the Xinstall.sh file from any distribution and running it like this:

#> sh Xinstall.sh -check

It will tell you which distribution to download. Once you have it (it's a directory with files in it), copy it into /usr/src. Inside it's an installer script (Xinstall.sh) and the archives (.tgz). Run it like before, but this time without the "-check" option. It will ask you some stuff now and then, answer like this:

  • yeah, overwrite previous X installation
  • yes, make symlinks
  • yes, overwrite config files
  • install font server and everything it wants; careful with fonts, you don't need Cyrillic for example unless you know Russian; you do need the other types of fonts
  • install whatever docs you want (you'll find them in /usr/share/docs/Xsomething...)
  • yes, make new library links

You've just installed X 4.1.0. In order to make sure it's all OK, do this at the command line:

#> /etc/rc.d/init.d/xfs stop
#> /etc/rc.d/init.d/xfs start
#> tail /var/log/messages

This restarts the xfs daemon (X Font Server) and then displays the last few lines from the system log. You should see something like "xfs startup succeeded". It's a way of discovering if everything went OK.

3.1 The default font 'fixed' problem

This is a problem that can arise from time to time. You get an "unreadable" error in /var/log/messages and X won't start, complaining about being unable to find the default font 'fixed'. This happened to me because (I think) I used to set a 077 mask in /etc/profile, 'causing some directories containing fonts to get too restrictive modes. It's a common problem. Check the configuration file for X (see below), find out which are the font directories and set 755 mode for dirs and 644 for files.

3.2 Installing NVidia drivers

I have a Geforce2 MX video card, so I need to install specific drivers for it to work best. It's good to install specific drivers if the chipset manufacturer provides them, because they will make your hardware work best. NVidia does offer Linux drivers in the form of two archives, NVIDIA_GLX-x.0-xxxx.tar.gz and NVIDIA_kernel-x.0-xxxx.tar.gz. Once you've got them, unpack them in /usr/src like this (note that the xxxx's should be replaced with actual version numbers). Please also note that NVidia at some moment began to offer self-installing drivers which you can run directly to install.

#> cd /usr/src
#> tar -xvzf NVIDIA_GLX-xxxx.tar.gz
#> tar -xvzf NVIDIA_kernel-xxxx.tar.gz

Don't think it's just a pointless showoff. NVidia's drivers provide much better performance for NVidia video cards. However, before you install the drivers you'll need to make sure you have the kernel sources installed, since the NVidia-kernel package needs them for the installation. You can check by running this:

#> rpm -qa|grep kernel-source

If you don't get any output, you don't have it. Put the second Red Hat 7.1 CD in the CD-ROM drive then do this:

#> mount /mnt/cdrom
#> rpm -ivh /mnt/cdrom/RedHat/RPMS/kernel-source-2.4.2-2.i386.rpm

(It will take a bit.) After you're done you're ready to install the NVidia drivers:

#> cd /usr/src/nvidia/NVIDIA_kernel-xxxx
#> make install
#> cd ../NVIDIA_GLX-xxxx/
#> make install

You should see "NVdriver installed successfully" after the first "make install", the second will just copy some stuff into certain places.

Finally, you will have to tell X to take the changes into account (the drivers are installed, they need to be used too). You do this by editing /etc/X11/XF86Config-4, which holds the X configuration. Make these changes:

  • Find a line that reads:
    Driver "nv"
    and replace it with:
    Driver "nvidia"
  • Make sure that you have the following line in the modules section:
    Load "glx" OK
  • Also, comment out or delete these lines:
    Load "dri"
    Load "GLcore"

OK, the NVidia drivers are now in.

3.3 The computer freeze problem

Currently, there's a problem with all available NVidia drivers. It is somehow related to AGP and Linux systems use and will cause X to run into 99% CPU use shortly after startup, effectively locking up your computer. You'll have to perform a cold reboot (i.e. push the button).

The problem only appears on certain systems, and so far it's not clear which are the exact circumstances which make this happen, since it's been reported on various hardware configurations as well as several Linux distros and kernel versions.

Until NVidia finally figures this out, if you are one of the few unlucky people who have this problem, here are some workarounds:

  • try reducing the AGP speed in the BIOS (go down to AGP 2x or even 1x);
  • try using the native AGP driver of X instead of the NVidia one, by setting the "NvAGP" option in XF86Config to "2";
  • disable AGP completely by setting "NvAGP" to "0";
  • downgrade to some older version of the drivers; some people have reported 1541 to do the trick.

Check out the Linux NVidia users forum over at nvnews.net. People occasionaly (re)discuss this issue there.

4 Installing BlackBox

I'll need to get BlackBox as well as BBKeys (a part of BB that handles all keyboard input) and BBPager (BB specific desktop pager). (There are a few more specific BB apps, find them out for yourself.) Assuming you've got the three archives and put them in /usr/src, do this:

#> cd /usr/src
#> tar -xvzf *.tar.gz
#> cd blackbox-0.61.1/
#> ./configure; make; make install
#> cd ../bbkeys-0.8.3/
#> ./configure; make; make install
#> cd ../bbpager-0.3.0/
#> ./configure; make; make install

BlackBox is now installed. Now I need to tell X to use it instead of its regular window manager, and load bbkeys and bbpager as well. To do this create a file called .xinitrc in your home directory (/root), and write this in it:

bbpager -w &
bbkeys -i &
exec blackbox

5 Start X

You start X Windows by typing "startx[ENTER]" at the command prompt. The screen will flicker, show the NVidia logo (how Microsoft-ish) then show the BlackBox desktop.

6 Some pointers about using BlackBox

  1. The taskbar is in the upper margin of the desktop. Move your mouse there to make it show up. Using the small arrow buttons on it you can switch between windows or desktops. It also show the current time and date.
  2. X-Windows can have several desktops, unlike MS Windows. A desktop is a separate "screen", which retains it's own windows. You can see the state of all the desktops using the pager, which is located at the bottom-right margin of the screen.
  3. To manage desktops you can use the pager to drag and drop windows across desktops, or change desktop by clicking on it; you can use the desktop switching buttons on the taskbar; you can use Alt+1 thru Alt+4.
  4. Right-click on an empty desktop portion to make the BlackBox menu appear. It was populated by me with certain application shortcuts and BlackBox specific stuff. Right-click again to make it go away.
  5. There are several keyboard shortcuts available, see .bbkeysrc for the settings.
  6. By editing the configuration files you have complete control over all BlackBox, bbpager and bbkeys features.

< Back to the top | Read other columns | Choose what column I should write next! >