Hamachi on Mac OS X

Planning to run Hamachi under Mac OS X 10.5 Leopard? Please read this updated post instead.

Over the weekend, I had the need to create a VPN (Virtual Private Network) between a few MUG members and myself to use iChat through a proxy. I should mention that this did not help our paticular situation, as the proxy/firewall we were attempting to bypass was pickier than we first thought. However, I did learn how to use a great VPN tool, Hamachi, and I thought I would detail the steps needed to get it running under Mac OS X. Hamachi has been discussed at length in various episodes of the Security Now! podcast, which I highly recommend (In particular, episode #18 covers most of Hamachi).

The idea behind Hamachi is to create a secure virtual network between computers over the internet, and get them communicating as if they were all on the same local network together. Having all the computers on the same virtual LAN has numerous advantages, including connecting business networks, playing LAN games, and sharing files. Connections are made secure with the use of various encryption and handshake technologies which prevent prying eyes from seeing the information sent back and forth.

Hamachi for Windows is more advanced than the Mac version as far as point-and-click interfaces go, but the Mac version is quite stable and works just as well. To get started using Hamachi, first download and decompress the latest release. You’ll also need to grab the latest Tun/Tap driver here.

First, install the Tap package from the Tun/Tap file you downloaded earlier. Then, open the Terminal in your /Applications/Utilities folder, and type cd Desktop to change directory to your Desktop folder inside your Home folder. Do cd [hamachi], where [hamachi] is the folder that was made when you decompressed the downloaded file. In my case, the folder was titled hamachi-0.9.9.9-20-osx, so I did cd hamachi-0.9.9.9-20-osx. Your Terminal window is now navigated inside of the Hamachi folder, and you’re ready to start installing.

Installing Hamachi is quite easy — almost as easy as installing most Mac OS X applications. Type sudo ./install, followed by your administrator password. The admin password is required because Hamachi installs system-level components to make everything work. After the quick install is done, type sudo tuncfg. Tuncfg (tunnel configuration) sets up the VPN tunnel for Hamachi. From this point onward (until you reboot), your administrator password is not required, as Hamchi does all root level functionality in one fell swoop. Type hamachi-init to generate the cryptographic keys that will be used to protect your data as it speeds throughout the internet. Typing hamachi start will load Hamachi and prepare it for use.

As this point, you would also want to get Hamachi running on any other computers you would like on your virtual network, PC or Mac. PC users need only to download and run Hamachi, and they can all connect to the same network. Once that’s done, you’ll need a network for everybody to connect to. Again in the Terminal window, do hamachi create [network] where [network] is the 4 to 64 character name of the network you’d like to create. If the name is already in use, you can simply try again. When prompted for a password, do not enter your administrator password. What you’re being prompted for is the password to log onto your virtual network. Choose a word or phrase not in the dictionary, preferably longer than 8 characters. For security, the longer the password, the better. After your network is created, you can then instruct all your other computers to join the network using the password you chose.

After all the computers are connected in Hamachi, that’s it! You can view members of the network by doing hamachi list, and connect to their IPs (starting with “5.”) as if they were all on your own local network. One popular use for Hamachi is to share music on iTunes with your home computer (under Preferences, Sharing), and then install Hamachi at work. When both computers are connected, iTunes will be fooled into thinking your home computer is on your work computer’s network, so it will allow you to stream music to your workplace via the internet.

I should note that when your computer is restarted, you’ll have to do sudo tuncfg and hamachi start to re-run Hamachi. Also, the Hamachi OS X ReadMe has a listing of commands to delete networks, evict members, and other useful features that are worth a look.

Now that you’ve come this far “the hard way” by typing in commands and learning how to set up Hamachi on your own at the command line level, you should know about two graphical ways to use Hamachi. After using Hamachi for a few minutes, I thought it would be cool to run a Dashboard widget to control it. A single Google search turned up exactly what I had imagined. A third-party Mac OS X program, HamachiX, is also another great front end to Hamachi on the Mac. Both solutions work quite well, and may save you some time in setting up a quick VPN between your computer and others, anywhere else in the world.

Advertisements
Hamachi on Mac OS X

39 thoughts on “Hamachi on Mac OS X

  1. dikembe says:

    Awesome thanks for the writeup. I had heard rumblings of this program since some of my friends use it to share iTunes collections, and recently since apparently Hamachi was bought by Logmein, another program I use. Really good to read a writeup about it from someone who knows what they’re talking about. rock on

    Like

  2. I’ve been using Hamachi also for several months, like you as a result of the Security Now podcast. I’ve found Hamachi to be an excellent solution for remote filesharing with my Windows box (ugh) at work and my Ubuntu and Windows boxes at home from my PowerBook.

    I’ve found the Dashboard widget to be unresponsive and prone to timeouts when I move from location to location.

    I have not tried HamachiX, but I read some thigns about it that make me think it’s not yet ready for primetime. Maybe Logmein will do something about that.

    Like

  3. wb6fiu says:

    My wife handed over an iMac G5 since getting her new laptop. I’m having great fun getting to know the iMac and OS X. One thing I’m trying to figure out though, is HOW to get ‘sudo tuncfg’ & ‘hamachi start’ to auto-start. tuncfg needs a password, so I assume there will be a need for an ‘

    Like

  4. timmy says:

    thanks for explaining hamachi so well. It was pretty easy to load it reading your comments.
    I’d like to connect my g/5 to window’s pc’s at office. I had tried using timbuk tu as my front-end, but it shows the computers for 1 second and then closes the window be it on ‘observe’/’control’ mode (maybe its some bandwidth problem). I have even tried putting the machines to gray-scale but no luck!

    Any ideas what do i use—pref free :)
    tim

    Like

  5. With both machines on the same Hamachi network, you should be able to run Microsoft’s Remote Desktop for Mac and connect to the remote Windows machine’s Hamachi IP (5.x.x.x). While RDC isn’t a secure protocol, you’ll be going through an encrypted tunnel, so your traffic is safe from would-be attackers. Lastly, RDC offers a number of bandwidth-saving options in its Performance tab. It’s quite probably the best Mac app Microsoft produces.

    As for auto-starting ‘sudo tuncfg’ and ‘hamachi start’…I’m working on a solution I hope to post in the next couple days.

    Like

  6. Sensei says:

    Hi,
    I use Mac OS X 10.3.9.
    I’m Newbe to the OS X console but to install hamachi worked fine, I can list my other PCs, but how can I acess the data there?
    Thanks for helping!

    Like

  7. confused says:

    How come whenever i get to create network it just freezes?can u at least tell me what program to install hamachi into?

    Like

  8. t1ng says:

    “saving /Users/BasilBook/.hamachi/client.pub .. failed”

    The only thing I did different was to install the tun driver from the Tun/Tap package. Help please?

    Like

  9. dec says:

    I just cant get it to install, or get the turn/tap to install driving me crazy can any one help i am not familiar with applespacks and i just wanna ply fm08 with my friend online, is there any alternative to hamachi?

    Like

  10. dec says:

    I just cant get it to install, or get the turn/tap to install driving me crazy can any one help i am not familiar with macs and i just wanna ply fm08 with my friend online, is there any alternative to hamachi?

    Like

  11. Prakash says:

    when I run the command
    hamachi login [enter]
    i get “logging in….>…. failed”
    I do not know what to do after this ? Does anyone have an idea as to what I can do ?

    Like

  12. Carlitos says:

    hi i tried to use this program to play warcraft “Dota” in Lan. however when i created the game, my friends could’t see it does anyone have an idea as to what i can do? thanks

    Like

  13. tabul says:

    hello, I am new to mac os x leopard and i installed hamachi as well as the Tun/Tap driver, followed the instruction above but when I start hamachi it gives me this message,”tap: config.recv() failed 0 22
    05 23:41:53.357 [ 0] [ 260] Failed to configure tap device to use 5.209.199.178/4278190080″. what will i do? Thanks

    Like

  14. DTWave says:

    Hey has anyone or Collin figured out how to do the auto starting or auto ’sudo tuncfg’ and ‘hamachi start’ yet??
    I have attempted but can’t seem to get it working, i am just learning the Mac.
    Cheers

    Like

  15. rocket88 says:

    numerous things:

    1) the provided link for the tun/tap program comes up as a 404 not found, and other programs I have found do not have the kind of instructions available that someone of my limited knowledge with terminal commands can follow for installation and use. is there a new location for this program or set of instructions for another?

    2) when I enter ‘sudo funcfg’ I get the response:

    tuncfg: already running, use ‘killall tuncfg; tuncfg’ to restart it

    is this what I am supposed to get, or is this a problem? If so, how can I address it?

    3) when I enter ‘hamachi-init’ I get the response:

    hamachi-init: path /Users/rclay/.hamachi already exists (use -f to force using it)

    Again, is this the correct, or is it a problem I should fix?

    Like

  16. Mark says:

    Supposively i have installed hamachi but whenever i type (sudo tuncfg) its says there is no such file or directory please help me!!!!! Also i tried typing tuncfg and it says access denied!!!

    Like

  17. afzal says:

    i’m using the mac mini.

    when i keyed in hamachi-init and hamachi start, both responses were command not found. what did i do wrong?

    Like

  18. Tim says:

    hey man can you email me i cant seem to get this to work please that would be great all i need you to do is write EXACTLY how i do the commands in the terminal in order to get it so that i can download hamachi. Ty that would be so grreat if you could email me ty my reason for doing this btw is to do private servers on wow please respond ty

    Like

  19. Øyvind Horten says:

    I have a really big problem with Hamachi on Mac. I use the line-version (not HamachiX) and is not able to login. I get the message login failed every time. Any suggestions?

    Like

  20. Tlucz-huba says:

    Hi, I had the same problem when I was messing around with the HamachiX, in the Help -> install/uninstall support. On top of HamachiX not working at all I was able to hamachi login from terminal.

    I assume you have already installed TunTap.

    I fixed it by reinstalling the Hamachi:

    1. sudo -s (#provide your admin password when asked)
    2. cd /usr/bin
    3. rm hamachi
    4. rm hamachi-init
    5. cd /
    6. ./install

    Copying hamachi into /usr/bin ..
    Creating hamachi-init symlink ..
    Compiling tuncfg ..
    Copying tuncfg into /usr/sbin ..

    Hamachi is installed. See README for what to do next.

    7. cd /usr/bin
    8. ./hamachi-init -f

    generating 2048-bit RSA keypair .. ok
    making /Users//.hamachi directory .. ok
    saving /Users//.hamachi/client.pub .. ok
    saving /Users//.hamachi/client.pri .. ok
    saving /Users//.hamachi/state .. ok

    Authentication information has been created. Hamachi can now be started with
    ‘hamachi start’ command and then brought online with ‘hamachi login’.

    9. hamachi start
    10. hamachi login

    that should do.

    Like

  21. jojo says:

    Hey. I really want to use this for Lan games, and i’ve gotten to the point where i’m trying to create a network, but when i type “hamachi create [my network name]” it says “This is an online operation and you are not logged in.”

    how can i get this to work?????

    Like

  22. Tevin Jackson says:

    Hi, I tried to download the Hamachi X widget by clicking on the links in the article however something is wrong with the websites that the links connect to. Please help me as soon as possible. Thanks and by the way great write up!

    Like

  23. JX says:

    jojo: Type in “hamachi login”, then type in “hamachi create [server name]”, then it should work.

    Halvard: When it asks you to type in the password it does allow you to insert it, however it doesn’t show you as typing it, I’m not sure of the reason, must be for security, but you are indeed typing, just type it and press enter, it should work.

    -JX

    Like

  24. Ross says:

    hey im having trouble with the actual logging in. ive installed it all and found a interface but when it comes to logging in. nothing.

    any suggestions?

    Like

  25. Seraphim says:

    woody:

    after you “sudo ./install” hamachi it says:

    Copying hamachi into /usr/bin ..
    Creating hamachi-init symlink ..
    Copying tuncfg into /usr/sbin ..

    Hamachi is installed. See README for what to do next.

    You should then type:

    cd /usr/bin (then press enter)
    sudo ./hamachi-init -f (then press enter)

    thats what fixed it for me, it just needed the extra sudo command on the last line… it should prompt for your password and then it’ll save the client.pub without any problems… hope this helps

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s