On my personal computer, how do I use X forwarding to securely run graphical applications installed on IU's research computing systems?

The X Window System (also known as X11, or just X) is a software package and network protocol that lets you interact locally, using your personal computer's display, mouse, and keyboard, with the graphical user interface (GUI) of an application running on a remote networked computer.

Using X forwarding in an SSH session on your personal computer allows you to securely run graphical applications (i.e., X clients) installed on the Indiana University research computing systems.

On this page:


Requirements

For X forwarding in SSH to work your personal computer must be running an X server program. The X server program manages the interaction between the remote application (i.e., the X client) and your computer's graphics hardware and input devices.

Most Linux distributions have the X server installed, but if your personal computer is running Windows or Mac OS X 10.8 and later, you will most likely need to install and run an X server application, for example:

  • For Windows, download and install Xming. For X forwarding to work, you'll need to start Xming before connecting to the remote system with your SSH client (e.g., PuTTY).
  • For Mac OS X 10.8 and later, download and install XQuartz. For X forwarding to work, you'll need to start XQuartz before making an SSH connection to the remote system. Once XQuartz launches, you can use X forwarding with SSH from the Mac OS X Terminal or from the xterm application in XQuartz.

Additionally, your personal computer's SSH terminal application must have X11 forwarding enabled:

  • In Linux, the SSH terminal supports X forwarding by default.
  • In Mac OS X, you may need to edit your sshd_config file (typically found at /etc/sshd_config or /etc/ssh/sshd_config) if you have trouble using X forwarding. If sshd_config includes #X11Forwarding no (or just X11Forwarding no), uncomment out the line (i.e., remove the leading #), and change it to X11Forwarding yes.
  • In PuTTY for Windows, you can enable X forwarding new or saved SSH sessions by selecting Enable X11 forwarding in the "PuTTY Configuration" window (Connection  > SSH > X11).

Also, the remote computer's SSH application must be configured to accept X server connections. At IU, Big Red II, Carbonate, Karst, and Mason all have SSH configured to allow X forwarding (trusted mode only).

Using SSH with X forwarding

Linux or Mac OS X

To use SSH with X forwarding from your Linux or Mac OS X personal computer to run an X client application installed on Big Red II, Carbonate, Karst, or Mason at IU:

  1. Open the SSH terminal client.
  2. On the command line, enter (replacing username with your IU username):
    • For Big Red II:
        ssh -Y username@bigred2.uits.iu.edu
    • For Carbonate:
        ssh -Y username@carbonate.uits.iu.edu
    • For Karst:
        ssh -Y username@karst.uits.iu.edu
    • For Mason:
        ssh -Y username@mason.indiana.edu
    Note:
    The -Y option turns on trusted X forwarding. You should use it only when connecting to secure systems, such as the IU research computers.
  3. Log in with your IU passphrase.

To test if X forwarding is working, try running xclock; on the command line, enter:

  xclock

If X forwarding is working, the xclock graphical clock will appear on your personal computer's desktop.

PuTTY for Windows

To use SSH with X forwarding in PuTTY for Windows:

  1. Launch your X server application (e.g., Xming).
  2. Make sure your connection settings for the remote system have Enable X11 forwarding selected; in the "PuTTY Configuration" window, see Connection  > SSH > X11.
  3. Open an SSH session to the desired remote system:
    • bigred2.uits.iu.edu
    • carbonate.uits.iu.edu
    • karst.uits.iu.edu
    • mason.indiana.edu
  4. Log in normally with your IU username and passphrase.

To test if X forwarding is working, try running xclock; on the command line, enter:

  xclock

If X forwarding is working, the xclock graphical clock will appear on your personal computer's desktop.

Using X forwarding for interactive sessions

On Carbonate, Karst, or Mason

On Carbonate, Karst, or Mason, if your interactive session requires:

  • Less than 20 minutes of processor time: Connect via SSH with X forwarding enabled, and then launch the X client from the command line.
  • More than 20 minutes of processor time: Submit a request for an interactive job via the batch system.

    To do so, connect via SSH with X forwarding enabled, and then:

    1. Use the TORQUE qsub command to submit an interactive job request. Add the -I (for interactive) and -X (for X forwarding) flags; for example (on Karst):
        [username@h2 ~]$ qsub -I -X -q interactive -l nodes=1:ppn=1,walltime=1:00:00
        qsub: waiting for job 371037.m2 to start
        qsub: job 371037.m2 ready
        . . . . 
        [username@c5 ~]$ 
    2. If the X client is not already added to your user environment, load the appropriate module; for example:
        [username@c5 ~]$ module load matlab
    3. From the command prompt, launch the X client; for example:
        [username@c5 ~]$ matlab

On Big Red II

Do not run interactive sessions on the Big Red II login nodes. Instead, submit a request for an interactive job via the batch system, and then launch your X client on a compute node in the the Cluster Compatibility Mode (CCM) execution environment (X applications are not compatible with the Extreme Scalability Mode environment).

To do so, SSH to Big Red II with X forwarding enabled, and then:

  1. Use the TORQUE qsub command to submit an interactive job request. Add the -l gres=ccm (CCM execution environment) flag, as well as the -I (interactive) and -X (X forwarding) flags, to your qsub command; for example, at the command prompt, enter:
      username@login1:~> qsub -I -X -l walltime=00:45:00 -l nodes=1:ppn=32 -l gres=ccm -q cpu

    When the required resources are available, your job will start, the CCM environment will initialize, and you will be placed on an aprun node:

      qsub: waiting for job 158932 to start
      qsub: job 158932 ready
      
      In CCM JOB:  158932  JID  158932  USER  username  GROUP  uits
      Initializing CCM environment, Please Wait
      waiting for jid....
      CCM Start success, 1 of 1 responses
      Directory: /N/u/username/BigRed2
      Tue Oct 15 14:55:50 EDT 2013
      username@aprun1:~>
  2. From the aprun node command prompt, load the ccm module, and then enter the ccmlogin command to be placed on a compute node (e.g., nid00860):
      username@aprun1:~> module load ccm
      username@aprun1:~> ccmlogin
      Warning: Permanently added '[nid00860]:203' (RSA) to the list of known hosts.
      username@nid00860:~>
    Note:
    Alternatively, to avoid having to load the necessary modules each time you run an interactive session, you can add the necessary module load commands to your ~/.modules file. For more, see In Modules, how do I save my environment with a .modules file?
  3. Once you are placed on a compute node, you can launch graphical X applications (e.g., xterm), as well as your own binaries, from the command line. Depending on the application and your ~/.modules file, you may need to load the module for the desired X client before launching the application.

    For example, to load the matlab module, and then launch the MATLAB GUI client, at the compute node command prompt, enter:

      username@nid00860:~> module load matlab
      username@nid00860:~> matlab

Getting help

Support for IU research computing systems, software, and services is provided by various UITS Research Technologies units. For help, see Research computing support at IU.

For more about using Modules to configure your user environment, see On the research computing systems at IU, how do I use Modules to manage my software environment?

Back to top

This is document bdnt in the Knowledge Base.
Last modified on 2017-08-04 15:40:05.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.