Wednesday, November 7, 2007

How to Install VNC (and SSH for secure connection)

First, you want to install SSH in order to ensure a secure connection:

sudo apt-get install ssh
System->Preferences->Remote Desktop
  • allow other users to view this desktop
  • don't ask for confirmation
  • require the user to enter a password

Now you install VNC. The following contains complete instructions:

http://www.movingtofreedom.org/2007/02/16/howto-remote-desktop-with-vnc-in-ubuntu-edgy-gnu-linux/

Or just do this:

System->Administration->Login Window
Remote->Style: same as local
Configure XDMCP: disable "Honor indirect requests"

Edit /etc/X11/gdm/gdm.conf for Feisty Fawn or /etc/gdm/gdm.conf for Gutsy Gibbon:
  • locate "[XDMCP]" and set "Enable=true"
  • locate and uncomment "RemoteGreeter=/usr/lib/gdm/gdmlogin"

sudo apt-get install vnc4server xinetd
sudo vncpasswd /root/.vncpasswd

Edit /etc/xinetd.d/Xvnc to add (.... signifies an indentation of 4 spaces):

service Xvnc
{
....type = UNLISTED
....disable = no
....socket_type = stream
....protocol = tcp
....wait = yes
....user = root
....server = /usr/bin/Xvnc
....server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
....port = 5901
}

sudo /etc/init.d/xinetd stop
sudo /etc/init.d/xinetd start


Pay attention to the port number in Xvnc (usually 5901). On the Windows client side, add this local forwarded port to Putty's SSH tunnel (127.0.0.1:5901). And the router, if you have one, must forward this port.

To access the Linux server from your Windows PC, start Putty through port 22 and login. Then start your VNC viewer (I use TightVNC Viewer).

No comments: