A step-by-step guide for Mac OS X users
What is X11?
, also known as X-Windows
and simply X
, is a graphical user interface (GUI) which has been in use longer than even the Macintosh GUI. For a complete history and description of X, see the WikiPedia article.
The Server/Client Model
In the standard client/server model, the client is local and the server is remote, accessed over a network. X11 turns this on its head calling the local component the server and the remote component the client. The server is what the user interacts with and sends the user’s keystroke and mouse actions to the client, which actually runs the application (for instance Firefox
.) The client sends back to the server instructions about what to display on the screen.
X11 on Mac OS X
Due to its unix underpinnings, Mac OS X
comes with an implementation of X11. It has been an optional install prior to Leopard (10.5). Starting with Leopard it is installed by default. The Leopard version of X11 has some detractors who prefer earlier versions. Instructions for installing the Tiger version in Leopard can be found on the Internet. Once installed it can be found in the Utilities folder.
Two types of client
Traditionally, the X11 client ran on a remote host access over a network
. This is often still the case. Now, however, the client may be on the same system as the server
. The communication between server and client is still through network protocols, but does not require connection to an actual network.
Running X11 Applications on the Mac
Starting the X11 server on a Mac
is as simple as double clicking the X11 icon located in the Utilities folder. The XTerm program should open up. This is a simple terminal emulation, command line interface (CLI) to the operating system. You can execute any installed unix command at the prompt.
Running an application
that resides on the local system can be accomplished by entering the application’s name at the prompt in XTerm. This will run the application and tie up XTerm until you quit the application. This is a useful way to test X11 because several X11 utilities are installed with X11 on the Mac. Among these are xeyes and xclock. To run an application without tying up XTerm (so that other applications can be run) add and ampersand (“&”) to the end of the command, like this:
> xeyes &
This will run the xeyes program and display the CLI prompt in XTerm, allowing another program to be started.
Running an application on a remote client is similar but first a session must be established on the remote client host. In other word, the user of the local server system must log into the remote system. To do this, the name or ip address of the remote system and a valid username and password on that system must be known. Assuming the username is george
and the remote system’s name is top.moldseo.org
the ssh command can be use to create the necessary session. The command would look like this:
>ssh -Y [email protected]
The remote host will prompt for george’s password and then display its own prompt. At this prompt the method of running an X11 application that resides (and will run on) the remote host is the same as running a locally hosted application. Notice the “-Y” after “ssh”. This tells the remote host that X11 command
s and instructions should be sent through this terminal session to the local host.