Install Hamachi on Ubuntu 9.04
***Update*** – Just made a new blog post about the current situation with Hamachi’s Linux Support. I highly suggest reading this here instead of messing with LogMeIn’s disregard for Linux support.
- To being we must install the ‘tun’ module to enable IP Tunneling support for the Linux kernel. Most do not have this setup by default.
- Open the modules file and add ‘tun’ to the list
- Your file should look similar to the example below.
- Save the file and exit out of nano (Ctrl-O to save & Ctrl-X to exit), lets move on and verify that a tunneling node has been created. (*If you have compiled your own kernel you likely need to recompile it with IP Tunneling support if you receive an error with modprobe. This is not covered in this guide. And if you are unsure, you most likely did not compile yourself and you would definitely remember doing so.)
- You should recieve a response like the example below
- If you received something along the lines of “No Such File or Directory” you may need to manually create the node in step 6. If you received the same response as I did, jump to step 7.
$ sudo mkdir /dev/net $ sudo mknod /dev/net/tun c 10 200
Jump back to Step 4 and you should now receive the correct response.
- With our IP Tunnel node created, it is time to install Hamachi itself. First download the latest version. As of writing this guide, the latest version is 0.9.9.9-20
- Extract our newly downloaded archive
- Navigate into the extracted directory
- Start the installation
- Run the tunnel
- This should complete the install, we will now configure the user permission in order for it to run correctly. Create a ‘hamachi’ user group
- Add youself as a user to the ‘hamachi’ group. Be sure to replace your user name where appropriate.
- Add the root user to the ‘hamachi’ group
- Set the correct permissions for the tuncfg socket
- Change the ownership of the socket file
- That should do it for the permissions, Now onto setting Hamachi up & configuring it to start as a system service.
- Start hamachi
- Set your computer’s nickname
- Login to the Hamachi network
- To join an existing network (optional) “NETWORKNAME” and “PASSKEY” should be replaced with your network name and network password
- To create a new network (optional) “NETWORKNAME” and “PASSKEY” should be replaced with your network name and network password
- If you joined an existing network you must tell hamachi to then “go-online”. Be sure to replace NETWORKNAME with your relevant network name.
- Check your hamachi status to verify everything is as it should be
$ sudo modprobe tun$ sudo nano /etc/modules
# /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. lp rtc tun
$ ls /dev/net/tun
/dev/net/tun
$ wget http://files.hamachi.cc/linux/hamachi-0.9.9.9-20-lnx.tar.gz
Expected output below
--2009-07-31 20:28:25-- http://files.hamachi.cc/linux/hamachi-0.9.9.9-20-lnx.tar.gz Resolving files.hamachi.cc... 69.25.20.50 Connecting to files.hamachi.cc|69.25.20.50|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 344866 (337K) [text/plain] Saving to: `hamachi-0.9.9.9-20-lnx.tar.gz' 100%[====================================================================>] 344,866 448K/s in 0.8s 2009-07-31 20:28:26 (448 KB/s) - `hamachi-0.9.9.9-20-lnx.tar.gz' saved [344866/344866]
$ tar zxvf hamachi-0.9.9.9-20-lnx.tar.gz
Expected output below
hamachi-0.9.9.9-20-lnx/ hamachi-0.9.9.9-20-lnx/Makefile hamachi-0.9.9.9-20-lnx/LICENSE hamachi-0.9.9.9-20-lnx/README hamachi-0.9.9.9-20-lnx/LICENSE.tuncfg hamachi-0.9.9.9-20-lnx/LICENSE.openssh hamachi-0.9.9.9-20-lnx/LICENSE.openssl hamachi-0.9.9.9-20-lnx/hamachi hamachi-0.9.9.9-20-lnx/tuncfg/ hamachi-0.9.9.9-20-lnx/tuncfg/Makefile hamachi-0.9.9.9-20-lnx/tuncfg/tuncfg.c hamachi-0.9.9.9-20-lnx/tuncfg/tuncfg hamachi-0.9.9.9-20-lnx/CHANGES
$ cd hamachi-0.9.9.9-20-lnx/
$ sudo make install
Expected output below
Copying hamachi into /usr/bin .. Creating hamachi-init symlink .. Compiling tuncfg .. Copying tuncfg into /sbin .. Hamachi is installed. See README for what to do next.
$ sudo tuncfg$ sudo groupadd hamachi$ sudo gpasswd -a YOURUSERNAME hamachi
$ sudo gpasswd -a root hamachi
$ sudo chmod 760 /var/run/tuncfg.sock
$ sudo chgrp hamachi /var/run/tuncfg.sock
$ sudo hamachi-init -c /etc/hamachi
Expected output
Initializing Hamachi configuration (/etc/hamachi). Please wait .. generating 2048-bit RSA keypair .. ok making /etc/hamachi directory .. ok saving /etc/hamachi/client.pub .. ok saving /etc/hamachi/client.pri .. ok saving /etc/hamachi/state .. ok Authentication information has been created. Hamachi can now be started with 'hamachi start' command and then brought online with 'hamachi login'.
$ sudo hamachi -c /etc/hamachi start
Expected output
Starting Hamachi hamachi-lnx-0.9.9.9-20 .. ok
$ sudo hamachi -c /etc/hamachi set-nick "COMPUTERNICKNAME"
$ sudo hamachi -c /etc/hamachi login
$ sudo hamachi -c /etc/hamachi join NETWORKNAME PASSKEY
$ sudo hamachi -c /etc/hamachi create NETWORKNAME PASSKEY
$ sudo hamachi -c /etc/hamachi go-online NETWORKNAME
$ sudo hamachi -c /etc/hamachi
Expected output
Hamachi, a zero-config virtual private networking utility, ver 0.9.9.9-20 version : hamachi-lnx-0.9.9.9-20 pid : 5472 status : logged in nickname : JauntyVM
Known Issues
And that pretty much completes the install. Just some words of advice from some small issues that I’ve run into. I’ve found it best to create a network with a Windows computer. The windows client supports network messaging, where the OS X and Linux clients do not. This is important because if you later choose to move control to https://my.hamachi.cc , only the windows client will be able to receive the network message and reply to it. Allowing administrative controls to be transfered and managed from the website. OS X and Linux clients cannot do this at this point in time.
Also, I’ve run into this randomly. I’m not sure exactly why, but some systems I install Hamachi on have incorrect routing tables. When pinging any one on the network, the ping fails with a “Network Unreachable“. I was able to find a solution here in this forum thread on the Ubuntu forums.
On the next page (page 3) I will demonstrate how to start Hamachi as a system service, allowing Hamachi to start when the computer boots up.






















26 Comments
hello im new in linux so i need help in this >>> when i want to start doing this guide then i fail in 1. task ‘ $ sudo modprobe tun ‘
when i write it then nothing happens so please help me how to continue :)
thanks
Tomas