Last time I had the following situation: I wanted to remote connect to my workstation from another workstation like in the following image:

My current workstation is the left one (I will call it “workstation“) and I want to connect to the computer on the right (“server“). The workstation is running Windows XP, the server is running on Ubuntu Feisty.
- Setup Server(SSH+VNC): You have to install SSH and activate the VNC-Server, to be able to securely connect to your server.
- Install SSH: Just install the SSH server by entering the following in bash:
sudo apt-get install ssh
Enable VNC: VNC is already installed on yor Ubuntu system, so you only have to enable it. Navigate to System -> Preferences -> Remote Desktop. Now you should activate “Allow other users to view my desktop“, “Allow other users to control my desktop“, and for security purpose “Require the user to enter this password” and provide a secure password. Then click the Close-button. Now your VNC-server should be ready to use.
- Install SSH: Just install the SSH server by entering the following in bash:
- Setup Rooter (SSH Forwarding). If your server is directly connected to the internet (modem) you can skip this step. On my SMC-router this feature is called virtual server. You have to forward the SSH-port (22) to the IP address of your server. (here: 192.168.123.2)
- Download and Install Putty: If you search Google for putty, the first result will be a download page, where you should download eighter the windows installer (putty-0.60-installer.exe) or the single putty program (putty.exe) . (I placed the single file into %windir%system32 for fast access per Start -> Run.)
- Start Putty and set it up:
- Start putty.exe (e.g. if you put it in system32 per
Start -> Run putty.exe
Enter the hostname, you want to connect to on the first startpage “Session“. Here this is the router. You have to enter the external IP (in concreto: 80.80.205.145). If your “server” is directly connected to the internet you have to enter the external IP of your server. (This is the case if you have only a single PC and this PC is directly connected to the modem of your provider.
Setup a tunnel by going to “Connection -> SSH -> Tunnels“. Here you enter as source port 5900 (the default VNC-Port which is used by Ubuntu if you installed it like me). As Destination you enter the internal server-ip with the VNC-Port (in concreto: 192.168.123.2:5900) and Click Add. Make sur, that you use the internal IP of your server not e.g. an IP-Adress of your router. (I made this mistake and wondered why nothing happend 😉 )
Save your session and connect, so you can recall it later quickly by going back to “Session”. Type a meaningful name for your session below the “Saved Session” label and click “Save“. Now you can restore your session always by selecting it and click “Load“. Now you can click “Open” to connect to your server.
- Start putty.exe (e.g. if you put it in system32 per
- Connect to your workstation: Now you will get a window where your username and password will be asked. Enter you login credentials to connect to your server and establish a SSH-tunnel.
- Connect to your server using VNC:
- Download and install VNC. There are lots of free VNC apps for windows out there e.g. UltraVNC or TightVNC. Note that you only need the viewer.
- Start the vncviewer and connect to localhost (127.0.0.1) and enter your password which you provided in step 1.2.
- Now you should be connected to your home server 🙂
Advertisements

Hi, may I suggest a calendar widget so people can navigate to see your first posts?
I am intrigued and wish to see your beginning.
I am assuming you are describing the whole switch to Ubuntu, and start at the beginning?
Please add the ‘calendar’ or better still ‘archives’ that can be searched by month.
Take care;
@
Or, more simply, install hamachi on both the workstation and server, then (on the workstation) VNC to the server’s hamachi address (5.x.x.x). That way, encryption and port forwarding come for free.
I use Hamachi with GHamachi on Ubuntu for a graphical interface.
@anarchore: calendar and archives added. I did not know this feature yet 😉
I was not blogging from the begin of my switch but I am blogging about some things I stumbled on.
wonder if we, people, are going to cill each other
sofia
http://sofiawinterborn.wordpress.com/2007/07/02/sofiawhen-did-human-beings-turn-into-brothers-in-arms/
As John said, I like hamachi too. Instead of using VNC I prefere FreeNX. It seems to run so much faster. Here is some howto’s I use:
Hamachi on Ubuntu
http://forums.hamachi.cc/viewtopic.php?t=15075
FreeNX
https://help.ubuntu.com/community/FreeNX
http://free.linux.hp.com/~brett/seveas/freenx/
http://www.nomachine.com/download.php
I set up my “rooter” but my plumber objected.
seriously, I would also link to the howto’s for securing SSH. The fact is that if you have port 22 hanging on the internet, go and check your auth.log, it’s kind of scary. I don’t think there are any default ubuntu service accounts that might allow shell, but certainly people need to disable root login in sshd.config and also I’d recommend putting denyhosts.py (is denyhosts in apt-get yet???)
Cheers.
Um yeah. How do I run it if it’s on a dual boot and I am in windows and want to run ubuntu? I have access to the partitions on both OS’s
That’s what I was hoping this article would be about.
I like NoMachine NX or freenx, secure and super fast + it lets you use more than one account at a time.
@Done
You’re correct in saying there are no default ubuntu service accounts that allow shell, and as you may be aware, the root account in ubuntu is disabled by default (not only in SSH, but everywhere.)
Great how-to… Ever tried Xming? Opens up a secure X session on a Windows machine using plink, excellent alternative.
@RUFF:
whoehahahahahahaha!!
How on earth will you run Ubuntu AND Windows on one box (using the dualboot you describe)… What machine would you connect to from Windows? ehh… oops that instance in not running right? haha
Doesn’t this arrangement assume that you remain logged into the “server” Ubuntu machine. If you log out, the VNC service is inactive, isn’t it?
MMS
@Matt I am facing this problem right now as I want to leave my Linux comp logged out and still access my VNC server and Azureus. If anyone has any tips that would be great!
I’d like to throw in some hints:
you have to be aware, this discussion evolves around 2 different solutions: one is using a client software the other one “does not really need one”
Have a look also here: http://ubuntuforums.org/showthread.php?t=541656 that post is about running a vnc – java server so you can connect via a browser.
To make this safe I will describe my situation:
being at work, almost all outside ports are blocked, so I have setup sshdaemon on my router @ home on port 443 which I am allowed to access from work. so if I connect via putty to port 443 and set up a dynamic tunnel, socks5 => only enter a local port, aka 88 and select dynamic. establish the connection to your router.
then after you have set up your vnc – java server at home, and set your browser at work to use localhost:88 as proxy, you can simply connect to your home pcs internal IP on the port the vnc server is running. the browser using the dynamic tunnel, will forward your request to the itnernal network at home.
=> this achieves security, your home pc is not reachable from the internet, but only from your local net.
🙂 have fun
Very helpful, thank you.
xming
These directions are a mess!
If you overlook the typos –you are left with incomplete instructions.
Where are the configuration instructions for the server?
If you only establish one tunnel, (it’s called a cave! and it doesn’t work) You port-forwarded only one side. You have to configure the server to port-forward as well.
Better instructions can be found here!
http://www.mydemosite.org/Ubuntu-Remote-Desktop-Guide.pdf
Thank you for instructions.
These instructions worked fine for me, thanks a lot. I never knew Putty could do that. remarkable. Seems a little scary but seems a hell of a lot safer than riding vnc into my work network without encryption, which I have done. Still have a few questions like why can’t i access an ubuntu desktop via vnc unless i’m logged into the desktop first? Also, have questions about logging into windows remote desktop from an ubuntu machine. Does microsoft make a client/viewer available that will work? or is there an open-source client that will work? If you can answer these questions, great, if not, still i thank you for excellent and useful instructions which i personally have already made use of (with just a little prior knowledge of vnc and putty and router port-forwarding) and which i believe i would have been able to follow without my prior knowledge.
you can use tsclient to connect from windows to ubuntu.
tsclient is already installed.
This is working
@George: “why can’t i access an ubuntu desktop via vnc unless i’m logged into the desktop first?”
I think this is because the vino-server starts with your login and not before.
You can try to log in automatically and then run “gnome-screensaver-command –lock” to lock your computer.
Incredibly, your guide worked perfectly, to the dot and was very easy to understand.
You sir, are pure win. Thank you for the work you put behind this. I never thought I’d get this to work, considering i’m fairly noob to the unix environment.
Cheers!
Hello webmaster
I would like to share with you a link to your site
write me here preonrelt@mail.ru
Excellent tutorial bro,
I got what I searched about remote linux admin
thanks
Appreciate your effort! Thanks
Hello,
I would like to view the desktop of a few Ubuntu systems from my Windows laptop. The connection configuration is as follows:
U1,U2,U3 ==> DL1 ==> DL2 Internet
U1,U2,U3 are the Ubuntu 10.04 systems
DL1, DL2 are D-Link DES-10106D Switches
W1 is the Windows XP system
Modem is for the ADSL broadband connection
So U1,U2 & U3 are connected to the switch DL1. DL1, W1 and the broadband modem are connected to switch DL2. And hence all the systems access the internet.
Initially when I open Remote Desktop in U1 (System>Preferences>Remote Desktop) it tries to find out its IP address and then shows 192.168.1.11. And when I try to connect to this IP from my W1 system using UltraVNC Viewer it fails.
When I open and close Remote Desktop in U1 a few times then it shows its IP address as say a.b.c.d. Now if I provide this IP address a.b.c.d in the UltraVNC Viewer then I am able to view U1’s desktop. Looks like a.b.c.d is actually the IP address of the ADSL modem.
Now, how do I configure this in such a way that I have discrete access to all the Ubuntu systems in this network from my Windows system? Please help.
U1,U2,U3 ==> DL1 ==> DL2 Internet
U1,U2,U3 ==> DL1 ==> DL2
W1, Broadband Modem ==> DL2
My question is: is it necessary to implement a custom solution in order to remote into Ubuntu? Is any company of remote control software offering a system that can do this in a robust manner?
George, I completely agree with you that this is a lot better than simply riding into my work server with an unencrypted VNC, which could pose security risks. Another option is to go proprietary with something like Proxy Networks for remote control software.