BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?


Learning Debian GNU/Linux
Learning Debian GNU/Linux By Bill McCarty
September 1999
Pages: 360

Cover | Table of Contents | Online Book | Colophon


Table of Contents

Chapter 1: Why Run Linux?
This chapter introduces you to the upstart operating system Linux. It helps you determine whether Linux is right for you, by surveying the features and performance that Linux offers. It demonstrates that choosing Linux is a practical—even wise—decision for many computer users. The chapter also helps you feel at home with Linux and other Linux users, by introducing you to the history and culture of Linux. Finally, it points you to some popular gathering places on the Internet where you can correspond with other Linux users, get up-to-the-minute Linux news and information, and obtain free technical support.
Perhaps you learned about Linux from a trusted friend, whose enthusiasm and ready answers convinced you to learn more about Linux, or perhaps an article or anecdote that mentioned Linux simply sparked your curiosity. In any case, you may find it interesting to learn what other computer users, ranging from PC hobbyist to guru, have accomplished by using Linux:
  • Tired of slow telephone modem transfer rates, a PC owner leases a cable modem that provides high-speed transfers. He installs the new modem in a Linux system that routes packets to and from the computers of other family members. Now the entire family can simultaneously surf the Web at warp speed.
  • Struggling to complete a dissertation, a graduate student determines that most of his problems stem from bugs and inadequate features of his word processing program. Dumping Microsoft Windows and Microsoft Word, he loads Linux onto his computer and uses free text processing software he downloads from the Web. In contrast to the frequent system hangs and lost work he experienced with Windows, his new system runs for over 100 days before needing to be shutdown for installation of new hardware.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Linux at Home and at Work
Perhaps you learned about Linux from a trusted friend, whose enthusiasm and ready answers convinced you to learn more about Linux, or perhaps an article or anecdote that mentioned Linux simply sparked your curiosity. In any case, you may find it interesting to learn what other computer users, ranging from PC hobbyist to guru, have accomplished by using Linux:
  • Tired of slow telephone modem transfer rates, a PC owner leases a cable modem that provides high-speed transfers. He installs the new modem in a Linux system that routes packets to and from the computers of other family members. Now the entire family can simultaneously surf the Web at warp speed.
  • Struggling to complete a dissertation, a graduate student determines that most of his problems stem from bugs and inadequate features of his word processing program. Dumping Microsoft Windows and Microsoft Word, he loads Linux onto his computer and uses free text processing software he downloads from the Web. In contrast to the frequent system hangs and lost work he experienced with Windows, his new system runs for over 100 days before needing to be shutdown for installation of new hardware.
  • Considered among the world's best, the experienced graphics artists at Digital Domain have generated visual effects for such films as Apollo 13, Dante's Peak, The Fifth Element, Interview with the Vampire, and True Lies. But when director James Cameron selected Digital Domain to conjure visual effects for Titanic, the artists faced a task of unprecedented size and complexity. Concerned to obtain enormous computing power at the lowest cost, they purchased 160 DEC Alpha computers. Most DEC Alpha users run Microsoft Windows NT or Digital Unix as an operating system. However, Digital Domain chose to run Linux on 105 of their new computers. If you've seen
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
What is Linux?
Linux is an operating system, a software program that controls your computer. Most vendors load an operating system onto the hard drive of a PC before delivering the PC, so, unless the hard drive of your PC has failed, you may not understand the function of an operating system.
An operating system solves several problems arising from hardware variation. As you're aware, no two PC models (or models of other computers, for that matter) have identical hardware. For example, some PCs have an IDE hard drive, whereas others have a SCSI hard drive. Some PCs have one hard drive, others have two or more. Most PCs have a CD-ROM drive, but some do not. Some PCs have an Intel Pentium CPU, whereas others have an AMD K-6, and so on. Suppose that, in a world without operating systems, you're programming a new PC application, perhaps a new multimedia word processor. Your application must cope with all the possible variations of PC hardware. As a result, it becomes bulky and complex. Users don't like it because it consumes too much hard drive space, takes a long time to load, and—because of its size and complexity—has more bugs than it should.
Operating systems solve this problem by providing a single standard way for applications to access hardware devices. When an operating system exists, applications can be more compact, because they share the commonly used code for accessing the hardware. Applications can also be more reliable because this code is written only once, and by expert programmers, rather than by every application programmers.
As you'll soon learn, operating systems do many other things as well; for example, they generally provide a filesystem so that you can store and retrieve data, and a user interface so that you can control the operation of your computer. However, if you think of a computer's operating system as its subconscious mind, you won't be far off the mark. It's the computer's conscious mind—applications such as word processors and spreadsheets—that do useful work. But, without the subconscious—the operating system—the computer would cease breathing and applications would not function.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Reasons to Choose or Not Choose Linux
Here are several reasons for running Linux. The more of these that are true of you, the likelier you are to be happy in running Linux:
You want a stable and reliable computing platform.
No other popular operating system is more stable and reliable than Linux. If you're tired of crashes and hangs and the lost time and data they entail, you're a candidate for Linux.
You want a high performance computing platform.
Linux can coax blazingly fast performance out of hardware below the minimum required to load and run other popular operating systems. And, with ample memory and a fast CPU, Linux goes toe-to-toe with anything Microsoft or other vendors offer. If speed is your thing, Linux is your hot rod.
You need a low-cost or free operating system.
If you're someone on a budget, such as a student, or if you need to set up many systems, the low cost of Linux will let you reserve your hard-earned capital for hardware or other resources. Linux is the best operating system value on the planet.
You're a heavy network or Internet user.
If you use networks, especially the Internet, Linux's advanced support for TCP/IP may light up your life. Linux makes it easy to construct firewalls that protect your system against hackers or routers that let several computers share a single network connection.
You want to learn Unix or TCP/IP networking.
The best way—perhaps the only way—to learn more about Unix or TCP/IP networking (or computers generally) is through hands-on experience. Whether you're interested in such experience owing to personal curiosity or career ambition (system administrators are often handsomely paid), Linux affords you the opportunity to gain such experience at low cost, without leaving the comfort of your home.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Linux Resources on the Internet
This section points you to up-to-the-minute information about Linux available though web pages and Internet newsgroups. You may find this information helpful in completing your installation of Linux and you'll certainly find it helpful in using your Linux system.
Table 1-5 lists the URLs of some popular Linux web pages. Check these out to get the latest information about Linux. Perhaps the most useful is the home page of the Linux Documentation Project. There, you can find almost anything you want to know about Linux. The Linux Documentation Project web site includes a search engine that makes it easy to find what you need.
Table 1-5: Recommend Linux Web Pages
Web page
URL
Debian Project Web Page
http://www.debian.org/
Eric S. Raymond's Linux Reading List HOWTO
http://metalab.unc.edu/LDP/HOWTO/Reading-List-HOWTO.html
Gary Singleton's Gary's Place: Linux News Tips and Links
http://gary.singleton.net/
Joshua Go's Linux Guide
http://jgo.local.net/LinuxGuide/
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 2: Preparing to Install Linux
This chapter presents information you need to know and tasks you need to perform before installing Linux. It helps you make certain that your IBM-compatible PC meets the minimum hardware requirements for Linux. It shows you how to document your system configuration so that you can respond to questions presented by the Linux install procedure. Finally, it shows you how to prepare your hard disk for Linux.
Linux supports a wide range of PC hardware; but not even Linux supports every known device and system. Your PC must meet certain minimum requirements in order to run Linux. The following sections present these minimum requirements; however, for the latest and most complete information, you should check the Debian Project web site at http://www.debian.org/. The Debian web site will also help you determine if Linux supports all the devices installed in your system.
Linux does not support the Intel 286 and earlier processors. However, it fully supports the Intel 80386, 80486, Pentium, Pentium Pro, Pentium II, and Pentium III processors. Nevertheless, some users feel that their 80386 Linux systems respond sluggishly, particularly when running X. So, if you want optimum performance, you should install Linux on a PC having an 80486 processor or better.
Linux also supports non-Intel processors such as the Cyrix 6x86 and the AMD K5 and K6. Most Linux users have systems that use Intel chips; if your system uses a non-Intel chip, you may find it more difficult to resolve possible problems.
Linux supports the standard ISA, EISA, PCI, and VESA (VLB) system buses used on most IBM-compatible PCs. Linux recently gained support for IBM's MCA bus, used in IBM's PS/2 series of computers. However, at the time of this writing, Debian GNU/Linux does not yet support the MCA bus. If you have an IBM PS/2, you may be unable to install Debian GNU/Linux (check the Debian Project web site for the latest available information on support for the MCA bus).
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Minimum Hardware Requirements
Linux supports a wide range of PC hardware; but not even Linux supports every known device and system. Your PC must meet certain minimum requirements in order to run Linux. The following sections present these minimum requirements; however, for the latest and most complete information, you should check the Debian Project web site at http://www.debian.org/. The Debian web site will also help you determine if Linux supports all the devices installed in your system.
Linux does not support the Intel 286 and earlier processors. However, it fully supports the Intel 80386, 80486, Pentium, Pentium Pro, Pentium II, and Pentium III processors. Nevertheless, some users feel that their 80386 Linux systems respond sluggishly, particularly when running X. So, if you want optimum performance, you should install Linux on a PC having an 80486 processor or better.
Linux also supports non-Intel processors such as the Cyrix 6x86 and the AMD K5 and K6. Most Linux users have systems that use Intel chips; if your system uses a non-Intel chip, you may find it more difficult to resolve possible problems.
Linux supports the standard ISA, EISA, PCI, and VESA (VLB) system buses used on most IBM-compatible PCs. Linux recently gained support for IBM's MCA bus, used in IBM's PS/2 series of computers. However, at the time of this writing, Debian GNU/Linux does not yet support the MCA bus. If you have an IBM PS/2, you may be unable to install Debian GNU/Linux (check the Debian Project web site for the latest available information on support for the MCA bus).
Your motherboard should include at least 16 MB of RAM for optimum Linux performance. Some users have managed to coax Linux into working on systems with as little as 4 MB of RAM. However, if your system has less than 16 MB of RAM, you probably won't be pleased with its performance. If you plan to run X, you may wish to install more than 16 MB of RAM—perhaps 64 MB. Although X operates well with 16 MB of RAM, you can open more windows and switch between them more quickly if you have additional memory.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Collecting Information About Your System
In order to be able to complete the installation procedure smoothly, you should collect certain information about your system before beginning the installation. Often the installation utility will be able to determine your system configuration automatically but when it fails to do so, you must be prepared to supply the needed information. Otherwise, you'll be forced to terminate the installation procedure, obtain the information, and restart the installation.
Table 2-1 specifies the configuration information you need. To obtain this information, you can consult your system documentation and the documentation for any devices installed by you. If your documentation is missing or incomplete, you may need to contact your hardware vendor or manufacturer. Alternatively, you may be able to find the needed information on the manufacturer's web site; use a search engine such as Yahoo! or AltaVista to discover the URL of the web site.
Table 2-1: Configuration Information Needed to Install Linux
Device
Information needed
Hard Drive(s)
The number, size, and type of each hard drive.
Which hard drive is first, second, and so on
Which adapter type (IDE or SCSI) is used by each drive.
For each IDE drive, whether or not the BIOS is set for LBA mode
RAM memory
The amount of installed RAM
CD-ROM Drive(s)
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Preparing Your Hard Disk
To prepare your hard disk for installing Linux, you must allocate the space in which Linux will reside. You'll learn how to do so in this section. First, you'll learn how hard disks are organized, then you'll learn how to view the structure of a hard disk. Finally, you'll learn how to alter the structure of a hard disk.
Let's start by reviewing facts you've probably learned by working with Microsoft Windows. Most operating systems, including Microsoft Windows 95 and Windows 98, manage hard disk drives by dividing their storage space into units known as partitions. So that you can access a partition, Windows 95 and Windows 98 associate a drive letter (such as C: or D:) with it. Before you can store data on a partition, you must format it. Formatting a partition organizes the associated space into what is called a filesystem, which provides space for storing the names and attributes of files as well as the data they contain. Microsoft Windows supports several types of filesystems, such as FAT and FAT32, a newer filesystem type that provides more efficient storage, launches programs faster, and supports very large hard disk drives.
Partitions comprise the logical structure of a disk drive, the way humans and most computer programs understand the structure. However, disk drives have an underlying physical structure that more closely resembles the actual structure of the hardware. Figure 2-3 shows the logical and physical structure of a disk drive.
Figure 2-3: The structure of a hard disk
Mechanically, a hard disk is constructed of platters that resemble the phonograph records found in a old-fashioned juke box. Each platter is associated with a read/write
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 3: Installing Linux
In this chapter, you'll learn how to install Linux by following a simple, step-by-step procedure. Most users will be able to complete the installation procedure without difficulty; however, the chapter includes a section that describes how you can obtain help if you encounter installation problems. Once you successfully complete the installation procedure, you'll have your own working Linux system.
To install Linux, you follow a simple, step-by-step procedure that has three main phases:
  • Installing the operating system kernel and base system
  • Configuring the new Linux system
  • Installing applications
Although the Linux installation procedure is generally troublefree, errors or malfunctions that occur during the installation of an operating system can result in loss of data. You should not begin the installation procedure until you have backed up all data on your system and determined that your backup is error-free.
Like other modern Linux distributions, Debian GNU/Linux includes a screen-based install program that simplifies the installation and initial configuration of Linux. However, the install program works somewhat differently than a typical Microsoft Windows application. For instance, it does not support use of a mouse or other pointing device; all input is via the keyboard. So that you can make effective use of the install program, the next three subsections describe the user-interface controls used by the install program, present the special keystrokes recognized by the install program, and explain the use of Linux's virtual consoles.

Section 3.1.1.1: User-interface controls

Figure 3-1 shows a typical screen displayed by the install program. This screen includes the following controls:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installing the Operating System and Applications
To install Linux, you follow a simple, step-by-step procedure that has three main phases:
  • Installing the operating system kernel and base system
  • Configuring the new Linux system
  • Installing applications
Although the Linux installation procedure is generally troublefree, errors or malfunctions that occur during the installation of an operating system can result in loss of data. You should not begin the installation procedure until you have backed up all data on your system and determined that your backup is error-free.
Like other modern Linux distributions, Debian GNU/Linux includes a screen-based install program that simplifies the installation and initial configuration of Linux. However, the install program works somewhat differently than a typical Microsoft Windows application. For instance, it does not support use of a mouse or other pointing device; all input is via the keyboard. So that you can make effective use of the install program, the next three subsections describe the user-interface controls used by the install program, present the special keystrokes recognized by the install program, and explain the use of Linux's virtual consoles.

Section 3.1.1.1: User-interface controls

Figure 3-1 shows a typical screen displayed by the install program. This screen includes the following controls:
A main window
The install program runs in a full screen window. The top line of the window displays the name of the current installation step. In Figure 3-1, the current step is "Select CD Interface Type." You cannot minimize or change the size of the install program's main window.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Getting Help
If your system fails to boot, or if you're unable to complete the Linux installation process, don't despair. The help you need is probably close by, in one of these sources:
  • The Debian Web Site
  • Linux FAQs (Frequently Asked Questions)
  • Linux HOWTOs
  • The Debian mailing lists
  • USENET newsgroups
  • Internet Relay Chat (IRC)
The following sections describe these sources and explain how to access and use them. You should generally consult them in the order specified.
The Debian Web site, http://www.debian.org/, is your main source for information on Debian GNU/Linux. It provides documents, links, and resources galore.
Linux FAQs present commonly asked questions and answers. The Debian GNU/Linux FAQ is available online at http://www.debian.org/doc/FAQ/. You can also find it on the CD-ROM that accompanies this book, in the /doc/FAQ directory. The Linux FAQ is available at http://metalab.unc.edu/LDP/FAQ/Linux-FAQ-1.html.
Linux HOWTOs address specific topics of interest to Linux users. They're found in the /usr/doc/HOWTO direcotry of an installed Debian GNU/Linux system. You can also find them online at http://metalab.unc.edu/linux/intro.html. At this point in your Linux experience, you'll probably find the Installation-HOWTO useful. Use it to find workarounds for your installation and configuration problems.
The HOWTOs are generally available in plain text format. You can use Microsoft Windows WordPad, or another text editor of your choice, to access them.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 4: Issuing Linux Commands
This chapter shows you how to begin using your Linux system. It shows you how to boot your system, log in, issue commands, log out, and shut down your system. It also explains how to use the man command, which provides help on using other commands. The chapter describes how Linux organizes data as filesystems, directories, and files and how you can work with removable media, such as diskettes. It describes how to query the status of your system. And, finally, it explains how to use pico, a simple text editor.
This section introduces you to the cycle of Linux system use. If you're a user of Microsoft Windows, you're accustomed to a pattern of system use that forms a cycle:
  • Boot the system
  • Identify yourself to the system
  • Use the system
  • Shutdown the system
The cycle of Linux system use is similar, even though you perform the tasks somewhat differently.
Most Linux users boot their system from its hard drive. Of course, if you made a boot diskette during system installation, you can use it to boot your system.
First, you must prepare your system for booting. If your system is running, you must shut it down by following the proper procedure for shutting down the operating system that's active. For example, if you're running Microsoft Windows, click Start Shut Down and select the Shut Down option in the Shut Down dialog box. Press OK to begin the system shutdown. After a few seconds, Windows displays a screen telling you that it's safe to turn off power to your system. Turn off the power or, if your system automatically powers down, wait a few seconds until the system powers itself down.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
The System Use Cycle
This section introduces you to the cycle of Linux system use. If you're a user of Microsoft Windows, you're accustomed to a pattern of system use that forms a cycle:
  • Boot the system
  • Identify yourself to the system
  • Use the system
  • Shutdown the system
The cycle of Linux system use is similar, even though you perform the tasks somewhat differently.
Most Linux users boot their system from its hard drive. Of course, if you made a boot diskette during system installation, you can use it to boot your system.
First, you must prepare your system for booting. If your system is running, you must shut it down by following the proper procedure for shutting down the operating system that's active. For example, if you're running Microsoft Windows, click Start Shut Down and select the Shut Down option in the Shut Down dialog box. Press OK to begin the system shutdown. After a few seconds, Windows displays a screen telling you that it's safe to turn off power to your system. Turn off the power or, if your system automatically powers down, wait a few seconds until the system powers itself down.
Next, you must set your system to boot from the desired device. To boot your system from its hard drive, remove any floppy diskette from your system's floppy drive. To boot your system from a floppy diskette, insert your Linux boot diskette into your system's floppy drive.
Now, you’re ready to boot your system. Switch your system on (or press your system's reset button, if your system is powered on) and watch as it performs its self test. Shortly thereafter, you should see a boot:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Working with the Linux Command Prompt
To make Linux commands easy to use, they share a simple, common structure. This section describes their common structure and explains how you can obtain helpful information on the commands available to you.
Linux commands share the common form:
               command option(s) argument(s)
            
The command identifies the command you want Linux to execute. The name of a Linux command almost always consists of lowercase letters and digits. Remember that, unlike Microsoft Windows, Linux is case sensitive; be sure to type each character of a command in the proper case.
Most commands let you specify options or arguments. However, in any given case, you may not need to do so. For example, typing the w command without options and arguments causes Linux to display a list of current users.
Options modify the way that a command works. Most options consist of a single letter, prefixed by a dash. Often, you can specify more than one option; when you do so, you separate each option with a space or tab. For example, the –h option of the w command causes the output of the command to omit the header lines that give the time and the names of the fields. Typing:
root@desktop:/root# w -h
            
prints a list of users without the header lines.
Arguments specify filenames or other targets that direct the action of the command. For example, the w command lets you specify a userid as an argument, which causes the command to list only logins that pertain to the specified userid. Typing:
root@desktop:/root# w root
            
prints a list of current logins by the root user. Some commands let you specify a series of arguments; you must separate each argument with a space or tab.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
How Linux Organizes Data
In order to make the most effective use of your Linux system, you must understand how Linux organizes data. If you're familiar with Microsoft Windows or another operating system, you'll find it easy to learn how Linux organizes data, because most operating systems organize data in rather similar ways. This section explains how Linux organizes data. It also introduces you to several important Linux commands that work with directories and files.
Linux receives data from, sends data to, and stores data on devices. A device usually corresponds to a hardware unit, such as a keyboard or serial port. However, a device may have no hardware counterpart: the kernel creates several pseudodevices that you can access as devices but that have no physical existence. Moreover, a single hardware unit may correspond to several devices—for example, Linux defines each partition of a disk drive as a distinct device. Table 4-2 describes some typical Linux devices; not every system provides all these devices and some systems provide devices not shown in the table.
Table 4-2: Typical Linux Devices
Device
Description
atibm
Bus mouse
audio
Sound card
cdrom
CD-ROM drive
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Working with Devices
This section presents commands that work with devices. You'll learn how to mount and unmount devices and how to format a floppy diskette.
You cannot access a hard drive partition, CD-ROM, or floppy diskette until the related device or partition is mounted. Mounting a device checks the status of the device and readies it for access. Linux can be configured to automatically mount a device or partition when it boots; but you must manually mount other devices and partitions.
If a device uses removable media, the media may not be present when the system boots. If the system is configured to automatically mount such a device and the media is not present, an error occurs. Therefore, devices that use removable media are not generally configured for automatic mounting.
Before you can remove media from a device, you must unmount it. The system also unmounts devices when it shuts down. Mounting and unmounting devices is a privileged operation; generally, only the root user can manually mount and unmount devices.
To mount a device or partition, you use the mount command, which has the following pattern:
mount options device directory
            
The mount command provides many options. However, you can generally use the mount command without any options; consult the manual page to learn about the available options.
The reason you can use the mount command without options is that the file /etc/fstab describes your system's devices and the type of filesystem each is likely to contain. If you add a new device to your system, you may need to revise the contents of /etc/fstab or specify appropriate options when you mount the device.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Useful Linux Programs
This section presents several programs you may find helpful in working with your Linux system. You'll learn several commands that report system status and you'll learn how to use pico, a simple text editor.
Linux provides a number of commands that report system status. The most commonly used commands are shown in Table 4-7. These commands can help you troubleshoot system problems and identify resource bottlenecks. Although each command can be used without options or arguments, each supports options and arguments that let you customize operation and output; consult the appropriate manual page for details.
Table 4-7: Useful System Commands
Command
Function
df
Shows the amount of free disk space (in 1K blocks) on each mounted filesystem.
du
Shows the amount of disk space (in 1K blocks) used by the working directory and its subdirectories.
free
Shows memory usage statistics, including total free memory, memory used, physical memory, swap memory, shared memory, and buffers used by the kernel.
ps
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 5: Installing and Configuring the X Window System
This chapter helps you install, configure, and use the X Window System (often known simply as X). Once X is up and running, you can choose how to start X. This chapter explains your options and also gives some tips on optimizing the performance of X.
X is the standard graphical user interface for Linux. Like other graphical user interfaces such as Microsoft Windows and Mac OS, X lets you interact with programs by using a mouse (or other pointing device) to point and click, providing a simple means of communicating with your computer.
Originally implemented as a collaborative effort of Digital Equipment Corporation and Massachusetts Institute of Technology, X was first released in 1987. Subsequently, the X Consortium, Inc. became responsible for the continued development and publication of X.
Despite its age, X is a remarkable and very modern software system: a cross-platform, network-oriented graphical user interface. It runs on a wide variety of platforms, including essentially every variety of Unix. X Clients are available for use, for example, under Windows 3.x, 9x, and NT. The sophisticated networking capabilities of X let you run a program on one computer while viewing the graphical output on another computer, connected to the first via a network. With the advent of the Internet, which interconnected a sizable fraction of the computers on the planet, X achieved a new height of importance and power.
Most Linux users run XFree86, a freely available software system compatible with X. XFree86 was developed by the XFree86 software team, which began work in 1992. In 1994, The XFree86 Project assumed responsibility for ongoing research and development of XFree86.
Getting a proper X Window System up and running used to be a real challenge on Linux, almost a rite of passage. Today, device drivers are available for a much wider array of hardware, and configuration tools to assist in the setup process have greatly improved. While still tricky at times—especially with unusual hardware—X setup and configuration is no longer the daunting process it once was, and should be relatively easy.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
What is X?
X is the standard graphical user interface for Linux. Like other graphical user interfaces such as Microsoft Windows and Mac OS, X lets you interact with programs by using a mouse (or other pointing device) to point and click, providing a simple means of communicating with your computer.
Originally implemented as a collaborative effort of Digital Equipment Corporation and Massachusetts Institute of Technology, X was first released in 1987. Subsequently, the X Consortium, Inc. became responsible for the continued development and publication of X.
Despite its age, X is a remarkable and very modern software system: a cross-platform, network-oriented graphical user interface. It runs on a wide variety of platforms, including essentially every variety of Unix. X Clients are available for use, for example, under Windows 3.x, 9x, and NT. The sophisticated networking capabilities of X let you run a program on one computer while viewing the graphical output on another computer, connected to the first via a network. With the advent of the Internet, which interconnected a sizable fraction of the computers on the planet, X achieved a new height of importance and power.
Most Linux users run XFree86, a freely available software system compatible with X. XFree86 was developed by the XFree86 software team, which began work in 1992. In 1994, The XFree86 Project assumed responsibility for ongoing research and development of XFree86.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installing X
Getting a proper X Window System up and running used to be a real challenge on Linux, almost a rite of passage. Today, device drivers are available for a much wider array of hardware, and configuration tools to assist in the setup process have greatly improved. While still tricky at times—especially with unusual hardware—X setup and configuration is no longer the daunting process it once was, and should be relatively easy.
You’ll go through two stages before you have X successfully running. The first stage involves installing the needed programs that enable X to run. These can be grouped into several categories:
  • Basic XFree86 program
  • X servers
  • Window Managers
  • Applications
  • Fonts
This stage is very straightforward and can even be done as part of the basic installation process, if you select the relevant X packages during that step.
In the second stage you configure X to run properly on your system. This is a matter of identifying an X server compatible with your graphics card, and tuning the server for your graphics card. If you have a common card and all the documentation for it, this second stage will be relatively simple. Missing information makes the process harder, but not impossible.
As shown in Appendix C, X consists of many packages.
Once you've installed the necessary packages, you're ready to configure X.
You should exercise due care while configuring X to run on your system. If you incorrectly or incompletely configure X, your system can be permanently damaged. In particular, if you configure your monitor for a refresh rate that exceeds its capacity, you can damage the monitor. Older fixed-frequency monitors are particularly susceptible to such damage. The author and publisher have taken pains to make this chapter clear and accurate, but their efforts don't ensure that the procedure presented in this chapter will work correctly with your hardware. Consequently, the author and publisher cannot be held responsible for damages resulting from a faulty installation or configuration of X.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configuring X
When you install the xserver-common package, xf86config is automatically launched. However, you can launch the program any time you like. To do so, log in as root and type the command:
xf86config
Figure 5-1 shows the beginning of the xf86config dialog. As you can see, xf86config is a text-mode program; it does not support use of the mouse and it presents its questions teletype-style, using black-and-white text.
In working with xf86config, you may find that your Backspace key doesn't work as expected. If so, use Ctrl-Backspace instead.
Figure 5-1: The beginning of the xf86config dialog
Next, xf86config asks you to specify the type of mouse attached to your system, as shown in Figure 5-2. Type the number associated with your choice, and press Enter. For non-mouse pointing devices found on many laptops, you should most likely select PS/2 Mouse.
Figure 5-2: Specifying the mouse type
If you selected the Logitech MouseMan mouse, you should enable its third button by responding y to the question asking whether ChordMiddle should be enabled, as shown in Figure 5-3.
Figure 5-3: Specifying the ChordMiddle option
If your mouse has only two buttons, you should enable emulation of a three-button mouse by responding y to the question asking about Emulate3Buttons, as shown in Figure 5-4. If you enable this option you can simultaneously press both the buttons of your mouse to emulate pressing the third button.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Starting and Stopping X
Now that you've configured X by using xf86config, you’re probably eager to see it work. To start X, type the command:
startx
Your system's screen should briefly go blank and then you should see X's graphical desktop. Chapter 6, will teach you how to use X effectively.
If the screen is garbled or remains blank for more than about 30 seconds, your X configuration may be faulty. Immediately turn off your monitor or terminate X by pressing Ctrl-Alt-Backspace.
To exit X, click on an unused part of the desktop and a pop-up menu will appear. From the menu, select the Exit, Logout, or Quit menu item. X shuts down, returning you to the familiar text-based interface of the Linux shell prompt.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 6: Using the X Window System
Using the X Window System means interacting with Linux on several different levels. X itself simply provides the graphics for displaying components of a graphical user interface: X draws the screen, draws objects on the screen, and tracks user input actions such as keyboard input and mouse operations. To organize all of this into familiar objects like windows, menus, and scrollbars, X relies on a separate program called a window manager. A window manager alone won’t necessarily assure tight integration between applications running under X; that higher degree of integration comes from something called a desktop environment. While X itself is a single program, X under Linux supports several popular window managers, and two popular desktop environments.
To use X effectively, you'll learn the basic keyboard and mouse operations for communicating with X. If you're like most X users, you'll find it helpful to use a window manager and a desktop with X. You'll learn why window managers and desktops are useful and get help in choosing and setting up a window manager and a desktop.
Using the keyboard with X closely resembles using the keyboard with Microsoft Windows. X sends your keyboard input to the active window, which is said to have the input focus. The active window is usually the window in which you most recently clicked the mouse; however, under some circumstances, it can be the window beneath the mouse cursor.
This chapter refers to your pointing device as a mouse. However, like Microsoft Windows, X supports a variety of pointing devices.
Microsoft Windows lets you choose to perform most operations by using the keyboard or mouse. In contrast, X was designed for use with amouse. If your mouse isn't functioning, you'll find it quite challenging or even impossible to use most X programs.
Similarly, X provides a few important functions that you can access only via the keyboard:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Keyboard Operations
Using the keyboard with X closely resembles using the keyboard with Microsoft Windows. X sends your keyboard input to the active window, which is said to have the input focus. The active window is usually the window in which you most recently clicked the mouse; however, under some circumstances, it can be the window beneath the mouse cursor.
This chapter refers to your pointing device as a mouse. However, like Microsoft Windows, X supports a variety of pointing devices.
Microsoft Windows lets you choose to perform most operations by using the keyboard or mouse. In contrast, X was designed for use with amouse. If your mouse isn't functioning, you'll find it quite challenging or even impossible to use most X programs.
Similarly, X provides a few important functions that you can access only via the keyboard:
  • Using virtual consoles
  • Switching video modes
In addition, you can use the keyboard to terminate X.
When you configured X, you specified the video modes in which X can operate. Recall that the current video mode determines the resolution and color depth of the image displayed by your monitor—for example 16 bits per pixel color depth and 1024×768 pixels screen resolution.
By pressing Shift-Alt-+ (using the plus key on the numeric keypad), you command X to switch to the next video mode in sequence. X treats the video modes as a cycle: If X is operating in the last video mode, this key sequence causes X to return to the first video mode.
The similar key sequence Shift-Alt-– (using the minus key on the numeric keypad) causes X to switch to the previous video model. If you shift to a video mode that your monitor doesn't support—as demonstrated by a unsteady or garbled image—you can use this key sequence to return to a supported video mode, avoiding the inconvenience of terminating X.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Mouse Operations
Mouse operations under X are similar to mouse operations under Microsoft Windows, although you perform them differently. The most common mouse operations are:
  • Copying and pasting text
  • Using scrollbars
To copy and paste text, you must first mark the text. To do so, you move the mouse cursor to the beginning of the text, press the left mouse button, and drag the mouse across the text to be marked. X automatically copies the marked text into a buffer; you don't need to press Ctrl-C or perform any other operation. If you find that you need to change the size of the marked text section, you can press the right mouse button and move the mouse to adjust the marked text.
Some window managers display a pop-up menu when you click the right button, even when the mouse cursor is above text. When using such a window manager, you cannot use the right mouse button to adjust the size of the marked text section.
To paste the text, properly position the insertion point and press the middle mouse button. If your mouse has only two buttons, simultaneously press the left and right buttons to simulate pressing the middle mouse button. You may find that this operation requires a little practice before you get it right, but once you've mastered it you'll find it works almost as well as having a three-button mouse.
Many X programs provide scrollbars that resemble those provided by Microsoft Windows programs. However, the operation of scrollbars under X differs significantly from that under Microsoft Windows.
To page forward using an X scrollbar, you click the left mouse button on the scrollbar. Clicking near the top of the scrollbar scrolls forward a short distance, as little as a single line. Clicking near the bottom of the scrollbar scrolls the window by a page.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Window Managers
Window managers create the borders, icons, and menus that provide a simple-to-use interface. Window managers also control the look and feel of X, letting you configure X to operate almost any way you desire. Some Linux users who are accustomed to the look and feel of Microsoft Windows 9x use the FVWM window manager to establish a user interface that resembles that of Windows 9x, both in appearance and operation. Other Linux users prefer to avoid anything resembling a Microsoft product. Table 6-1 describes the most popular Linux window managers. For detailed information about a variety of window managers, see the X11.Org web site at http://www.x11.org/wm/.
Table 6-1: Popular Window Managers
Window Manager
Description
AfterStep
Resembles the user interface of the NEXT computer (NEXTStep).
BlackBox
A small, simple, efficient window manager. Compatible with KWM.
Enlightenment
A highly configurable window manager.
FVWM
One of the most venerable and popular Linux window managers—small, efficient, and configurable. Can mimic the Microsoft Windows 9x user interface. Not fully compliant with GNOME desktop.
ICEWM
A fast, small window manager especially popular among users of Debian GNU/Linux.
KWM