VNC connection to IMADA Computer Lab
Here is the a video to show the whole thing working.
This document describes how to access the IMADA Computer Lab via VNC. Please note, that this is for convenience only, you can always login via ssh and have several shells running. Furthermore, it is also acceptable to use UML on your own machine, but this might due to many reasons just not be possible. Therefore this document is for students that want the convenience of a graphical interface while being at home. On the Computer Lab I had to install fvwm3 and a TigerVNC server on the Computer Lab (as non-root user, so you could also do it). You won’t have to do that if you set your PATH
variable in the Computer Lab accordingly (see below). In case of technical issues, please note, that I experienced the below setup to be the most stable, but I cannot guarantee or help if you are using, e.g., a different VNC client (I already spend far too much time ). Nevertheless, I wanted to share my experience:
- On your home machine, make an entry in
$HOME/.ssh/config
to being able to directly connect to a Computer Lab machine of your choice. This might of course change depending on which OS you work. For you as a student the entry should looks similar to:Host unilab User "sdu\jogul16" HostName imada-106330.imada.sdu.dk ProxyCommand ssh "SDU\jogul16"@logon.sdu.dk nc %h %p 2> /dev/null
- Make an ssh connection to a terminal room machine, and use port tunneling on port 5901 (if someone else uses port 5901 on the same Computer Lab machine, you will have to change this number accordingly).
ssh -L5901:127.0.0.1:5901 unilab
You might be asked for your password twice, as you first login to the jumphost, and then to the Computer Lab machine by that.
- On the Computer Lab machine, you need to change the
PATH
and theLANG
environment variable. Do so by addingexport PATH=/mnt/Shared/daniel/bin:$PATH export LANG=en_US.UTF-8
to the file
$HOME/.profile
. You either need to re-login now, or execute bothexport
commands also in the shell on the Computer lab machine. - On the Computer Lab machine, you need to create a directory for the vnc configuration file
mkdir $HOME/.vnc/
and in there, create the file
$HOME/.vnc/xstartup
with the following content:#!/bin/sh xterm & xterm & /mnt/Shared/daniel/bin/fvwm3
- Make
xstartup
executable:chmod 700 $HOME/.vnc/xstartup
- On the Computer Lab machine, you need to create the file
$HOME/.fvwm/config
. Copy it from thefvwm3
installation via the commandscd $HOME mkdir $HOME/.fvwm cp /mnt/Shared/daniel/share/fvwm3/default-config/config $HOME/.fvwm
- On the Computer Lab machine, start a vncserver with the command
vncserver -geometry 1000x600
The output should look similar to
daniel@imada-106334:~$ vncserver -geometry 1000x600 New 'imada-106334:1 (daniel)' desktop is imada-106334:1 Starting applications specified in /home/daniel/.vnc/xstartup Log file is /home/daniel/.vnc/imada-106334:1.log
This means, you now have a VNC server running on port 5901 (VNC servers start by default at port 5901, the “:1” above indicates it’s the first VNC server on this machine).
- Finally, use a VNC client to connect from your home machine locally via the ssh tunnel to the Desktop in the Computer Lab. I personally use TigerVNC on MAC, I switch off encryption, and thereby I can see the remote desktop.
Have in mind, that the VNC server will remain running until the machine is re-booted (which, due to obvious reasons, happens not by accident theses days). It will therefore be possible to easily reconnect, unless IT decides to reboot the machines.