Using VNC to connect to lxplus
These instructions aim to be a brief guide to starting a
VNC server on lxplus and connecting to it. Incase of problems, errors
or suggestions please contain Chris Jones.
Start a server on lxplus
- Start a simple terminal session on lxplus, using SSH for example.
- Start a VNC server using the "vncserver" command. The following
command will for example start a session on desktop 8, with the name
Lxplus-Session and with a desktop geometry 1024 by 768. Note any number
for the desktop can be used, it just has to be unique. If someone else
is already using your number the session will not start and you will
have to choose a different number. Note the -localhost option means
only connections from the local host (lxplus012) will be allowed. This
is OK, because below we will use an SSH tunnel to connect to this
machine.
lxplus012 ~ > vncserver :8 -localhost -name Lxplus-Session -geometry
1024x768
- The above command will prompt you for a password the first time
you run it, which is used during connection. You MUST supply one, and treat it with
the same care as any other password.
- The above command will create for you a folder ~/.vnc, which
contains various configuation information. In particular the file
xstartup defines what is run when you start the vncserver. The last
line in this file starts the window manager, and the default is twm,
and somewhat basic. You can change this to what you prefer, for example
to start Gnome the last line should be "gnome-session &"
Connect to Server
- Next, you have to connect to this server.
- From linux, you can do this with the "vncviewer" command. For
example, to connect to the
above session using an ssh tunnel, type
pcdn ~
> vncviewer -via <username>@<lxplus-host>.cern.ch
:8
Where
<username> is your afs username, and <lxplus-host> is the
lxplus machine you started the session on, including the number. (E.g.
lxplus012.cern.ch)
- From windows, I refer you to for example here, for details on how to install
and run a windows VNC client.
Killing the Server
- For security reason, it is recommmended to kill the server when
no longer needed. This can be done by running
lxplus012 ~
> vncserver -kill :8
On the same lxplus host
as you started the server on.