Sektionen
Sie sind hier: Institut → IT Services → Dienste → Private VM → VNC Guide

VNC guide

This article deals with the usage of the VNC-Server TigerVNC on our Linux Computers and how to access the service via Windows and Linux.

VNC Client

First one has to obtain the VNC client. The client software can be freely downloaded from: www.realvnc.com

Standalone versions of the client are available for Linux and Windows (etc.)

Connecting via SSH

Before you may use the vnc server on a linux host you need to connect via ssh.

Due to security reasons the pool computers are not directly available for ssh connections over the internet. Therefore it is nessesary to establish a SSH tunnel connection using our login server "zeus.cs.uni-bonn.de". An easy way of establishing SSH connections is using putty. If you are using Linux it is recomended to use the standard OpenSSH client.

To work with VNC you will have to tunnel your connection via ssh. Therefore you need to create a ssh tunnel. How to create ssh tunnels, refer to: SSH tunnels to a SGN linux host

SSH Client installation

Using Windows as an operating system makes it nessesary to employ third party SSH software. This tutorial uses Putty. Putty for Windows is a standalone application, available at the following location:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 

Binaries →
The latest release version ... →
For Windows 95, 98, ME, NT, 2000, XP and Vista on Intel x86 →
PuTTY: putty.exe

To use PuTTY no further installation process is required.

Windows: SSH connections using Putty

PuTTY

To get started please open:

putty.exe

After launching the application, one should customize the configuration.
Configure putty to connect to the SGN login server:

Bild:Putty  session.jpg

Save the configuration, for further usage.

SSH tunnels to a pool PC

The next step is to configure a SSH tunnel to one of the pool PCs. For a list of available computers refer to: The List of available pool computers

This tunnel is needed so that the VNC connection can forwarded from a local port on your VNC client machine to the VNC server (some pool PC).
To create the SSH tunnel the port that the VNC server is listening on should be known. Refer to the section "How to start the vnc server", to start a VNC server on a pool PC and set the port on wich your server is supposed to listen. For the next example lets assume a VNC server is listening on port 5901 and has been started on ballade.informatik.uni-bonn.de.

To create a SSH tunnel, using the menu on the left of the application navigate to:

Connection ->
SSH ->
Tunnels

and edit the fields: "Source Port" and "Destination"

Bild:Vnc-ssh-tunnel.jpg

Save tunnel settings and open connection

After successfully creating the tunnel go back to Category -> Session and save the changes and open the connection.
Bild:Putty  session open.jpg

You may have to confirm the provieded fingerprint:
Bild:Putty session open_fingerprint.jpg

Login:
Bild:Putty  session opened.jpg

Linux: SSH connections using OpenSSH

To create a tunnel from the local computer to a remote Server, execute the following command:

ssh username@zeus.informatik.uni-bonn -L localport:poolComputer:remotePort 

for example:

ssh yourusername@zeus.informatik.uni-bonn -L 55901:ballade.informatik.uni-bonn.de:5901 

VNC server

How to start the vnc server

The following commands have to be invoked on the computer which is supposed to provide the VNC server service. Therefore one has to establish an ssh connection to the corresponding computer. If for example an VNC server service is supposed to be started on ballade.informatik.uni-bonn.de, you may connect via zeus:

Bild:Putty_session_connect_zeus.jpg

It is recomended to start a seperate ssh connection instance to connect to a pool PC via zeus, beacause you may only do the ssh tunnel setup for vnc after you know the port number of your vnc server. How to obtain the portnumber is discribed below.

Checking for running instances

This is done on the pool PC that is supposed to be the VNC server. To check for already running instances of the vnc server one may execute the following command:

# ps ax | grep vnc | grep -v grep 

Use the "grep" command to show vnc processes of a specific user:

# ps ax | grep vnc | grep -v grep | grep someusername 

Example output:

27431 pts/1 S 0:00 Xvnc :1 -PasswordFile /home/stud/SomeUser/.vnc/passwd -auth /home/stud/SomeUser/.Xauthority -desktop ballade:1 (SomeUser) -pn -UserPasswdVerifier VncAuth -fp unix/:7100,built-ins,/usr/share/vnc/fonts -co /usr/share/X11/rgb.txt -geometry 1024x768 

where 27431 is the number (pid) of the process, the process is listed with its arguments.

How to set the password

Connecting to the vnc service requires a password. To set the password use:

# vncpasswd

Chooseing the window manager

Before starting the VNC server one should choose a window manager. To switch the window manager, use the following command:

# switchdesk SomeWindowManager

Valid window managers are KDE, GNOME, XFCE, FVWM or WindowMaker.

Starting the VNC server

Start the VNC server by invokeing the following command:

# vncserver -geometry 1024x768

It is recomended to adjust the desktop resolution, useing the "-geometry" paramter. The VNC server will automatically chosse a free display number. The Display number is the offset to the VNC standard port 5900. If the server is running on display 1, the portnumber is 5901.

The following output may be presented:

New 'ballade.informatik.uni-bonn.de:1 (someuser)' desktop is ballade.informatik.uni-bonn.de:1 Starting applications specified in /home/stud/someuser/.vnc/xstartup Log file is /home/stud/someuser/.vnc/ballade.informatik.uni-bonn.de:1.log

If the Display number is known, the ssh tunnel setup in the section Windows: SSH connections using Putty should be done.

It is also possible to set the display number manually by adding the parameter for Example " :42" to set the display Number to 42 (Port 5942). If the coresponding display is alreay in use the server server will report an error.

Overview

Available Pool Computers

Only the computers shown in the list below are available for useing the VNC enterprise server.

Last update: 05.08.09
Room:

(for example the FQDN of FX100-ballade is ballade.informatik.uni-bonn.de )

Connection Overveiw

Bild:VNC-via-SSH-Overview.png

Institutsverweise