Just about every flavor of unix has a GUI based on the X window system, with the exception of the two flavors Steve Jobs had his hands in, NeXT and MacOSX.

[ rfc791.ORG : Unix Help : The X Window System ]

X - X server
mwm - de facto resource-minimalist window manager
xterm - X client which gives shell access
xinit - script which loads X and window manager
xeyes - great program for testing
The X Window System, or just X, is the Graphical User Interface (GUI) you'll find on most unix workstations. Unlike the GUIs on MacOS or Windows systems, X is merely a framework that a user environment sits on top of. X can have any look and feel you want, because look and feel is not part of what X does. X isn't built into the O/S either, it's just a set of userland applications.

The thing that makes X really cool is that X is not only a GUI, it's a network protocol. X works on a client/server principle that makes it a perfect compliment to the O/S designed for remote access from the beginning.

The way X implements it's client/server protocol might seem a little backward if you're used to other client/server protocols. In X, the server is the display, keyboard and mouse, the part the user sits in front of, while the clients that connect to it are the graphical applications.

X clients can connect to an X server across any TCP/IP network (and some other types of network too, but I won't cover that here).

The first client that usually connects to an X server is a special client called a window manager. This program deals with making the borders around windows and allowing you to size and move windows around. You can run X without a window manager, but you'll notice all the window borders and titlebars will be missing, without which a windowing system has much more limited functionality. Just as there are many shells, there are many window managers:

Once you've got your X server up and running, you can connect as many clients to it as you like. Clients can run on your machine or on someone else's, so long as you have an account on that system. Most X clients you run will come from your local machine, but it's nice to have the option.

So let's say, for example, you're running MS Windows on your local machine and you've downloaded and installed the free X server which you found on our windows utilities page and then you logged into our machine Monolith and wanted to run the X client named `xeyes' and have it display on the X server on your machine. First you'd set the environment variable DISPLAY, which tells x clients what X server to connect to, to your IP address. For this example, I'll assume your IP address is what the web server tells me it is, which is
Monolith[100]% setenv DISPLAY
Then you can just type the name of the program you want to run:
Monolith[101]% xeyes
And after a while, the program will show up on your display. Cool huh? The program is running on Monolith, but shows up on your machine!

The first program you'll probably want to run though, is the window manager. Most MSWindows X servers come with a window manager, but if yours doesn't try doing this first:
Monolith[101]% mwm &
and then run the program you're interested in:
Monolith[102]% xclock
The ampersand after mwm causes mwm to run in the background (and thus returns control of your terminal to your shell so you can type more commands). You'll notice that typing xclock as shown above without an ampersand causes xclock to retain control of your terminal. For more information on ampersands in command lines and what they do, which is called "job control", check out our shell page.

If you are logging in with a secure shell client, look through your configuration settings for an option named `X11 forwarding' or `forward X connections' or some such thing. Using that, you don't have to worry about setting the DISPLAY variable, plus the X connection happens over the encrypted tunnel of the ssh connection. More on secure shell when I write a page about it.

Normally you'll run X from the workstation you plan to run all of your programs from. This is usually pretty easy to do, as most systems come with a program called `xinit' or `startx' which can automatically run your X server and then connect your favorite window manager to it. And usually the window manager has a menu you can choose the x clients you wish to run from. Usually one of these clients is some form of xterm, which is just an X client that gives you access to the command line. If you run that, you'll notice your DISPLAY variable is already set, so you can just run commands and they'll pop up.

Keep in mind though, that if you log into a remote machine and run `xinit' on that, that the server will run on that remote machine, and thus will not do you a lot of good. Unless you want to mess with the person sitting in front of the machine...