Skip to content
Snippets Groups Projects
vnc.md 8.17 KiB

VNC

The Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer. It transmits the keyboard and [mouse] http://en.wikipedia.org/wiki/Computer_mouse "Computer mouse") events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.

The recommended clients are TightVNC orTigerVNC (free, open source, available for almost any platform).

Create VNC password

Local VNC password should be set before the first login. Do use a strong password.

[username@login2 ~]$ vncpasswd
Password:
Verify:

Start vncserver

To access VNC a local vncserver must be  started first and also a tunnel using SSH port forwarding must be established. See below for the details on SSH tunnels. In this example we use port 61.

You can find ports which are already occupied. Here you can see that ports " /usr/bin/Xvnc :79" and " /usr/bin/Xvnc :60" are occupied.

[username@login2 ~]$ ps aux | grep Xvnc
username    5971  0.0  0.0 201072 92564 ?        SN   Sep22   4:19 /usr/bin/Xvnc :79 -desktop login2:79 (username) -auth /home/gre196/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/username/.vnc/passwd -rfbport 5979 -fp catalogue:/etc/X11/fontpath.d -pn
username    10296  0.0  0.0 131772 21076 pts/29   SN   13:01   0:01 /usr/bin/Xvnc :60 -desktop login2:61 (username) -auth /home/username/.Xauthority -geometry 1600x900 -depth 16 -rfbwait 30000 -rfbauth /home/jir13/.vnc/passwd -rfbport 5960 -fp catalogue:/etc/X11/fontpath.d -pn
.....

Choose free port e.g. 61 and start your VNC server:

[username@login2 ~]$ vncserver :61 -geometry 1600x900 -depth 16

New 'login2:1 (username)' desktop is login2:1

Starting applications specified in /home/username/.vnc/xstartup
Log file is /home/username/.vnc/login2:1.log

Check if VNC server is started on the port (in this example 61):

[username@login2 .vnc]$ vncserver -list

TigerVNC server sessions:

X DISPLAY #     PROCESS ID
:61              18437

Another command:

[username@login2 .vnc]$  ps aux | grep Xvnc

username    10296  0.0  0.0 131772 21076 pts/29   SN   13:01   0:01 /usr/bin/Xvnc :61 -desktop login2:61 (username) -auth /home/jir13/.Xauthority -geometry 1600x900 -depth 16 -rfbwait 30000 -rfbauth /home/username/.vnc/passwd -rfbport 5961 -fp catalogue:/etc/X11/fontpath.d -pn

To access the VNC server you have to create a tunnel between the login node using TCP port 5961 and your machine using a free TCP port (for simplicity the very same, in this case).

The tunnel must point to the same login node where you launched the VNC server, eg. login2. If you use just cluster-name.it4i.cz, the tunnel might point to a different node due to DNS round robin.

###Linux/Mac OS example of creating a tunnel

At your machine, create the tunnel: