Skip to content
Snippets Groups Projects
x-window-system.md 6.66 KiB
Newer Older
Lukáš Krupčík's avatar
Lukáš Krupčík committed
# X Window System
Lukáš Krupčík's avatar
Lukáš Krupčík committed

The X Window system is a principal way to get GUI access to the clusters. The **X Window System** (commonly known as **X11**, based on its current major version being 11, or shortened to simply **X**, and sometimes informally **X-Windows**) is a computer software system and network [protocol](http://en.wikipedia.org/wiki/Protocol_%28computing%29 "Protocol (computing)") that provides a basis for [graphical user interfaces](http://en.wikipedia.org/wiki/Graphical_user_interface "Graphical user interface") (GUIs) and rich input device capability for [networked computers](http://en.wikipedia.org/wiki/Computer_network "Computer network").
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
!!! tip
    The X display forwarding must be activated and the X server running on client side
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## X display
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
In order to display graphical user interface GUI of various software tools, you need to enable the X display forwarding. On Linux and Mac, log in using the -X option tho ssh client:
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
 local $ ssh -X username@cluster-name.it4i.cz
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## X Display Forwarding on Windows
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
On Windows use the PuTTY client to enable X11 forwarding. In PuTTY menu, go to Connection-SSH-X11, mark the Enable X11 forwarding checkbox before logging in. Then log in as usual.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

To verify the forwarding, type

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
$ echo $DISPLAY
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

if you receive something like

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
localhost:10.0
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

then the X11 forwarding is enabled.

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## X Server
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
In order to display graphical user interface GUI of various software tools, you need running X server on your desktop computer. For Linux users, no action is required as the X server is the default GUI environment on most Linux distributions. Mac and Windows users need to install and run the X server on their workstations.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## X Server on OS X
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Pavel Jirásek's avatar
Pavel Jirásek committed
Mac OS users need to install [XQuartz server](https://www.xquartz.org).
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## X Server on Windows
Lukáš Krupčík's avatar
Lukáš Krupčík committed

There are variety of X servers available for Windows environment. The commercial Xwin32 is very stable and rich featured. The Cygwin environment provides fully featured open-source XWin X server. For simplicity, we recommend open-source X server by the [Xming project](http://sourceforge.net/projects/xming/). For stability and full features we recommend the
[XWin](http://x.cygwin.com/) X server by Cygwin
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
| How to use Xwin                                                                                                                                                                                                         | How to use Xming                                                                                     |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
Pavel Jirásek's avatar
Pavel Jirásek committed
| [Install Cygwin](http://x.cygwin.com/) Find and execute XWin.exe to start the X server on Windows desktop computer.[If no able to forward X11 using PuTTY to CygwinX](#if-no-able-to-forward-x11-using-putty-to-cygwinx) | Use Xlaunch to configure the Xming. Run Xming to start the X server on Windows desktop computer. |
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Read more on [http://www.math.umn.edu/systems_guide/putty_xwin32.html](http://www.math.umn.edu/systems_guide/putty_xwin32.shtml)
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## Running GUI Enabled Applications
Lukáš Krupčík's avatar
Lukáš Krupčík committed

!!! Note "Note"
Lukáš Krupčík's avatar
Lukáš Krupčík committed
    Make sure that X forwarding is activated and the X server is running.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Then launch the application as usual. Use the & to run the application in background.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
$ module load intel (idb and gvim not installed yet)
$ gvim &
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
$ xterm
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
In this example, we activate the intel programing environment tools, then start the graphical gvim editor.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## GUI Applications on Compute Nodes
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Allocate the compute nodes using -X option on the qsub command

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
$ qsub -q qexp -l select=2:ncpus=24 -X -I
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
In this example, we allocate 2 nodes via qexp queue, interactively. We request X11 forwarding with the -X option. It will be possible to run the GUI enabled applications directly on the first compute node.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
**Better performance** is obtained by logging on the allocated compute node via ssh, using the -X option.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
$ ssh -X r24u35n680
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
In this example, we log in on the r24u35n680 compute node, with the X11 forwarding enabled.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## The Gnome GUI Environment
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
The Gnome 2.28 GUI environment is available on the clusters. We recommend to use separate X server window for displaying the Gnome environment.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## Gnome on Linux and OS X
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
To run the remote Gnome session in a window on Linux/OS X computer, you need to install Xephyr. Ubuntu package is
xserver-xephyr, on OS X it is part of [XQuartz](http://xquartz.macosforge.org/landing/). First, launch Xephyr on local machine:
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
local $ Xephyr -ac -screen 1024x768 -br -reset -terminate :1 &
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

David Hrbáč's avatar
David Hrbáč committed
This will open a new X window with size 1024 x 768 at DISPLAY :1. Next, ssh to the cluster with DISPLAY environment variable set and launch  gnome-session
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
local $ DISPLAY=:1.0 ssh -XC yourname@cluster-name.it4i.cz -i ~/.ssh/path_to_your_key
... cluster-name MOTD...
David Hrbáč's avatar
David Hrbáč committed
yourname@login1.cluster-namen.it4i.cz $ gnome-session &
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
On older systems where Xephyr is not available, you may also try Xnest instead of Xephyr. Another option is to launch a new X server in a separate console, via:
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
xinit /usr/bin/ssh -XT -i .ssh/path_to_your_key yourname@cluster-namen.it4i.cz gnome-session -- :1 vt12
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
However this method does not seem to work with recent Linux distributions and you will need to manually source
/etc/profile to properly set environment variables for PBS.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
## Gnome on Windows
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Use Xlaunch to start the Xming server or run the XWin.exe. Select the "One window" mode.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Log in to the cluster, using PuTTY. On the cluster, run the gnome-session command.
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
```bash
Lukáš Krupčík's avatar
Lukáš Krupčík committed
$ gnome-session &
Lukáš Krupčík's avatar
Lukáš Krupčík committed
```
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
In this way, we run remote gnome session on the cluster, displaying it in the local X server
Lukáš Krupčík's avatar
Lukáš Krupčík committed

Lukáš Krupčík's avatar
Lukáš Krupčík committed
Use System-Log Out to close the gnome-session

### If no able to forward X11 using PuTTY to CygwinX

```bash
[usename@login1.anselm ~]$ gnome-session &
[1] 23691
[usename@login1.anselm ~]$ PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused
PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused

  (gnome-session:23691): WARNING **: Cannot open display:**
```

David Hrbáč's avatar
David Hrbáč committed
1.  Locate and modify Cygwin shortcut that uses [startxwin](http://x.cygwin.com/docs/man1/startxwin.1.html)
    locate
    C:cygwin64binXWin.exe
    change it
    to
David Hrbáč's avatar
David Hrbáč committed
    C:_cygwin64binXWin.exe -listen tcp_

![XWin-listen-tcp.png](../../../img/XWinlistentcp.png "XWin-listen-tcp.png")

David Hrbáč's avatar
David Hrbáč committed
1.  Check Putty settings:
     Enable X11 forwarding

    ![](../../../img/cygwinX11forwarding.png)