
Hamachi is a great, open source Virtual Private Network tool that requires very little configuration, and is easy to use. Here I’ll show you how I install it under Ubuntu (the Windows install is all point and click) and then go about using it!
This is a draft how-to, based on my limited and personal experience with Hamachi. If you’d like some expert advice, or have a problem or question that isn’t covered here, I suggest you check out their forums. I know I’ll be spending some time there!
First, you’ll need to download Hamachi. Get the latest build for Linux, Windows and OSX here!
I’m going to assume that you’ve downloaded it to your desktop. I like to move new tools and things that I don’t have a ton of experience with to the /opt (optional) directory. Let’s go ahead and do that.
In a terminal, type the following:
cd /opt
cp ~/Desktop/ham*.tar.gz
Now it’s in /opt, let’s first make sure we have all the tools we’ll need to install it. You’ll have to have make and bin-utils on your machine. If you’re not sure if you have them or not, you can use apt-get to install them.
sudo apt-get install make binutils
Let’s untar Hamachi.
tar -xvzf hamachi*tar.gz
That will create a hamachi(someversion#) folder. Let’s go in there and install this thing.
cd ham*
sudo make install
That shouldn’t take too long and now you’ve got Hamachi on your system. Let’s go through the basics of using Hamachi.
Back in your terminal session, let’s start up tun and initialize hamachi:
sudo tuncfg
hamachi-init
This will get Hamachi ready to run on your system. Now let’s go back to your home directory and start this up.
cd
hamachi start
Hamachi should now be running. Now we’ll have to tell it to do a few things. The first thing is to put Hamachi online and create an account. In this example the account we’ll create will be called foobar, so change that to something you want.
hamachi login foobar
Hamachi will then need a virtual network to join. This is where you’ll park all of your machines so that they can reach each other as needed. In this example we’ll use the boofar network, again replace it with what you want.
hamachi join barfoo
You’ll be asked to input a password.
Now, let’s join the barfoo network
hamachi go-online barfoo
Now you’re online with Hamachi! Congratulations! However, there’s not much more you can do with this nifty tool until you get at least one other computer online with Hamachi. If you want to do that either install the Windows client on a windows machine or do this again for another Linux machine. Now however, you won’t have to create the barfoo network, but when you tell it to join the barfoo network, it will ask you for the password you created above.
So, now you’ve got two machines on Hamachi? Great! Let’s start with another windows machine. Once it’s online and running, you should see your linux machine on it. Let’s come back to our Linux box and take a look too.
hamachi list
This will show you the virtual IP (listed first) which will be something like 5.82.61.209 and then the actual IP address and port of your other machine.
Let’s test connectivity by pinging the virtual IP. Replace the IP you want to ping with the one I’m using in this example.
ping 5.82.61.209
You should be getting a response! Congratulations! Your first contact on the Hamachi network.
Now, we’re going to have to look at some options here. I’m going to assume that you want to connect to your Windows machine from your Linux box via Hamachi and also the other way around. I’m also going to assume that you’d like to connect from one Linux machine to another this same way. So first let’s configure your Linux machines to allow remote connections.
To do this, we’re going to install tightvncserver and xtightvncviewer. Here’s how to install them:
sudo apt-get install tightvncserver xtightvncviewer
Once that’s installed, you’re going to want to start it up.
tightvncserver
It should ask you for a password, so give it one. A good strong one. If you’re interested in VNC, you can read a lot more about it here.
Now, we’ve got a way for others to connect to a Linux machine. If you have other Linux machines, you’re going to want to do this for them as well.
Over to your Windows machine. We’re going to install something called RealVNC server. It’s the same technology but for a Windows machine. So go here, grab it and install it.
Once it’s installed and running, you should see a VNC icon in your system tray. Right click on it and choose options. Then go to the configuration tab for remote desktop and enable it. Set the options to what you’d like.
Still with me? Good! Now you should be able to go back to your Linux machine, and type
hamachi list
Is your Windows machine still there? Great, let’s connect to it! Note the virtual IP address given to it by Hamachi – say it’s 5.80.21.10
xtightvncviewr 5.80.21.10
You should be prompted for a password. This is one that you set up when you installed RealVNC on your windows machine. Once you type it in, you should have control of your Windows machine!
You can also use your terminal server client in Ubuntu by going to Applications-> Internet -> Terminal Server Client. If for some reason you don’t have this, you can install it by doing this:
sudo apt-get install tsclient
Just make sure to set your connection type as VNC.
Now, to do it the other way. On your Windows machine, open up your Hamachi client, and note the virtual IP of your Linux machine.
Right click on your RealVNC icon in your systray and select “Add Clientâ€. Type that IP address into it and you should be prompted for a password. Once you enter your password, you can connect!
For those interested, there’s also a GUI control panel in the works for Linux, which is shaping up quite nicely. It’s called gHamachi and you can find it here. It seems to work fine under Ubuntu 6.06 but not so hot yet on 6.10 (Edgy).
Once you download this, simply right click on it, choose “Extract hereâ€, double click on the resulting folder, and double click on the ‘ghamachi’ icon. This has some neat features already, like the ability to right click on a node and choose VNC, then connect to it.
Once you have systems on Hamachi, you can connect to them in any way you normally would (i.e. ssh, scp, samba or windows shares). Hamachi is interesting because it offers a central location where you can see all of your machines, as well as encryption to help protect your privacy.
Keep an eye on this application and gHamachi as well, as I expect they’re going to be pretty hot in the near future.
Technorati Tags: hamachi, ubuntu, windows, remote desktop, arsgeek















0 Comments For This Post
1 Trackbacks For This Post
October 17th, 2006 at 11:38 pm
[...] Using Hamachi to remotely control your Windows and Linux boxes [...]
Leave a Reply