Skip to end of banner
Go to start of banner

Use Graphical (GUI) Programs with X over SSH

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Graphical applications on Pawsey supercomputers are typically based on the X Window System (external site), also known as X11 or simply shortened to X. Typical examples of these applications are debuggers and profilers. Here we explain how to use the X forwarding option of SSH to view and control these applications remotely.

On this page:

Preliminaries

Although X can be used remotely without SSH, it is insecure and blocked by most firewalls. SSH X forwarding fixes both these issues and also sets automatically the DISPLAY environment variable.

As an alternative to X over SSH, you can use the higher performance VNC over SSH, which performs faster for long-distance connections. See the separate documentation for details.

Even when running with a GUI, use compute nodes for memory-intensive or cpu-intensive operations

Preparation for macOS

Current macOS operating systems do not have the X windows system. Mac users should install the XQuartz (external site) package to use SSH with X forwarding. After the installation, users may also need to indicate the path where the xauth program is. To do so, users must edit the ~/.ssh/config file and add the path under The Host * entry, as shown in listing 1.

Listing 1. Contents of the ~/.ssh/config file.
Host *
 XAuthLocation /opt/X11/bin/xauth

Running a GUI application over SSH

For Linux, macOS and Windows (MobaXterm), the user opens a local terminal window and executes ssh with the X forwarding option -X.

$ ssh -X <username>@<hostname>

Some sites recommend using the -Y flag instead. While this can fix some compatibility issues, the -X flag is more secure.

The user can test this option by running the xclock command, that shows an analogical clock with the current time, on the remote host. This is shown in terminal 2.

Terminal 2. Execute xclock for X.
$ ssh -X <username>@setonix.pawsey.org.au
##############################################################################
#                    Pawsey Supercomputing Centre                            #
#        Empowering cutting-edge research for Australia's future             #
#                                                                            #
#     This service is for authorised clients only.                           #
#     It is a criminal offence to:                                           #
#          - Obtain access to data without permission                        #
#          - Damage, delete, alter or insert data without permission         #
#                                                                            #
##############################################################################
.
.
.
===============================================================================
<username>@setonix:~> xclock

The graphical clock running on the supercomputer should be displayed as shown in figure 1.



Figure 1. xclock running as an example of X applications.

Improved Performance

X forwarding over SSH does not perform well over long distances. The user can try to improve performance over long distances with SSH compression. This can be activated by using the -C option in the ssh command line:

$ ssh -X -C <username>@<remotehost>

As an alternative to the command-line option, the user can add the following line to the ~/.ssh/config file on the local machine.

Compression=yes


SSH compression will not make too much difference for short distances.

Related pages





  • No labels