X over SSH

What is X?

X (or X11) is short for the X Window System, a framework that provides a graphical user interface (GUI) that is primarily used in Linux. X uses a client/server model: a client application displays its graphics on an X server. Before you can run X over SSH, you must install X libraries on both your Cloud Server and your local machine. This article briefly summarizes how to do this.

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 Client

You can install the X client libraries by using your system's built-in package manager. On a Debian server, the required libraries are installed as dependencies the first time that you attempt to install a graphical application. For example, the following command installs xterm, a graphical terminal emulator, along with libXaw and several other libraries:

aptitude install xterm

X Server

The X server libraries depend on the operating system installed on your local machine:

  • For Mac OS X, no action is required; he necessary libraries are already installed. If they are not, you need to install XCode from your system discs.
  • For Linux, the necessary libraries are probably already installed. Popular desktop managers such as GNOME and KDE rely on X, so if you're using them, you're using X also.
  • For Windows, you need to have a specialized X Server such as Xming. For more information about installing Xming, see the external article, Getting Started With Xming.

Installing an X server on your local machine is beyond the scope of this article, but after you have completed this step, you can connect to X over SSH.

Connect to X over SSH

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). For example:

ssh -X user@

The -X switch tells SSH to allow X forwarding so that the X client on your Cloud Server can connect to the X server on the local machine. After you are connected, you can open the client that you installed. For example, to open the xterm application, type of the following command:


An xterm window appears on the local machine, integrated with the desktop.

When you tunnel X over SSH, you can easily run graphical applications on your Cloud Server without a desktop manager.

© 2015 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER