Monday, August 8, 2011

Log into your remote computer (even with a dynamic IP!)

Every now and then, I need to access my remote desktop at home for a variety of reasons - the file I wanted to access is not in my Dropbox folder, the torrent queue needs to be prioritized or just logging in just for the fun of it! Thankfully, there exist a myriad of solutions for this very problem - VNC clients and Microsoft's very own "Remote Desktop". However, we forget a very basic requirement for either of these to work - we need to know the external IP of our remote desktop.

Now, there are a number of options available - most ISPs provide an option for a static IP Internet connection, albeit for monthly premium. It is also possible to do it by registering for DNS services. These services work by installing a client on your remote computer that keeps mapping your IP to a more friendly name like mycomputer.myvnc.com. Although this is quite useful, I personally find it quite tedious because of the hassle of constantly logging into their site and enabling my account - some of the free ones require you to do that periodically. Not to mention, I could never get it to work like it should.

Here is an alternate, simpler and free solution to the problem and it makes good use of Dropbox! Here is what we will need:
- Dropbox
- VNC Server
- Windows Task Scheduler
- wget
- VNC Client


Step1. Install Dropbox your remote computer if you haven't already done that.
http://www.dropbox.com

Step2. Install a VNC Server on you remote computer. You can choose from Tight VNC, Real VNC, and the like.


Step3. Download wget from the link below and save the wget executable file in a Dropbox folder (for e.g. \Dropbox\IP Updater)
http://users.ugent.be/~bpuype/wget/wget.exe

Step4. Create a batch file in your Dropbox folder that runs the following command.
wget -q -O - http://whatismyip.com/automation/n09230945.asp > IP.txt

Step5. Now, open the Task Scheduler and create a task that executes the above batch file every hour.

Step6. Presto! Simply log into your Dropbox account from anywhere in the world and you will be able to keep a tab on the most recent IP of your remote computer.  Use this IP (in the IP.txt file) to log in remotely using Tight VNC/Real VNC client!

Although the above solution works for a Windows machine, it can be tweaked slightly to work for Linux/Mac as well.

No comments:

Post a Comment