vnc to linux vncserver

Figured out how to VNC from my laptop to my linux server. Forwarded X conections were too slow so I gave VNC a try. It was harder to set up than I expected. I googled around and after many tries found a post online that worked.

Here’s the stiuation. I need to connect to my lab computer from my laptop at home. The lab computer is behind UK’s firewall. Run vncserver on the lab computer–that’s the easy part. It runs on display :1 by default:> vncserver

Turns out I need to enable port forwarding on the lab computer’s sshd:
As root add this line to /etc/ssh/sshd_config

AllowTcpForwarding yes

then restart sshd:
/etc/rc.d/init.d/sshd restart

Then forward the ssh connection. On my laptop I run this command from a terminal:

ssh -L 5901:localhost:5901

And run the VNC client. My laptop runs OS X, so I downloaded “Chicken of the VNC. By default it uses port 5900, enter display 1 (so it goes to 5900+1 = 5901) and the host is localhost. Starts up and runs fast!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>