Note: The commands and utilities in this article have been tested on a Debian Cloud Server. They are not guaranteed to function correctly on other distributions. However, the General Package Installation Guidelines article may assist in "porting" this article to another distro.
X (or X11) is short for the X Window System, a framework for providing a graphical user interface (GUI), primarily used in Linux. X uses a client/server model; a client application displays its graphics on an X server. This means that, before you can run X over SSH, you will need to install X libraries on both your Cloud Server and your local machine. This article will briefly summarize how to do this.
The X client libraries may be installed using your system's built-in package manager. On a Debian server, the required libraries will be installed as dependencies the first time you attempt to install a graphical application. For instance,
aptitude install xterm
The X server libraries depend on the operating system installed on your local machine. If you're using Mac OS X, you shouldn't need to do anything -- the required libraries are already installed! (In the off-chance that they aren't, you will want to install XCode from your system discs.) If you're using Linux, there's also a good chance the relevant libraries have been installed. For example, the popular desktop managers such as GNOME and KDE rely on X; if you're using them, you're using X also. Windows, on the other hand, will require a specialized X Window Server such as Xming. Installing an X server on your local machine is beyond the scope of this article, but once this step is completed, there's only one thing left to do...
Running a graphical program is not much different from running any other tool on the command-line. The only real difference is in how you connect (and that difference is small):
ssh -X firstname.lastname@example.org
Notice the "-X" switch? That tells SSH to allow X forwarding so that the X client on your Cloud Server may connect to the X server on the local machine. Once inside, let's test out the xterm application we installed:
Voila! An xterm window appears on the local machine, nicely integrated with our own desktop. You've just tunneled X over SSH, and can now easily run graphical applications on your Cloud Server without a desktop manager. Now go explore the possibilities!
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License