Remote Linux Applications over SSH

Graphical applications can be run over an SSH connection. This is called ‘X11 Forwarding’ and requires an X server for Windows and a configuration of your SSH client in Linux, UNIX and Mac.

Setting up X11 on Mac

Using Terminal and X11 requires the installation of Xcode Tools. An official package from Apple can be found here.

Installing XQuartz

  1. Download XQuartz from Xquartz Project page.
  2. Locate the downloaded file in your "Downloads" directory and double click on it to open the package.
  3. Click "Continue".
  4. Follow the on-screen instructions to install the software.
  5. After the installation is complete, log out and log back in in order for changes to take effect.

After the installation is complete, you should be able to use Xquartz via the terminal and run SSH with "-X" option. If you experience any issues, the X11-UsersFAQ page has useful troubleshooting information.

Setting up X11 on Windows

The X server that’s easiest to configure is Xming, which is what CSE-IT recommends. Other options include X-Win32 (commercial) and Cygwin (open source). Xming is installable on CSE Windows computers via the Software Center.

Xming Installation and Configuration

  1. If you're using a supported Windows workstation in the College, install Xming via the Software Center.
  2. If you're using a personal Windows computer, download Xming. Install Xming by running the setup.exe file and selecting “Next” for all of the installer prompts.
  3. After the package is installed, if Xming isn't already running, click on the icon created by the installation program in the Start menu.
  4. If you see a popup about your Windows firewall, set your desired firewall settings based on the networks your local system will be using and select "Allow access".
  5. You should see Xming's X icon in the system tray. Launch your SSH client.
  6. In your SSH client, verify that X11 forwarding is properly configured as outlined below under "Configure an SSH client with X11".
  7. Now you can open a connection to the remote machine and run X11 applications from it. 'xeyes' is a small, graphical Linux program that can confirm that X is working.

Configure an SSH client with X11

The following SSH clients have different ways of enabling X11 forwarding.

OpenSSH - Commonly used in Linux/UNIX and Mac terminals

  1. Add a ‘-X’ flag to your SSH command, such as 'ssh -X user@computer.domain'
  2. To make the change permanent in Linux, edit /etc/ssh/ssh_config and make sure that “ForwardX11” is set to “yes.”

PuTTY - Windows

  1. PuTTY is pre-installed on most CSE computers and is available in the Software Center or to download to your personal computer. Start the application.
  2. If you already have a session saved, load it now. In the category menu, click Connection -> SSH -> X11.
  3. Check ‘Enable X11 Forwarding’.
  4. In the category menu, click on Session. Under Host Name enter the name of the UNIX computer you would like to connect to.
  5. Set the Protocol to SSH. Under Saved Sessions type a name for this connection and click save, or save your new settings to an existing session. From now on you may double-click the name of this session and it will automatically begin connecting.