Running X11 Applications Remotely

NOTE: We do not support the software required to do this on your home computer or laptop. This is simply a guide to help get you started on your way. If there is some application that you can not run remotely, you need to use one of the UNIX labs on site at PSU.

If you don’t quite know what X Windows applications are, you may want to read this summary first:

http://web.archive.org/web/20030712212513/http://fusion.gat.com/docview/understanding_x.html

LEARN ABOUT VPN SERVICES IN MCECS

If you are attempting to make an X11 connection to a firewalled Linux computer, you will need to make sure that your computer is connected to one of our VPNs. Popular Linux hosts that are firewalled include:

  • auto.ece.pdx.edu, mo.ece.pdx.edu, archive.cecs.pdx.edu
  • Computers in the CS Particle Lab (FAB 88-09)

There are many other Linux computers that do not require you to use a VPN.

LEARN ABOUT VPN SERVICES IN MCECS

 

From Windows

Note:

Step 1 – To run X11 applications first run MobaXterm on your machine.

Step 2 – Once MobaXterm is loaded, select the start local terminal button as shown highlighted in blue in the image below

Step 3 – This will bring up a terminal window shown in the image below.

Step 4 – Now, login to the remote host you want to run your X Windows program on. Use the ssh (Secure Shell) command in the terminal with your MCECS username and host name like so:

                ssh username@hostname

Step 5 – Hit enter to connect to that host server in which you will be prompted for your MCECS password.

Step 6 – Once you are connected to a remote host, using X11, you can start graphical applications directly though the terminal by typing out the application name as shown in the image below. For example, if you enter “gimp” into the terminal,  the gimp photo editor application will open on your desktop.

 

 

If this is not a preferable method for you the options below are also available though they require more effort. Through SSH forwarding you may forward X11 applications to your local X server. To do this, you will need two applications — an X server, and an SSH terminal application.

Windows X11 Servers

  • X-Win32 – Most commonly used X server for windows, fairly priced with an educational discount.
  • Exceed – Another popular X server, stable, full featured, and equipped with many extra tools.
  • Cygwin/XFree86 – Free, though the Windows port of XFree86 is still very much in development, and does not run properly on many configurations. Also required is a decent understanding of UNIX and setting up XFree86. Still, for free you can always give it a try.

From Linux

Linux/*BSD X11 Servers

  • XFree86 – Probably came with your distribution. XFree86 is the most common implementation of X found on Linux and the various BSD distributions. It is fast, stable, and free.

From Mac

Mac OSX

  • For OS X version 10.8 (Mountain Lion) and up: First you must download and install XQuartz, an Apple supported community X11 server for OS X. Available at http://www.xquartz.org/After you install XQuartz you just need to log out and back in or restart you computer. Then you can SSH with X11 forwarding using the ssh -X flag, for example:
    ssh -Y mayermic@linux.cs.pdx.edu

SSH Software

Linux, Mac OSX, and other *NIX variations typically come with variations of SSH. If not, you may need to install a version such as OpenSSH.

See our Shell/SSH Access page for more information on SSH clients for other operating systems.

 

Setting up X11 Forwarding

Many, but not all SSH clients currently available support X11 Forwarding, and general port forwarding. This allows network traffic to be forwarded from the remote machine to your local box through SSH. The result is that with very little configuration, this traffic is forwarded to your machine, encrypted in an SSH “tunnel”.

There are several reasons this is a preferred method to run X11 applications remotely:

  • Most importantly, the transmission is secure. Any data, passwords, etc. is encrypted within the SSH tunnel.
  • Setup is easy. In most situations, all you need to do is have your X server running. There is no need to modify permissions for foreign hosts, and no need to set your DISPLAY variable. SSH does it all for you.
  • With SSH compression turned on, it can actually be faster to use SSH than not on low bandwidth connections.

To set up SSH port forwarding, you simply need to enable that option in your client. We outline a few examples below for common clients:

NOTE: We recommend against using any SSH program that does not support SSH version 2. MacSSH, and OpenSSH support both SSH2 and port forwarding.

MacSSH

  1. Go to the menu item Favorites -> Edit Favorites.
  2. Either create a “New” entry, or select an existing one and click “Edit“.
  3. Enter the hostname and any other desired information.
  4. Go to the “SSH2” tab.
  5. Make sure the checkbox “Forward X11” is checked.
  6. Save your favorite by clicking “OK”.

OpenSSH or the commercial SSH Client

X11 forwarding is typically turned on by default in most *NIX distributions of SSH. If it is not, you can enable it by calling SSH with the “-X” option. For example:

% ssh -X username@redhat.ece.pdx.edu

You can also change this option in the SSH configuration files. Please refer to the SSH documentation for more.

NOTE: The -X flag has changed in OpenSSH 3.8 and later, X11 forwarding is performed in a way that applications run as untrusted clients by default. Some applications may not function properly when run as untrusted clients. To forward X11 so that applications are run as trusted clients, invoke ssh with the -Y flag instead of the -X flag, or set ForwardX11Trusted in the ~/.ssh/config file.

Running your Application

This is the best part! First, start your X Server if it isn’t running already. To run the X application you want, simply SSH in to the machine you desire, and run the program. The program should display on your screen, probably after some delay as it loads.

Speed

Note that X11 requires a lot of network traffic. Firefox, for example, can take several minutes simply to start and display your home page on slow connections. But some applications are fairly reasonable, especially on a broadband connection such as DSL or Cable. Feel free to experiment with various settings. Many X servers support options that will speed up performance over low bandwidth connections such as caching data, or not refreshing windows that aren’t in focus. Turning on compression in your SSH client can also help in some situations.

If you run into problems, you may need to search the web for other options. If you find something useful, feel free to e-mail us at support@cat.pdx.edu, and we will be glad to add it here.