0. remember, that VNC runs in a client-server mode, so some setup steps need to be taken on the server side, others - on the client side (your laptop)
1. on a remote machine, for example, on mu2egpvm02.fnal.gov, setup a VNC server to listen to a local port:
murat@mu2egpvm02:~> vncserver :1 -name MU2E01 -depth 24 -geometry 1900x1050 -localhost -rfbauth ~/.vnc/passwd
note 1: 'vncserver :1' listens to a local port 5901 (5900+1) , this port can be taken by another user.
Run 'ps -efl | grep -i vnc' on the server to see who else is running VNC servers on the remote host and which ports are already taken
note 2: '-depth 24' is needed to support OpenGL rendering over VNC connection
2. create a VNC server password (you will be asked for it when connecting on a client side):
murat@mu2egpvm02:~> vncpasswd ~/.vnc/passwd
and enter the password when prompted
note 1: to use your favorite window manager, for example, KDE, create a ~/.Xclients file as follows:
murat@mu2egpvm02:~>cat ~/.Xclients
#!/bin/bash
startkde &
~/.Xclients file has to be executable
3. on your laptop, establish a ssh tunnel (use correct port numbers and the host name).
Linux:
ssh -f -N -t -L 5901:localhost:5901 your_fnal_username@mu2egpvm02.fnal.gov
MAC:
ssh -f -N -L 5901:localhost:5901 your_fnal_username@mu2egpvm02.fnal.gov
4. on your laptop, start the VNC client
vncviewer
5. when the TigerVNC client opens a window, direct it to localhost, port 5901, as shown below (localhost:1 means 'local port 5901').
Also click on Options and check 'Misc./Shared'
6. Comments:
If things don’t work:
ps -efl | grep -i vnc
should show your server running
ps -efl | grep ssh
should show only one SSH tunnel process