How to Install and Configure Hamachi in Ubuntu

Spread the love

LogMeIn Hamachi is a zero-configuration Virtual Private Network (VPN) that works with your existing firewall and allows you to access your computer no matter where you are, as long as there is an Internet connection.

While there is a nice interface for the Windows version, Linux users can only access Hamachi via the command line interface. Nevertheless, with some help from the open-source community, Linux users can now easily install, configure and use Hamachi. This tutorial demonstrates the process for Ubuntu.

Tip: if you can’t get the Ubuntu terminal to open to run commands, we have a few fixes for you.

Content

How Hamachi Works

At its core, Hamachi is a proprietary VPN adapter that provides a virtual LAN through an overlay network.

Image source:
Hamachi

Unlike traditional VPNs, such as NordVPN (see our NordVPN review for reference), Hamachi does not route any Internet traffic in and out of its servers. Instead, it allows you to create a secure, closed LAN between different computers, as Hamachi is useful in instances where you want to share a network service without exposing your host computer. For example, you can use it to start an SFTP server and share its contents only to a select few computers.

This Virtual LAN approach also allows you to use Hamachi for both peer-to-peer and local server gaming, making Hamachi invaluable for users who want to play games on Linux over the Internet without porting forward their connections.

Installing Hamachi in Ubuntu

  1. Download Hamachi’s .deb package from the developer’s website with the following command. (The Hamachi client software does not exist in the Ubuntu Software Repository.)
wget https://www.vpn.net/installers/logmein-hamachi_2.1.0.203-1_amd64.deb

  1. Install the Hamachi package through dpkg with the following command. Unlike apt, dpkg is a manual package manager for Debian and Ubuntu.
sudo dpkg -i ./logmein-hamachi_2.1.0.203-1_amd64.deb
  1. Check whether you have properly installed Hamachi by running sudo hamachi help.

Configuring Hamachi in Ubuntu

  1. Start setting up Hamachi on your Ubuntu machine. Configuring the program requires you to have a valid Hamachi account, which you can sign up for from the LogMeIn registration page.

Image source:
Hamachi

  1. Once you have a valid account, you can use the Hamachi CLI to connect to the LogMeIn network:
sudo hamachi login

  1. Create a new Hamachi network from the command line. For example, I am running the following command to create a new network using the name “MySecretNetwork1.”
sudo hamachi create mysecretnetwork1 verysecurepassword

  1. With a network up and running, use the Hamachi CLI to connect two machines – install Hamachi on a separate computer and use the join command:
sudo hamachi join mysecretnetwork1 verysecurepassword

Lastly, it is also possible to evict and delete an existing Hamachi network. For example, running the following commands will evict a peer using its Client ID and delete the network:

sudo hamachi evict mysecretnetwork1 088-167-874
sudo hamachi delete mysecretnetwork1

Managing a Hamachi Network With the Haguichi GUI

Aside from directly using the terminal, it is possible to use Haguichi to create and manage a Hamachi network. This third-party GUI wraps around the Hamachi CLI client and presents its functions in a desktop window, which is useful if you are a new user and still not comfortable with the Bash command line.

To install the Haguichi GUI, follow the steps below.

  1. Add the Haguichi repository to your Ubuntu machine:
sudo add-apt-repository -y ppa:ztefn/haguichi-stable

  1. Run the following commands to update your machine’s repository files and install the Haguichi GUI:
sudo apt update
sudo apt install haguichi
  1. Run the Haguichi GUI by pressing Win and typing “haguichi.”

  1. A window will open, asking you to configure your Hamachi client. Press the green “Configure” button to proceed.

  1. The Haguichi GUI will create an account for your machine and display information about the current Hamachi version on your system.

  1. Click the “+” button in the title bar of the Haguichi GUI to open the menu that allows you to join or create a network, then click “Create Network.”

  1. A small prompt will open, asking for the details of your new network. I am naming it “MySecretNetwork1” and providing a secure password.

  1. With Haguichi running, connect other machines to your new network by clicking the “+” button and selecting “Join Network.”

  1. You will see a small prompt where you can provide your network details. In my case, I will connect to “MySecretNetwork1.”

Frequently Asked Questions

Is it possible to install Haguichi on non-Ubuntu systems?

Yes! While Haguichi is primarily available for Ubuntu and Debian systems, it is also possible to install this program on other Linux distributions. For example, you can run sudo dnf copr enable ztfen/hacuighi && sudo dnf install haguichi to install the program in Fedora.

Further, Haguichi is also available in Flathub as a distribution-independent package that you can install with: sudo flatpak install flathub com.github.ztefn.haguichi.

I cannot include the Haguichi PPA in my system.

This most likely happens due to an issue between your Internet provider and your machine’s IPv6 address resolver. By default, the Ubuntu Launchpad PPA system uses IPv6 when adding and removing repositories, which means that Ubuntu will use IPv6, whether or not your network connection can support it.

This connection mismatch can be an issue if your current network provider does not support IPv6. To fix this, disable your system’s IPv6 support by running sysctl: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 to force Ubuntu to route every connection it makes to IPv4 instead.

Is it possible to manage my Hamachi clients outside of my Ubuntu machine?

Yes! It is possible using the attach-net command along with your LogMeIn e-mail address: sudo hamachi attach-net ramces@email.invalid.

That will link every Hamachi network you created in your Ubuntu machine to your online LogMeIn account, allowing you to remotely manage these networks even if your Ubuntu machine is offline.

Image credit: Unsplash. All alterations and screenshots by Ramces Red.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time. Subscribe


Ramces Red
Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.

Comments are closed