Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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'm fairly new to Ubuntu so please bear with me. I use Teamviewer on my Windows machines and love it, even more so that there is an Ubuntu version. As most will know it can't start on computer startup as a service on Ubuntu so if my machine reboots for any reason I'm screwed.

Obviously I don't want to enable port 5900 to the outside world as even with a secure password VNC access is hackable.

So, I have installed, configured and successfully tested OpenVPN which means I can "see" my machine but I'm wondering what would be the best solution for remote controlling it if it at the login page with no user logged in.

VNC? X11(although I'm sketchy as to what exactly this is). Any help would be appreciated.



share|improve this question
"As most will know it can't start on computer startup as a service" Why not? – Oli Oct 23 '10 at 23:12

ssh + fail2ban + x11vnc == win.

You basically (and I'm noting the irony in using that work, knowing how complicated what I'm about to write sounds) run a SSH server. Use fail2ban to stop people brute forcing it. Put it on a non-standard port for bonus points. Then from Windows (Putty, a SSH client) you connect to Ubuntu forwarding the Ubuntu's local VNC traffic over the SSH connection to a Windows-local port. Then Putty tell's Ubuntu to run x11vnc. And finally on Windows you connect to VNC using localhost:5900 which is now (magically) the Ubuntu's localhost:5900.

I wrote a step-by-step for another user. It's really not as stressful as it looks and it can be scripted so, once set up, it all happens with a double-click at the Windows end.

share|improve this answer
ssh rocks and fail2ban rocks and that trick is very intelligent actually. +1 to you. – Luis Alvarado Oct 11 '11 at 21:14

Here is a thread on the Ubuntu forums discussing a similar question: So probably you can set up Teamviewer so that it starts automatically if you enable auto-login.

If you want to get more technical (and given that you already have OpenVPN set up) you can enable "Remote Desktop" (System -> Preferences -> Remote Desktop) which exposes your desktop trough VNC (again, auto-login is needed).

share|improve this answer
Thanks guys, problem is I'd rather not enable auto-login as my wife and son use the PC as well and I don't trust them to have access to my account with full admin rights. I have read about a way to enable auto-lock using a script so I might need to test that out and see what happens. – peejay1977 Oct 24 '10 at 12:19

Seems this was easier than I thought, I as I don't want people accessing my machine at home while I'm away I didn't want to set my account to auto-login. My wife has a tendancy to break ANYthing so don't want her using my account.

I added "xdm-screensaver lock" as a startup app as well as "/usr/bin/teamviewer". Then set System - Administration - Login Screen, set it to auto login as me. I didn't have to set the account under Users and Groups to auto login thought.

Now, whenever the machine is powered up, it jumps from the Ubuntu bootup screen to the screensaver instantly. As soon as you wiggle the mouse it states its logged on as me and is locked which is perfect.

I can then access it via Teamviewer so this does exactly what I want without having to mess about with VNC/X11 stuff.

Thanks folks.


share|improve this answer
Your Tipp works fine most of the time. But sometimes Teamviewer 6 crash :( – 3DS Dec 13 '10 at 11:06

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.