Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have just setup my server with ubuntu desktop, after running the sudo apt-get install-desktop, and rebooting I now want to login to the dektop remotely, from my Windows PC. How do I enable remote VNC / Teamviewer access via the SSH command line?

share|improve this question
do you have autologin setup there as well or not? – Michał Šrajer Jan 11 '12 at 2:10
up vote 1 down vote accepted

One alternate would be to use FreeNX . Freenx is secure and faster then VNC.

See The Ubuntu Wiki FreeNX page.

If you want to tunnel VNC over SSH I personally would use an alternate VNC server, vnc4server.

You would then ssh in with putty, tunnel the VNC port over SSH, start the vncserver, and then connect with a vnx client.

It might sound complex, but there is a very nice walk through here:

Tunnelling VNC over SSH with PuTTY

It is a graphical guide (best one I know) doing exactly what you want.

The advantage of tunneling over ssh is the it increases security.

I would also advise you use keys and disable password authentication.

Ubuntu wiki ssh keys

And finally, here is a walk through on how to import open-ssh keys to putty

Putty import ssh keys

share|improve this answer

There is a builtin vnc server vino, however to configure it remotely without a gui is painfull. The easiest it to run ssh vino-preferences from a linux LiveCD. You can use vino-passwd to set the password.

Alternative is to install x11vnc (from x11vnc package). No need gui to configure. Just install and run it from the putty window.

If you are not logged as a user on that ubuntu box, then you will need to do some tricks with X cookie permissions. It is described in error message from the x11vnc command (just the file path is bit different in Ubuntu). Sorry, I don't remember the details, but it wasn't difficult.

It is better (safer) to start vnc server only on and tunnel it over secure SSH tunnel (there are options for that in putty).

Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.