The National Institute for Computational Sciences

X11 Forwarding

X11 Forwarding

Automatic forwarding of the X11 display to a remote computer is highly recommended with the use of SSH and a local X server. To set up automatic X11 forwarding with SSH, you can do one of the following:

  1. Command line: Invoke ssh with the -X option, ssh -X <host>. Note that use of the -x (lowercase x) option will disable X11 forwarding. The use of the -Y option (instead of -X) is necessary on some systems to enable "trusted" X11 forwarding.
  2. Configuration file: Edit (or create) the .ssh/config file to have the following line in it:
    ForwardX11 yes

    All X11 programs will go through the encrypted channel, and the connection to the real X server will be made from the local machine.

    The DISPLAY environment variable set by SSH will point to the remote machine but with a display number greater than zero. This is normal and happens because SSH creates a proxy X server on the remote machine for forwarding the connections over the encrypted channel. The user should not manually set the DISPLAY variable because then a non-encrypted channel could be used.

  3. Graphical Menu: Many SSH clients have a menu to change the configuration settings. For example, to change the setting in PuTTY, check the box next to
    Connection --> SSH --> X11 --> Enable X11 Forwarding
    As with the previous item, there is no need to change the DISPLAY variable or specify the "X11 Location."
Unix-like systems generally offer native X11 support, Mac OSX ships with X11 capabilities. There is software is available for Windows, such as the free Xming, or proprietary packages such as eXceed which can be used to display X11 GUIs.

Note: PuTTY stores configuration settings for each server separately. If, for example, you enable X11 Forarding for login.darter.nics.tennessee.edu, it will not change the setting for darter-gsi.nics.tennessee.edu.