From MetaCentrum
Jump to: navigation, search

Notice: Although this manual is still valid, more effective way to use applications with GUI is described on page Remote desktop.

X-window is a system for sharing the graphical interface of applications (windows) through network. In MetaCentrum you can use it for accessing the graphical interface of certain programs (like Matlab, Maple or SNAPP) running in clusters from the user's desktop.

In common

GUI of unix systems are build on X-Window system, which supposes, that a program and his GUI run on different computers in net. Programs in X-Window system display their GUI on so called X-server which is defined by environment variable DISPLAY.

For example: We are sitting in front of computer named jenicek and start up X-Window program in machine called marenka. If we set variable DISPLAY=jenicek:0 on marenka and if X-server is running in jenicek, execution of a program will be running in a remote computer, but will be displaying on screen in front us and reacting on keyboard an mouse on our table.

There are X-servers for MS Windows, for example Xming, Cygwin/X, X-Win32, ReflectionX and Exceed

You can use programs with GUI in MetaCentrum, if this programs supports X-Window.

Usually it´s not necessary to set manually the variable DISPLAY, it´s set by ssh run with the option for X11 tunneling.

  • Windows – You should set and fill the correct PuTTy options or use the plink program from complete PuTTy installation and then use the Linux approach.
  • Unix/Linux – You should add the option -X to ssh command. So like: ssh -X.

After the frontend connection with allowed X11 tunneling you should specify the parameter -X for the qsub. So qsub -X sets the DISPLAY variable on the granted machine. See more info in article Intertive jobs.

X-protocol tunneling

The simplest way how to use X-window in MetaCentrum is to submit an interactive job with X-protocol tunneling enabled by the option -X for both ssh and qsub:

jenicek$ ssh -X skirit.metacentrum.cz

skirit$ qsub -X -I -l select=1:ncpus=2:mem=4gb:scratch_local=10gb -l walltime=1:00:00 -l matlab=1

konos6$ echo $DISPLAY

konos6$ module add matlab ; matlab

Direct connection by X-protocol

If you need a direct connection by X-protocol, for example because of reduced latency, you can set the DISPLAY variable on the computing machine to the name of your personal machine:

jenicek$ ssh skirit.metacentrum.cz

skirit$ qsub -I -l select=1:ncpus=2:mem=4gb:scratch_local=10gb -l walltime=1:00:00 -l matlab=1

konos6$ echo $DISPLAY

konos6$ export DISPLAY=jenicek.ics.muni.cz:0

konos6$ module add matlab ; matlab

On your machine (jenicek.ics.muni.cz in this example) you have to allow incoming connections by

jenicek$ xhost +

and make sure that your X-server does not have disabled incoming connections. For example, the standard setting on Ubuntu is to start X-server with the options -nolisten tcp that disables incoming connections.

Step by step

For Windows users

PuTTy setting for X11 tunnel
  1. Install Xming. Run it.
  2. Install PuTTy. Run it.
  3. Set the connection parameters in PuTTy according the image in right and save it.
  4. Connect with set up parameters to some frontend.
  5. Run your interactive job.

For Linux users

  1. Run the graphical terminal.
  2. Connect to some frontend. To do it type the command ssh -X name_of_frontend.
  3. Run the interactive job.
  4. If the error about missing rights to use Xserver occurs, return to point 2 but before connection to the frontend type command xhost +.