Project

General

Profile

Using VNC Connections on the dunegpvms

THIS PAGE HAS MOVED TO the DUNE wiki

Request access to the wiki by sending an email to .












This is the text of an e-mail from Dom Brailsford, April 29, 2016:

There is already vncserver software set up on the gpvms (at least there is for dune).  
You will need to install VNC viewer software on your laptop.  If you are a mac user, 
this is already installed and I’ll show you how to run this in the example below.

STEP 1: Start a VNC server on the gpvm

Log into the gpvm of your choice.
Start the VNC server.  The command is:

vncserver :X -localhost

where X is a number of your choice.  In my case, I chose 8, so my command was:

vncserver :8 -localhost

The number specifies the display you are going to use.  I don’t think this will work if 
someone is already using that display so, in that case, it may demand you use a different one.
If this is the first time setting up a server, it will ask you to pick a password.  Pick one.
The -localhost option is needed to block connections that come from outside not through the ssh tunnel.
If omitted, then SCD will block the gpvm from the network (!).

STEP 2: Push the output of a remote terminal to the VNC desktop

In a terminal where you are connected to the gpvm and are doing work which 
requires a GUI, issue the following command:

export DISPLAY=localhost:X

Where X is the number you chose.  In my case the command was:

export DISPLAY=localhost:8

STEP 3: Tunnel the VNC through ssh to keep it all encrypted

On your local machine, via a terminal, issue the following command:
ssh -K -L 59X:localhost:59X -N -f -l USERNAME GPVMADDRESS
Something to be aware of here.  The port forwarding for VNC is via ports 59[0..99] and for 
numbers less than 10 you have to include the leading 0.  So my command was

ssh -K -L 5908:localhost:5908 -N -f -l dbrailsf dunegpvm06.fnal.gov

The -L 5908:localhost:5908 says forward information from the local side on port 5908 to 
the remote host via its port 5908.  You have to make sure that the port number (in my case 08) 
matches with the display used when setting in the vncserver.

STEP 4: Open the VNC window locally

Tell whatever local vncviewer you have installed to open the localhost window using the 
port (localhost:59X or localhost:5908 in my case).  For mac users, there is already 
one installed which you can access very easily via open.  The mac command is

open vnc://localhost:59X

In my case, the command was:

open vnc://localhost:5908
A desktop window should pop up.  In any remote terminal window in which you have pushed the 
output to the VNC window (like step 2), the GUIs should open in this desktop.

STEP 5: Open a GUI remotely and watch it appear in the desktop window

Go back to the terminal in step 2 and open a GUI.  A quick test would be a TBrowser
root -l
new TBrowser
Confirm that the TBrowser opens in the VNC desktop window.  Try doing stuff 
with it and note how quick it is.

I’ve already managed to whiz through 50 35t event displays 
as if I’d had them open locally.

I also believe that you can push multiple terminal displays to a single VNC server so 
you could repeat step 2 for a bunch of different terminal windows.