The goal: "to be able use my phone/PDA to access my Ubuntu laptop at home as if I was sitting at it."
Have you ever been somewhere and thought "I've got that on my PC at home. I wish there was someway I could get to it." Well now you can. The diagram below provides a graphical view of how the solution fits together. I will cover the technical aspects in words and links.
The ingredients are:
- Motorola Milestone (or any phone/PDA running Android)
- androidVNC, a free application available in the Android Market
- Ubuntu on your PC or laptop (most Linux distros supported)
- X11vnc, free server software (author would like donations) for your home machine
- DynDNA, a service that gives you a free URL to point to your home network
- Port forwarding on your router
And this diagram provides a high-level view of the solution...
Overcoming Challenges
I tried several free apps from the Android Market and, whilst they all work, I found that I preferred androidVNC because it had a better selection of settings to alter its performance.
On the Ubuntu side, I tried several of the VNC solutions like Vino, vnc4server, etc. The problems I found with these solutions is that, although they displayed the initial screen on my laptop OK, they never refreshed it. I eventually settled on X11vnc (created by Karl Runge) after wading through a lot of dismay from people, like myself, who are running Ubuntu 9.10 (Karmic Koala).
On the Ubuntu side, I tried several of the VNC solutions like Vino, vnc4server, etc. The problems I found with these solutions is that, although they displayed the initial screen on my laptop OK, they never refreshed it. I eventually settled on X11vnc (created by Karl Runge) after wading through a lot of dismay from people, like myself, who are running Ubuntu 9.10 (Karmic Koala).
How do I make my machine available from outside my home?
I'm using the Broadband cable service from Optus (Optusnet). It is connected to a D-Link DIR655 Router in my home. The router provides both wired and unwired connectivity.
Step 1: Port forwarding
Port forwarding allows you to direct certain network traffic from/to a machine on your home network. I'm not going to go into each detail here; suffice to say you need to forward ports 5500, 5800 & 5900 to your machine. The Port Forward web site provides excellent advice for most routers. You will also need to configure your router to set a fixed (internal) IP address for your machine.
Step 2: Finding your network from the Internet
Telco providers assign a single IP address to each of their customers. Unless you have a business pack, the IP address is not fixed and it can change at any time; you will not know when or how often. The solution? DynDNS! DynDNS provides free and paid DNS services. The free service is more than enough for our needs. Simply register at http://www.dyndns.org/ and select your URL from a large list. The URL will point to the IP address of your home network. But hang on! That can be changed at any time by your telco.
Correctomundo! So that's why you install the free software from DynDNS that you can configure to run on your machine. It checks to see whether the IP address of your network has been changed by your Telco. If it has been changed, it tells DynDNS, who immediately point your URL to the new IP address - wonderful! DynDNS provide 2 software clients, I used the "ddclient" option. They provide online examples on the configuration file. Start off using the basic example to get going.
Correctomundo! So that's why you install the free software from DynDNS that you can configure to run on your machine. It checks to see whether the IP address of your network has been changed by your Telco. If it has been changed, it tells DynDNS, who immediately point your URL to the new IP address - wonderful! DynDNS provide 2 software clients, I used the "ddclient" option. They provide online examples on the configuration file. Start off using the basic example to get going.
Let's see where we are so far. You have a your own URL that will always point to your home network. VNC traffic (that uses ports 5500, 5800 & 5900) will hit your router and be directed to your machine. Now we need some software...
Step 3: X11vnc Server
NOTE THAT THIS SOLUTION IS FOR THE GNOME DISPLAY MANAGER (GDM). YOU WILL NEED TO MODIFY IT FOR KDE
NOTE THAT THIS SOLUTION IS FOR THE GNOME DISPLAY MANAGER (GDM). YOU WILL NEED TO MODIFY IT FOR KDE
For Ubuntu 9.10, you need to install version X11vnc-0.99. Kamal Mostafa has done an excellent job of packaging this up for Ubuntu 9.10 here.
Code:
sudo aptitude install x11vnc
Code:
sudo nano /etc/xinetd.d/x11vnc
Code:
service x11vnc { port = 5900 type = UNLISTED socket_type = stream protocol = tcp wait = no user = root server = /usr/bin/x11vnc server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg disable = no }
4. Restart xinetd
Code:
sudo /etc/init.d/xinetd restart
To download this app, simply open the Android Market app on your Android phone/PDA and install it.
The cake is now baked - time to eat it.
Fire up androidVNC and connect. Here are some screen shots showing you some typical settings.
UPDATE: I have removed the X11VNC server because I didn't need the extended capabilities. I just enabled the Ubuntu Remote Access service and it works fine from my Android...
ReplyDeleteHi Pete,
ReplyDeleteI would like to know since my operating system is Windows Vista do I have to switch to Ubuntu?
I am a bit confused about step 3 where you install X11VNC and Ubuntu.
I would appreciate it if you could guide me.
Thanks
Reza
ReplyDeleteYou will still have to set up the access using dyndns. Windows vista should allow Rdp access. If you are using android, you can installa different app. It's called rdp lite. I have used it to connect from android to windows 2003 and it works fine.
I hope this helps. Cheers Pete