![]()
Linux for Newbies: Part 5 -- Setting up X Window
by Gene Wilburn
(The Computer Paper, December 1999. Copyright © Wilburn Communications Ltd. All rights reserved)
The three major milestones in the early going for any Linux newbie are: 1) installation, 2) X Window setup, and 3) PPP connect to the Internet. We've worked our way through the basics of installation and have started to learn enough Unix to work the system. We'll return to this theme soon, but in this installment let's get X Window up and running. Down the road we'll tackle PPP.
(Note: this series is based on the inexpensive CheapBytes Red Hat Linux 6.0 i386/Intel CD available at www.cheapbytes.com)
First, you should understand that the X Window System (its full, official name) is based on a totally different design philosophy than Microsoft Windows or MacOS. The X Window System is not a fundamental, integrated part of the operating system. You can set up a powerful, completely functional Linux box without ever putting X on the system at all. In fact many Linux administrators prefer to omit X entirely on a production server. X Window is intended primarily for workstation use--i.e., personal computing on a Linux box.
Because the X Window System was developed as a networked GUI, X has two components: server and client. The server can actually be on one computer and the client on another but in most cases they're both on the same machine. You need to match a server with the video card you have in your system. There are X Window servers for VGA, SVGA, S3, ATI, and a large number of other video adapter families.
The client side of X Window is essentially a GUI toolkit, full of widgets and intrinsics (programming calls). By itself X does not even provide an interface. That is the job of whichever windows manager you choose to use on top of X. Getting confused? It becomes clearer as you go. The main thing to understand is that the X Window System is layered and modular and that you piece together the parts you want by configuring them for your system.
If you followed the instructions in a previous column for installing Red Hat Linux 6.0, you have the basic components of X Window already installed. If you elected to also include KDE and/or GNOME, then you have an even richer set of options.
By default all the distributions of Linux use the open-source X Window System created by the XFree86 Consortium (www.xfree86.org). It is based on X11 Release 6, usually abbreviated as X11R6 and located in the directory /usr/X11R6.
There are two methods of configuring XFree86 on Red Hat 6.0 Linux: a classic, text-based program called xf86config, and a proprietary Red Hat menu-driven configuration program called Xconfigurator. Xconfigurator is handy and we'll use it, though you may prefer to use the solid, dependable xf86config.
Now we come to potential stumbling blocks: you should know what kind of video card is in your system, how much onboard RAM the card contains, plus the resolution capabilities of your monitor. The configuration program may autodetect your card, but if it doesn't you'll have to manually select it from a list.
With well-supported hardware, Xconfigurator may pick up your video card and adjust your system correctly. If it doesn't and you can't find a setting for your card, then select Generic VGA as your video card and Standard VGA as your monitor type. This will provide you a basic 640x480 screen with 16 colours. While not very exciting, these settings should at least get you up and running. If Xconfigurator attempts to probe your system and hangs, which happens occasionally, you may need to run xf86config and do a text-based setup instead.
As a configuration example, I'm going to run through a setup based on my main workstation, a 166Mhz Pentium clone with a 4Mb Matrox Millennium II video card and a Dell multisync monitor. I start out by logging in as root and mounting my CD-ROM, in case the configuration program wants some files from it. Then I run the configuration program:
# cd /mnt # mount /dev/cdrom cdrom # XconfiguratorThis starts up the Xconfigurator menus and the program automatically detects my PCI-based Millennium II card, picking up the correct memory settings. Next it asks which monitor I have (from a scrollable list). My Dell monitor is not on the list so I choose "Custom". Under "Custom Monitor Setup" I must select a horizontal sync range. As the prompt says "It is very important that you do not specify a monitor type with a horizontal sync range that is beyond the capabilities of your monitor. If in doubt, choose a conservative setting."
What this means is, you could actually blow your monitor if you attempt to be too aggressive with the sync rate. Be careful. Most modern multisync monitors can be used safely with the relatively conservative "Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz" setting, which is the setting I select.
The next custom setting is "vertical sync range of your monitor". If in doubt, select the "50-70" option. My Dell monitor is capable of a higher rate, so I select "50-90".
Now we come to "Screen Configuration" where you are presented with two options, "Don't Probe" and "Probe". Probing attempts to automatically determine the best video mode and colour depth for your system. There is always a chance it could lock your system, however. I always select "Don't Probe".
Next is "Video Memory". In my case I select "4 mb". Then comes "Clockchip Configuration". These are special settings needed by a few older video cards. You normally select "No Clockchip Setting (recommended)" as the option.
Okay, feeling brave? The next option is "Probe for Clocks" with two choices: "Probe" and "Skip". Again, probing could cause your system to crash and/or the screen to go blank. I select "Skip".
Next we arrive at "Select Video Modes": a grid for setting resolutions for 8-bit (256 colours), 16-bit (thousands of colours), or 24-bit (millions of colours) options. My 4Mb card is too short on memory to comfortably run in 24-bit mode at my preferred 1024x768 resolution, so I limit my choice to 16-bit 1024x768 mode. If you have 8Mb or more of RAM, you can use the 24-bit settings. If you select more than one resolution per colour depth, X Window allows you to use keystrokes to switch resolutions dynamically, but I prefer the simplicity of a single resolution.
Last, we come to the "Starting X" test screen, with "OK" and "Skip" for options. This time you don't want to skip--you need to see if your settings work.
Xconfigurator will now start an appropriate X Server (it may install one first from the CD) and will display a dialog box that says "Can you see this message? Yes / No". The dialog expires in 10 seconds so if the attempt fails it will return you back to the Xconfigurator menus.
If you can see the box and the resolution looks approximately right, click "Yes" and you'll get another dialog box that says "Xconfigurator can set your computer to automatically start X upon booting. Would you like X to start when you reboot? Yes / No". Select No. The Yes option puts your Linux init sequence to init 5 level rather than the standard init 3 level, and we don't want to do that at this point. (We'll discuss these init level settings later in the series.)
If all goes well, Xconfigurator writes a new configuration file, /etc/X11/XF86Config, and you can examine this text file and even edit it, once you understand X. You're now ready to try out X Window.
Log in as yourself (not root) and type "startx" (lower case and without the quotes) at the prompt. Depending on how you installed your Red Hat system it should come up with GNOME, KDE or AnotherLevel as a window manager/environment.
Window Managers and Desktop Environments
Linux is about choices. Nowhere is this more evident than in the choice of a window manager or environment for X Window.
If you did not select GNOME or KDE when you installed Linux, Red Hat will default you to a window manager called AnotherLevel, which looks quite a bit like Windows 95. The match isn't 100 per cent but it's close enough that you should find it very comfortable to use.
If you installed both GNOME and KDE, Red Hat 6.0 defaults to GNOME. The way to switch between GNOME, KDE and AnotherLevel is to open a terminal session and type "switchdesk" at the prompt. AnotherLevel is Red Hat's modified version of an X Window manager called FVWM95.
Try them out to see which you like. The current front runner in the Linux community is KDE. It's picking up a lot of development and it's generally faster and more stable than GNOME, though GNOME has a great looking interface.
There are many other windows managers, besides these three, available for X and most are highly customizable. As you become familiar with X Window, you may enjoy trying out and tweaking different interfaces. Needless to say, some users become quite religious about their favourites.
If Things Go Wrong
Bear in mind that as fascinating and capable as Linux is, it's not Windows. It sometimes takes awhile for newer video cards to be supported. Some volunteer somewhere on the Internet has to write the drivers. Even so, the XFree86 Consortium does an outstanding job of incorporating new cards into in a timely fashion. Check with their website if you have a recent, unsupported card you're trying to use. Each new release of XFree86 includes support for new video adapters.
Laptops are generally the trickiest computers to configure for X. Many of the onboard video cards and displays of laptops are non-standard. If your laptop doesn't easily configure, you may be able to find help at the Linux on Laptops website at www.cs.utexas.edu/users/kharker/linux-laptop/.
Linux support is largely a peer-support system and the communications channel is the Internet. If you're having difficulties getting your X Window up and running, you may find others who have worked through exactly the same hardware and have had success. The best Internet newsgroup for X support is comp.os.linux.x plus the old standby, comp.os.linux.misc.
Next time we'll return to some basic Linux administration.
Gene Wilburn (gene@wilburn.ca) is a Toronto-based IT manager, musician and writer who operates a small farm of Linux servers.
-30-