Click to viewNeed to look up a phone number on your home computer from the office? Or control the headless media server you set up at your buddy's place across town? Or help Mom figure out how to use Flickr? You already know that Virtual Network Computing (VNC) remote controls computers over the internet. But VNC is not a secure protocol - and it won't work if the remote machine is behind a firewall you don't control.

Advertisement

However, pairing up VNC with Hamachi, a Virtual Private Network application, you can remote control any computer securely over your private network across any combination of operating systems. Today we'll cover how to drive a computer over the internet with the free, secure and cross-platform VNC and Hamachi, the chocolate and peanut butter of remote computing.

The last time I wrote about VNC, several of you asked, "But why not easier-to-set-up solutions like LogMeIn.com?" Well, mostly because VNC software is cross-platform and free (as in speech - no upsell). It works on the Mac, Linux and Windows - and it offers a level of granular control that you don't get with third party services in the middle. It does require some comfort with advanced networking concepts, though, and I hear LogMeIn (which owns Hamachi, coincidentally) is great, so don't let me stop you from going that route.

Ready to set up VNC with Hamachi? Here's how.

1. Create your Hamachi network.

We've already covered in detail how to create your own virtual private network with Hamachi. Both the controller computer and controllee computer must have Hamachi installed; and make sure each joins one single network. Mac users, the HamachiX desktop app is a point and click way to get on your new private network if you don't want to wrangle with the Terminal.

Once you're all set up, your computers will appear in a Hamachi network with their own Hamachi-specific IP addresses as shown on the right.

2. Assign a memorable name to your server.

Now that your computers are on your virtual network, you'll want to address the VNC server easily. While you can type in its full Hamachi IP address, instead you can give it a memorable name (like "home-mac" or "workpc") by adding its IP and name to your computer's hosts file. If the VNC server on your network had an IP address of 123.456.789.0 and you wanted to address it as "workpc," here's what you'd do:

Windows

Using Notepad or some other text editor, open the file named "hosts", which is located in the following directory:

Windows XP/Vista = C:\WINDOWS\SYSTEM32\DRIVERS\ETC

Windows 2K = C:\WINNT\SYSTEM32\DRIVERS\ETC

Windows 98/ME = C:\WINDOWS

Add the following on its own line in the hosts file, using the sites that apply to you:

123.456.789.0 workpc

Save and quit.

Mac OS/X

In Finder, from the Go menu, choose "Go to folder."

In the "Go to the folder" dialog, type "/etc/".

From the /etc/ folder window, open the "hosts" file in a text editor.

Add the following to the hosts file in its own line, using the site that applies to you:

123.456.789.0 workpc

Save and quit.

3. Set up the VNC server and client.

Here are instructions on how to set up a VNC server and client. The controllee computer will run the server and the controller computer will run the VNC viewer. Free VNC client and server software is available for Mac, PC and Linux.

4. Restrict access to only computers in your Hamachi private network.

In order to connect to the VNC server, the port it's running on (5900 by default) has to be opened up on your computer's software firewall. Additionally, when you're using Hamachi and its predefined IP addresses, for an extra layer of security you can restrict access to that port to only computers on your Hamachi network. Firewall configurations vary from product to product, but in Windows Firewall, you'd go to the exceptions tab to open the VNC server, as shown.

Click on the Edit button to specify the IP addresses allowed into the VNC server - that is, the Hamachi IP of your viewer computer.

6. Connect to the VNC server over the secure, encrypted, private Hamachi network.

When it comes time to connect, first make sure both the VNC server and viewer computers are on the Hamachi network. From the viewer computer, enter the name of the server in the VNC client and click Ok.

Here's a screengrab of a VNC connection to my Mac and Windows XP machine from Vista. Click to enlarge (warning: this one's pretty wide):

Also, remember that Hamachi makes any server connection a secure one. You can also use Hamachi to make secure connections to your personal web server, home FTP server, home wiki installation, shared Windows folders, or simply use it to stream a remote iTunes library across the internet, too.

What's your favorite remote control or VPN software? Let us know in the comments.

Gina Trapani, the editor of Lifehacker, thinks Hamachi + VNC = the cat's pajamas. Her semi-weekly feature, Geek to Live, appears every Wednesday and Friday on Lifehacker. Subscribe to the Geek to Live feed to get new installments in your newsreader.