Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

xterm
X11 client that provides a terminal window

What Not To Do

Do not:

  • use xhost or set the DISPLAY environment variable manually to the name of the system where your X11 server is running. Using SSH X11 forwarding will automate and secure this process for you – see below for details.

  • run applications that can be run directly on the system where you're running your X11 server (xterm, XEmacs, Mozilla, mail readers, etc.). In general, you will get better performance from running these applications locally.* With web browsers, you can easily make a connection to a remote service from a locally running browser.

  • * X11-based editors usually have a facility for accessing remote files. For example, for XEmacs, you can use http://savannah.gnu.org/projects/tramp/.

SSH X11 Forwarding

Security notice about SSH X11 forwarding

...

You will need an X11 server for your desktop, as none are included with Windows.

The easiest solution:

  • Install MobaXterm as your terminal client of choice; it has a built-in X server installed.

  • Install http://sourceforge.net/projects/xming/ , and make sure to include the SSH client Putty.

  • When configuring Putty for your SSH login, you must check the "Enable X11 Forwarding" box.

Alternatively, if you want X11 display along with a UNIX-like environment to run on top of Windows (e.g. to run UNIX shell scripts and commands), then we recommend using http://cygwin.com/ . The X11 server and OpenSSH client work similarly to those on UNIX-like systems.

...

For Mac OS X, X11 is not the default graphical interface and must be installed and started. Install http://xquartz.macosforge.org/landing/ on your Mac and run it whenever you want to use X11 forwarding.

This document assumes

  • that X11 forwarding is not enabled by default. (This is common in modern software distributions because of the security implications mentioned above.)

  • that you are using OpenSSH, which is the most common SSH client on UNIX-like systems.

X11 forwarding from the command line

X11 forwarding can be enabled by adding -XY to the command line:

Code Block
actionscript3actionscript3
ssh -XY mfk8@o2.hms.harvard.edu

...

The ssh configuration file is located in ~/.ssh/config. For hosts you want to enable X11 forwarding to, add the following to your config file:

actionscript3
Code Block
actionscript3
Host o2.hms.harvard.edu
ForwardX11 Yes
ForwardX11Trusted Yes

...

Here is the recommended order for troubleshooting X11 forwarding if you're having trouble:

  • If your desktop is a UNIX-like system, make sure you can run an X11 program locally, from the same terminal from which you plan to SSH to the remote host. A trivial program like xlogo is useful for this sort of testing. If you can't display a local X11 client, then remote clients are unlikely to work either.

  • SSH to the remote host. Without doing anything further, type echo $DISPLAY. You should get something like localhost:11.0. (The host name will be that of the remove host and the display number will differ from this example.) If $DISPLAY has no value, you don't have X11 forwarding enabled.

  • At this point, you should be able to run an X11 client program like xlogo on the remote host.

  • If you still have trouble, feel free to email Research Computing at rchelp@hms.harvard.edu .