How to connect to hydra using VNC¶
Setup on hydra¶
You should already be able to SSH into hydra, at least head1. If you want to SSH directly into head3 and use that as your interactive environment, add the following lines to your ~/.ssh/config (if the file doesn’t exist, create it).
Host hydra
HostName hydra.dartmouth.edu
Port 11110
User <YOUR_USERNAME>
ForwardAgent yes
Host head3
ForwardAgent yes
HostName 10.0.0.3
ProxyCommand ssh -q -A hydra.dartmouth.edu -p 11110 'nc -w1 %h %p'
Remember to change <YOUR_USERNAME> to your actual username on hydra. In this way you can log into hydra (head1) using ssh hydra, or into head3 using ssh head3.
Then, the first thing to do is to run vncserver on hydra. SSH into hydra (head1, or head3 – only these two heads support VNC), and launch the following command
vncserver -geometry 2560x1440
This will run the vncserver. You should do this only once (unless something happens and your vncserver gets killed). The output of the command will look like
contematto@head1 ~ $ vncserver -geometry 2560x1440
New 'X-contematto' desktop at head1:2
Starting applications specified in /etc/X11/Xvnc-session
Log file is /home/contematto/.vnc/head1:2.log
This says that a new desktop was created, and that it’s the number 2 on head1 (head1:2). Write down the number of the desktop because we’ll need it later.
While you’re at it, change the vnc password using the command
vncpasswd
Change it to something easy to remember, and do not use the same password for hydra!.
Setup on Mac OS X¶
We need to open a secure connection to hydra, through which we can connect using vnc. To do this, just run the following command to connect to head1
ssh hydra -fN -L 5902:localhost:5902
or this command to connect to head3
ssh head3 -fN -L 5902:localhost:5902
You need to change the port according to the display number you wrote down before. In this case, the display was the number 2, so the port is 5902. If the display was number 3, you would change the port to 5903.
Now everything is ready. The easiest way to connect to hydra is to open a terminal and launch the VNC viewer built in in Mac OS X with the following command
open vnc://localhost:5902
And remember to change the port with the right one.
Setup on Linux¶
To launch the vnc client and setup a secure connection automatically, use this to connect to head1
xvncviewer -via hydra localhost:2
or this to connect to head3
xvncviewer -via head3 localhost:2
Remember to change the display number accordingly (localhost:2).
Setup on Windows¶
TODO [on demand]. Let me (Matteo) know if you need help with Windows.