Wednesday, August 01, 2007

» VNC+SSH on an existing display

where remotehost is.. well, the hostname or IP address of the remote server.
Once you see "The VNC desktop is...", open another terminal and type the following command (still on the client):

vncviewer localhost:0

What it actually does is open a ssh tunnel that forwards from port 5900 on your local client to the port 5900 on the remote server, into x11vnc.
x11vnc connects to an existing X display and exposes it through the VNC protocol.
The second command is just to connect your favourite VNC client to the local port 5900 (which then goes through the encrypted ssh tunnel and is forwarded to x11vnc on the server).
All you need to do is to enable ssh on the server (which is probably already the case) and install x11vnc on the server.
You can find my openSUSE RPMs of x11vnc in the X11:RemoteDesktop repository in the openSUSE Build Service (choose the appropriate subdirectory, depending on the openSUSE version you're using).
More information about Karl Runge's brilliant x11vnc here: http://www.karlrunge.com/x11vnc/