Friday, November 13, 2009

VNC over SSH

OK, I'm not a Linux guy, yet, but I'm working on it.
I recently setup a VNC connection to my Linux server over an SSH connection, which is pretty cool if you ask me. Here is how I did it:
  1. On the Linux system I installed the VNCServer (yum install vncserver)
  2. I then started the server "vncserver" so the default files are created.
  3. I then stopped the server "vncserver -kill :1" so I can edit the default files
  4. I edited the /home/~/.vnc/xstartup file (nano ~/.vnc/xstartup)
  5. Comment out the line "twm &"
  6. Insert the line "gnome-session &"
  7. Save and exit the file
  8. Set a VNC password "vncpasswd"
  9. Start the VNCserver "vncserver -geometry 800x600 -depth 24 :99" (will produce a GUI that is 800x600 pixels with a 24-bit colour depth using port 5999"
  10. Now on my Mac in terminal I run "ssh -L 5999:x.x.x.x:5999 me@x.x.x.x" (assumes the user is "me", replace x.x.x.x with your Linux system IP address)
  11. Open VNCView, point to "localhost:99" and click connect, enter your vncpasswd created earlier.

No comments: