JUSTUS2/Visualization: Difference between revisions

From bwHPC Wiki
Jump to navigation Jump to search
No edit summary
 
(124 intermediate revisions by 4 users not shown)
Line 1: Line 1:

{| width=600px class="wikitable"
|-
! Description !! Content
|-
| module load
| vis/tigervnc
|-
| Availability
| [[bwUniCluster_2]] | [[BwForCluster_JUSTUS_2]]
|-
| License
| GPL
|-
| Citing
| n/a
|-
| Links
| [http://www.tigervnc.org/ TigerVNC Homepage]
|-
| Graphical Interface
| No
|}
= Description =
= Description =


'''TigerVNC''' is a high-performance implementation of Virtual Network Computing (VNC). VNC is a client/server application that allows
Virtual Network Computing (VNC) is a protocol to use a virtual desktop on a server on your local computer. It allows you to launch and use graphical applications on remote machines.
users to launch and interact with graphical applications on remote machines. It is usually faster than standard X11 forwarding and thus should
be used if a graphical software feels slow and has bad responsiveness.


= Availability =


TigerVNC is a high-performance implementation of VNC and is installed on JUSTUS2 as the [[Software Module]] vis/tigervnc
TigerVNC is available on selected bwHPC-Clusters. A complete list of versions currently installed on the bwHPC-Clusters can be obtained from the [https://www.bwhpc.de/software.html Cluster Information System (CIS)].

= Overview =

You will need to do the following steps to use VNC on the cluster:
* start a vnc server on the cluster - This will create a virtual desktop on that node
* make an ssh tunnel to allow outside access for yourself to the server
* use a vnc client on your home desktop to connect to the virtual desktop
* kill the vnc server after you finshed


= VNC Server =
= VNC Server =
Line 35: Line 19:
First, you have to start the VNC Server on the cluster. The startup procedure depends on the cluster and hardware you are using.
First, you have to start the VNC Server on the cluster. The startup procedure depends on the cluster and hardware you are using.


The commands below will also work on the login nodes, but if you want to do graphically intensive tasks such as visualizing systems of molecules you should use the visualization nodes with high-performance graphics cards. Note: To actually use the graphics cards on the vis nodes, you will have to put the command "vglrun" before the graphical command you want to run accelerated on the graphic cards.
* [[VNC Server - bwUniCluster 2.0]]

* [[VNC Server - bwForCluster Chemistry]]
To start a VNC Server on a visualization node you must log into one of these nodes via SSH using your username and password:
* [[VNC Server - bwForCluster Chemistry - 3D Acceleration]]
$ ssh <UserID>@justus2-vis.uni-ulm.de

Subsequently, use the following commands to start the VNC Server:
$ module load vis/tigervnc
$ run_vncserver

If you start a VNC Server for the first time you will be asked to set a password which will be required for clients trying to access your VNC desktop. '''Use a strong password because otherwise an attacker could take control of your VNC session.'''

The VNC server will open a virtual display with a display number. It will e.g. be called ":01"

= Create a Tunnel =

* VNC port: The connection port is on 59XX. A display :01 will have port 5901, a display :02 will have port 5902 etc.

The script <code>run_vncserver </code> gives you instructions on how to create the tunnel. It will fill in the correct user name and port for your case.

* '''Linux/Unix Commandline'''
<code>ssh -fCL port:localhost:port user@justus2-login03.rz.uni-ulm.de</code>

-f: sends the ssh into the background # note that you will have to kill the ssh session if you use this option

-C: compress all data

-L local_port:host:hostport: "local" port forwarding. The port on the remote machine can be accessed on the machine from where you run ssh

If you have to go via more than one linux machine, you can chain several of these ssh tunnels.

* '''Putty on Windows '''
<code> Connection -> SSH -> Tunnels</code>

Source Port: 59XX

Destination: justus2-login03.rz.uni-ulm.de:59XX

* ''' TightVNC (Java Client) '''

This client (and only the Java version of the client!) allows to configure ssh tunneling as part of opening the VNC connection. See description in the following client section


= VNC Client =
= VNC Client =
Line 43: Line 64:
The startup script of the VNC Server should have printed out detailed instructions about how to establish a connection to the VNC Server from your local computer. These instructions depend on the operating system (e.g., Linux/macOS, MS Windows) you are using and if you work with TurboVNC Java Viewer which is a tool that can simplify the handling but needs the Java Development Kit (JDK) to run. Therefore, the next steps are divided into three cases. The commands should be executed on the local computer.
The startup script of the VNC Server should have printed out detailed instructions about how to establish a connection to the VNC Server from your local computer. These instructions depend on the operating system (e.g., Linux/macOS, MS Windows) you are using and if you work with TurboVNC Java Viewer which is a tool that can simplify the handling but needs the Java Development Kit (JDK) to run. Therefore, the next steps are divided into three cases. The commands should be executed on the local computer.


* '''Login using TurboVNC Java Viewer''' <br />Needed software: [http://turbovnc.org/ TurboVNC 2.0], JDK<br /> Open TurboVNC Java Viewer. Go to Options... -> Security -> Gateway and fill in the parameters provided by the ''run_vncserver'' script. You can save these settings in the "Global" tab if you want to. Now you can click "OK", supply the VNC server and connect to the server. You should be prompted for your ssh password and your VNC password and after that the connection is established.
* '''Login using TurboVNC Java Viewer''' <br />Needed software: [http://turbovnc.org/ TurboVNC], JDK<br /> Open the TurboVNC Java Viewer and navigate to Options... -> Security -> Gateway to fill in the parameters provided by the ''run_vncserver'' script. You can save these settings in the "Global" tab if you want to. Subsequently, click "OK" and connect to the cluster by supplying the VNC Server as given to you by ''run_vncserver''. Before the connection is established, you should be prompted for your SSH and VNC password, respectively.
{| style="width: 100%; border-spacing: 20px;"
| [[File:turbovnc.jpg|left|500px]]
|}


* '''TigerVNCLinux Debian-based''' <code>sudo apt install tigervnc-viewer</code> fill in information supplied by ''run_vncserver'', e.g. <code>xtigervncviewer :3</code>
* '''Login using TightVNC Java Viewer'''<br /> Needed Software: [http://www.tightvnc.com/download.php/] Choose "TightVNC Java Viewer JAR in a ZIP archive". Unzip to get the jar file. Run with a double click or with <br /><code>java -jar tightvnc-jviewer.jar</code><br/> Fill in information from run_vncserver script (see picture. Adjust the data in red circles to match your user and VNC server).
[[File:Tightvnc.png|center|tightvnc login window]]


* '''Login without TurboVNC Java Viewer for Linux users'''<br />Needed Software: A VNC viewer such as tigervnc or turbovnc<br />A tunnel must be created with the ssh command given by the ''run_vncserver'' script. Open a new terminal, start a VNC viewer and connect to localhost:n, where n is the display number printed by ''run_vncserver'', using a command such like this<br /><pre>$ vncviewer localhost:1</pre>
* '''Login using TightVNC Java Viewer''' <br />Needed software: [http://www.tightvnc.com/download.php TightVNC] <br />Start the TightVNC Viewer: On Linux, open a terminal and execute the following command: <code>$ java -jar tightvnc-jviewer.jar</code>. On Windows, just double-click ''tightvnc-jviewer.jar'' in the Windows Explorer. <br />Fill in the parameters given to you by the ''run_vncserver'' script (see example below), add your username at SSH User, and press connect to establish a VNC session.


{| style="width: 100%; border-spacing: 20px;"
* '''Login without TurboVNC Java Viewer for Windows users'''<br />Needed Software: [https://sourceforge.net/projects/tigervnc/files/tigervnc/1.3.0 tigervnc], [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty]<br />You need to start Putty and go to Connection -> SSH -> Tunnels. Fill in the parameters provided by ''run_vncserver''. After you clicked "Add" you must navigate to Session and connect to the bwUniCluster with your username and password. Once the connection is established start the tigervnc client and connect to localhost:n where n is the display number printed by ''run_vncserver''.
| [[File:TightVNC.png|left|500px]]
<br>
|}


* '''Login without TurboVNC Java Viewer for Linux users''' <br />Needed software: A VNC Client such as TurboVNC <br />A SSH tunnel must be created with the command given to you by the ''run_vncserver'' script, e.g.: <code>$ ssh -fCL 5903:localhost:5903 <UserID>@justus2-vis01.rz.uni-ulm.de</code> <br />Start your VNC Client and connect to localhost:n, where n is the display number, using the command given to you by the ''run_vncserver'' script. E.g.: <code>$ vncviewer localhost:3</code>
= Shutdown =

To exit your VNC session it is not sufficient to only close the window of the viewer, because this will not terminate the VNC server. The server will keep running and you will run into problems
* '''Login without TurboVNC Java Viewer for Windows users'''<br />Needed software: [https://tigervnc.org/ TigerVNC], [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Putty] <br />Start Putty and navigate to Connection -> SSH -> Tunnels to fill in the parameters provided by the ''run_vncserver'' script. Subsequently, clicked "Add" and navigate to Session to connect with the cluster using your username and password. Once the connection is established, start the TigerVNC Client and connect to localhost:n, where n is the display number provided by ''run_vncserver''.
when you try to start a new VNC session later on. Please use the "log out" function of the desktop environment inside the VNC session, this will terminate the server properly.
[[Category:visualization]][[Category:bwUniCluster]]
<br>
<br>

<br>
= Starting OpenGL programs =
= OpenGL applications within VNC sessions =

Starting an OpenGL program in a 3D accelerated VNC session results in an error message. In order to fix this issue and redirect OpenGL commands to the graphics card on the cluster you have to use the vglrun command like in the following example:
Executing an OpenGL program during a 3D accelerated VNC session will issue an error. In order to fix this, open a terminal window and run your application through the VirtualGL wrapper using the vglrun command like in the following example for the benchmark application glxgears:
$ vglrun glxgears -info
<pre>
$ vglrun glxgears -info
</pre>



= Shutdown your VNC session =

To exit your VNC session it is not sufficient to only close the VNC viewer, since this will not terminate the VNC Server. The VNC Server will keep running and you will run into problems when you try to start a new VNC session later on. Please use the "log out" function of the desktop environment inside the VNC session, this will terminate the VNC server properly. Alternatively, you can terminate the VNC Server on the compute cluster using
<pre>
$ vncserver -kill :n
</pre>
with n specifying the display number.

Latest revision as of 10:39, 21 May 2024

Description

Virtual Network Computing (VNC) is a protocol to use a virtual desktop on a server on your local computer. It allows you to launch and use graphical applications on remote machines.


TigerVNC is a high-performance implementation of VNC and is installed on JUSTUS2 as the Software Module vis/tigervnc

Overview

You will need to do the following steps to use VNC on the cluster:

  • start a vnc server on the cluster - This will create a virtual desktop on that node
  • make an ssh tunnel to allow outside access for yourself to the server
  • use a vnc client on your home desktop to connect to the virtual desktop
  • kill the vnc server after you finshed

VNC Server

First, you have to start the VNC Server on the cluster. The startup procedure depends on the cluster and hardware you are using.

The commands below will also work on the login nodes, but if you want to do graphically intensive tasks such as visualizing systems of molecules you should use the visualization nodes with high-performance graphics cards. Note: To actually use the graphics cards on the vis nodes, you will have to put the command "vglrun" before the graphical command you want to run accelerated on the graphic cards.

To start a VNC Server on a visualization node you must log into one of these nodes via SSH using your username and password:

$ ssh <UserID>@justus2-vis.uni-ulm.de

Subsequently, use the following commands to start the VNC Server:

$ module load vis/tigervnc
$ run_vncserver

If you start a VNC Server for the first time you will be asked to set a password which will be required for clients trying to access your VNC desktop. Use a strong password because otherwise an attacker could take control of your VNC session.

The VNC server will open a virtual display with a display number. It will e.g. be called ":01"

Create a Tunnel

  • VNC port: The connection port is on 59XX. A display :01 will have port 5901, a display :02 will have port 5902 etc.

The script run_vncserver gives you instructions on how to create the tunnel. It will fill in the correct user name and port for your case.

  • Linux/Unix Commandline

ssh -fCL port:localhost:port user@justus2-login03.rz.uni-ulm.de

-f: sends the ssh into the background # note that you will have to kill the ssh session if you use this option

-C: compress all data

-L local_port:host:hostport: "local" port forwarding. The port on the remote machine can be accessed on the machine from where you run ssh

If you have to go via more than one linux machine, you can chain several of these ssh tunnels.

  • Putty on Windows

Connection -> SSH -> Tunnels

Source Port: 59XX

Destination: justus2-login03.rz.uni-ulm.de:59XX

  • TightVNC (Java Client)

This client (and only the Java version of the client!) allows to configure ssh tunneling as part of opening the VNC connection. See description in the following client section

VNC Client

The startup script of the VNC Server should have printed out detailed instructions about how to establish a connection to the VNC Server from your local computer. These instructions depend on the operating system (e.g., Linux/macOS, MS Windows) you are using and if you work with TurboVNC Java Viewer which is a tool that can simplify the handling but needs the Java Development Kit (JDK) to run. Therefore, the next steps are divided into three cases. The commands should be executed on the local computer.

  • Login using TurboVNC Java Viewer
    Needed software: TurboVNC, JDK
    Open the TurboVNC Java Viewer and navigate to Options... -> Security -> Gateway to fill in the parameters provided by the run_vncserver script. You can save these settings in the "Global" tab if you want to. Subsequently, click "OK" and connect to the cluster by supplying the VNC Server as given to you by run_vncserver. Before the connection is established, you should be prompted for your SSH and VNC password, respectively.
Turbovnc.jpg
  • TigerVNCLinux Debian-based sudo apt install tigervnc-viewer fill in information supplied by run_vncserver, e.g. xtigervncviewer :3
  • Login using TightVNC Java Viewer
    Needed software: TightVNC
    Start the TightVNC Viewer: On Linux, open a terminal and execute the following command: $ java -jar tightvnc-jviewer.jar. On Windows, just double-click tightvnc-jviewer.jar in the Windows Explorer.
    Fill in the parameters given to you by the run_vncserver script (see example below), add your username at SSH User, and press connect to establish a VNC session.
TightVNC.png
  • Login without TurboVNC Java Viewer for Linux users
    Needed software: A VNC Client such as TurboVNC
    A SSH tunnel must be created with the command given to you by the run_vncserver script, e.g.: $ ssh -fCL 5903:localhost:5903 <UserID>@justus2-vis01.rz.uni-ulm.de
    Start your VNC Client and connect to localhost:n, where n is the display number, using the command given to you by the run_vncserver script. E.g.: $ vncviewer localhost:3
  • Login without TurboVNC Java Viewer for Windows users
    Needed software: TigerVNC, Putty
    Start Putty and navigate to Connection -> SSH -> Tunnels to fill in the parameters provided by the run_vncserver script. Subsequently, clicked "Add" and navigate to Session to connect with the cluster using your username and password. Once the connection is established, start the TigerVNC Client and connect to localhost:n, where n is the display number provided by run_vncserver.


OpenGL applications within VNC sessions

Executing an OpenGL program during a 3D accelerated VNC session will issue an error. In order to fix this, open a terminal window and run your application through the VirtualGL wrapper using the vglrun command like in the following example for the benchmark application glxgears:

$ vglrun glxgears -info


Shutdown your VNC session

To exit your VNC session it is not sufficient to only close the VNC viewer, since this will not terminate the VNC Server. The VNC Server will keep running and you will run into problems when you try to start a new VNC session later on. Please use the "log out" function of the desktop environment inside the VNC session, this will terminate the VNC server properly. Alternatively, you can terminate the VNC Server on the compute cluster using

$ vncserver -kill :n

with n specifying the display number.