## 2.2. Starting X

There are several ways to start X and its window manager. This section explains a few common ways. Figure 2-2 shows some steps along a few different paths to starting X. (The large "X" on the figures is the mouse pointer, or cursor, that you may see on your screen.) If your screen is like any of the following, refer to the section noted. If none fits your situation, skim through the next three sections or ask another X user for help.

- Figure 2-2A, xdm (or another program, such as gdm or kdm) is running and waiting for you to log in graphically. Start reading at Section 2.2.1.

- Figure 2-2B has a standard Unix login session; the X Window System is not running. Start reading at Section 2.2.2.

- Figure 2-2C shows X running, but a window manager probably isn't. (You can tell because the window doesn't have a frame around it: there's no titlebar or border.) Read Section 2.2.3.

- Figure 2-2D shows the window with a frame (titlebar and border), so X and the window manager (in this example, mwm) are running. You're ready to go! Skip ahead to Section 2.3.

#### Figure 2-2. Four scenarios that may occur while starting X

### 2.2.1. A. Ready to Run X (with a Graphical Login)

Some terminals, like the one whose screen is shown in Figure 2-2A, are ready to use X. Your terminal has probably been set up to use one of the X display managers called xdm, gdm, kdm, or others; these log you in to your account and usually also start the window manager.

When you start, there's a single window in the middle of the screen that has two prompts like "login:" and "password:". The cursor sits to the right of the "login:" line. To log in, type your username (login name) and press RETURN, then do the same for your password. The login window disappears.

If a screen something like Figure 2-1 or Figure 2-2D appears, you're ready to use X. You can skip ahead to Section 2.3.

If you get a screen such as Figure 2-2C (a single window with no title and no border), read Section C. Or, if you get a blank screen, press and release your mouse buttons one by one, slowly, to see if a menu pops up.

### 2.2.2. B. Starting X from a Standard Unix Session

If your terminal shows something like Figure 2-2B, with a standard Unix "login:" prompt (not in a separate window; the display fills the whole screen, making it look like a terminal), X isn't running. Log in (as Section 1.1.2 in Chapter 1 explains) and get a shell prompt (such as `$` or `%`). Next, you need to start X. Try this command first:

>     $ startx

If that doesn't seem to work (after waiting a minute or so; X can be slow to start), try the command xinit instead. If all goes well, your screen sprouts at least one window. If the window looks like Figure 2-2C, without a titlebar or border from a window manager, read Section C. Otherwise, your window manager is running, so skip ahead to Section 2.3.

### 2.2.2.1. Problem checklist

No windows open. I get the message "Fatal server error: No screens found."
  Your terminal may not be able to run X. Try another terminal or ask a local expert.

### 2.2.3. C. Starting the Window Manager

Once you have a window open with a shell prompt in it (usually `$` or `%`), you can start the window manager program. If a window manager isn't running, windows won't have frames (with titles, control boxes, and so on). Also, if you move the pointer outside any window (to the desktop) and press the mouse buttons, menus won't appear unless the window manager is running. If you have to start the window manager by hand, your account probably hasn't been set up correctly. To make your life easier, get help from an X-pert and fix your account!

If you need to start the window manager by hand, move your pointer into the terminal window. At the shell prompt, type the name of your window manager, followed by an ampersand (`&`). If you don't know your window manager's name, try the following names, one by one, until one works (i.e., doesn't give you a "command not found" error): gnome-session, startkde, wmaker, afterstep, fvwm2, fvwm, or twm. For example:

>     $ fvwm &
>     [1] 12345
>     $

In a few moments, the window should have a frame. (For more about starting programs, see Section 2.3.2, later in this chapter.)

Copyright © 2003 O'Reilly & Associates. All rights reserved.