Introduction to X11

A step-by-step guide for Mac OS X users

© Peter Jorgensen

Oct 31, 2008
Besides having its own familiar GUI interface, the Mac can run programs in an older windowing environment called X-windows.

What is X11?

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 here. 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.

Local Client

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.

Remote Client

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 xmachine.myhost.com the ssh command can be use to create the necessary session. The command would look like this:

>ssh -Y george@xmachine.myhost.com 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 commands and instructions should be sent through this terminal session to the local host.


The copyright of the article Introduction to X11 in Mac Software/OS is owned by Peter Jorgensen. Permission to republish Introduction to X11 in print or online must be granted by the author in writing.




Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo