VNC Desktop
VNC (Virtual Network Computing) is a cross-platform desktop-sharing system that can be used to remotely control another computer. As a VNC client, the user can display the desktop of the remote VNC server on their local screen. This guide explains how to establish the VNC connection to access the desktop interface on our Marin nodes.
This manual can be downloaded as PDF file here.
1. Start the VNC-Server on Marin nodes
On a Marin node (e.g. marin02) start the VNC server with the following command
U*****@marin02:~> vncserver -localhost no -PAMService tigervnc -SecurityTypes TLSPlain
The output of the above command is as follows:
„New 'marin02.cen.uni-hamburg.de:2 (u*****)' desktop at :2 on machine marin02.cen.uni-hamburg.de”
Remember this output for the connection on the client.
2. Connect desktop on VNC-Clients in the office
In this case, the client computers running Linux/Windows are in the CEN network.
2.1 On a Linux client computer in the office
- Start the VNC-Viewer using the command “vncviewer” in the Terminal.
- In the VNC-Viewer connection window (Fig. 1)
Enter the VNC-Server and the display number, which must be the same as the output when starting the VNC-Server on Marin.
Fig.1 VNC-Viewer Connection window
- In the VNC Authentication window (Fig. 2)
Enter the “Username” and “Password” to log in. After the connection is established, the graphical desktop will be displayed locally.
Fig 2. VNC Authentication window
2.2 On a Windows client computer in the office
- Start “TigerVNC Viewer” by clicking on the icon (the software “vncviewer64-***.exe” can be downloaded and then directly executed, if it is not already available).
- In the VNC-Viewer connection window (Fig.1), enter the VNC-Server and the display number, which must be the same as the output when starting the VNC-Server on Marin.
- In the VNC Authentication window (Fig.2), enter the “Username” and “Password” to log in. After the connection is established, the graphical desktop will be displayed locally.
3. Connect desktop on VNC clients at home
In this case, the client computers running Linux/Windows are not in the CEN network. For an encrypted connection between the VNC server and the VNC client, the SSH tunnel is used.
3.1 On a Linux client computer at home
- Establish the SSH tunnel using the command as follows
ssh -L 5902:marin02.cen.uni-hamburg.de:5902 u******@login.cen.uni-hamburg.de
Here the port 5902 corresponds to 5900+(display number). The VNC-Server and the display number must be the same as the output when starting the VNC-Server on Marin (replace the italic text accordingly).
After entering the password, the user can log in to the CEN network. After login, keep the terminal window open, do not close it.
- Start the VNC-Viewer in another Terminal
vncviewer localhost:2
The display number must be the same as the output when starting the VNC-Server on Marin
- In the VNC Authentication window
Enter the “Username” and “Password” to log in. After the connection is established, the graphical desktop will be displayed locally.
3.2 On a Windows client computer at home
- Enter the hostname (login.cen.uni-hamburg.de) and port(22) of the login node in the software “Putty” (Fig. 3)
Fig.3 Setup for the login in Putty
- Establish the SSH-tunnel in Putty (Fig. 4) and then log in to the CEN network. After login, keep the terminal window open, do not close it.
In the Menu Connection -> SSH -> Tunnels set up the tunnel.
e.g. Source port: 5902 (5900+Display Nummer) and Destination port: marin02.cen.uni-hamburg.de:5902.
The server and the display number must be the same as the output when starting the VNC-Server on Marin.
Fig.4 Setup for the SSH-tunnel in Putty
- Start “TigerVNC Viewer” by clicking on the icon (the software “vncviewer64-***.exe” can be downloaded and then directly executed, if it is not already available)
Enter the VNC-Server (“localhost”) and the display number (e.g. :2, must be the same as when starting the VNC-Server on marin) in the VNC-Viewer connection window (Fig. 5)
Fig. 5 VNC-Viewer connection for Windows client at home
4. Closing the desktop session on VNC-Client
To close the graphical desktop, follow these steps:
Press F8 → Click on the first item (“Quit Viewer” or “Disconnect”) in the menu.
In this case, the VNC-Server will continue to run, allowing you to establish a connection again with the VNC client.
5. Stopping the VNC-Server on Marin nodes
To release resources for other users on the server, the user should stop the VNC-Server on Marin after finishing working with the VNC-Viewer. It can be done in one of the following two ways.
- Stopping the VNC-Server manually on Marin using the following command
@marin02:~> vncserver -kill :display number
Here the display number must be the same as when starting the VNC-Server on marin
- Stopping the VNC-Server on the client using “log out” option (Fig. 6)
Click on the bottom-left corner of the VNC-Viewer’s desktop → Click on “Logout” → Click on “Logout” again. In this way, the VNC-Server will be automatically stopped