Difference between revisions of "Hamachi"

From ArchWiki
Jump to: navigation, search
m (Configuration: Hamachi 2 is in beta)
(Fixed some typos and made it more clear that the Configuration: section only applies to Hamachi 2.)
Line 6: Line 6:
 
To run Hamachi you need /dev/net/tun.  
 
To run Hamachi you need /dev/net/tun.  
  
This is created by the tun module. As root run,
+
This is created by the tun module. As root, run:
 
{{bc|
 
{{bc|
 
modprobe tun
 
modprobe tun
 
}}
 
}}
  
Or you can manually create /dev/net/tun by running...
+
Or you can manually create /dev/net/tun by running:
 
{{bc|
 
{{bc|
 
mkdir /dev/net
 
mkdir /dev/net
Line 26: Line 26:
 
===Manual installation===
 
===Manual installation===
 
{{accuracy|reason=Why use make install and skip package management?}}
 
{{accuracy|reason=Why use make install and skip package management?}}
Head to [http://files.hamachi.cc/linux/ hamachi.cc] and download their linux client.
+
Head to [http://files.hamachi.cc/linux/ hamachi.cc] and download their Linux client.
  
Untar it  
+
Untar it:
 
{{bc|
 
{{bc|
 
tar zxvf hamachi-x.x.x-x.tar.gz
 
tar zxvf hamachi-x.x.x-x.tar.gz
Line 39: Line 39:
 
}}
 
}}
  
And run tunecfg
+
And run tuncfg:
 
{{bc|
 
{{bc|
 
cd tuncfg
 
cd tuncfg
Line 45: Line 45:
 
}}
 
}}
  
Run hamachi-init
+
Run hamachi-init:
 
{{bc|
 
{{bc|
 
$hamachi-init
 
$hamachi-init
 
}}
 
}}
And thats the installation.
 
  
===Version 2 beta===
+
And that's the installation.
  
Version 2 of the Linux Hamachi client exists, and is currently in beta.  It is available from [https://secure.logmein.com/US/labs/ the labs page on the Hamachi website]; however, the vendor's tarball requires LSB and will not install correctly. You should use the {{AUR|logmein-hamachi}} package from the [[AUR]] instead.
+
===Hamachi 2 (beta)===
 +
 
 +
Version 2 of the Linux Hamachi client exists and is currently in beta.  It is available from [https://secure.logmein.com/US/labs/ the labs page on the Hamachi website]; however, the vendor's tarball requires LSB and will not install correctly. You should use the {{AUR|logmein-hamachi}} package from the [[AUR]] instead.
  
 
==Configuration==
 
==Configuration==
{{Note|The following section only applies to Hamachi version 2 (beta).}}
 
  
Configuration is done in {{ic|/var/lib/logmein-hamachi/h2-engine-override.cfg}} (create that file if it doesn't exist).
+
=== Hamachi 2 (beta) ===
 +
 
 +
Hamachi 2 is configured in {{ic|/var/lib/logmein-hamachi/h2-engine-override.cfg}} (create that file if it doesn't exist).
 
Unfortunately, it isn't easy to find a comprehensive list of possible configuration options, so here are a few that you can use.
 
Unfortunately, it isn't easy to find a comprehensive list of possible configuration options, so here are a few that you can use.
  
===Using the hamachi command line tool as a regular user===
+
====Using the hamachi command line tool as a regular user====
 
In order to use the {{ic|hamachi}} command line tool as a regular user, add the following line to the configuration file:
 
In order to use the {{ic|hamachi}} command line tool as a regular user, add the following line to the configuration file:
 
{{bc|Ipc.User YourUserNameHere}}
 
{{bc|Ipc.User YourUserNameHere}}
  
===Automatically setting a custom nickname===
+
====Automatically setting a custom nickname====
 
Normally, Hamachi uses your system's hostname as the nickname that other Hamachi users will see. If you want to automatically set a custom nickname every time Hamachi starts, add the following line to the configuration file:
 
Normally, Hamachi uses your system's hostname as the nickname that other Hamachi users will see. If you want to automatically set a custom nickname every time Hamachi starts, add the following line to the configuration file:
 
{{bc|Setup.AutoNick YourNicknameHere}}
 
{{bc|Setup.AutoNick YourNicknameHere}}
Line 79: Line 81:
 
$hamachi start
 
$hamachi start
 
}}
 
}}
Now you have a whole bunch of commands at your disposal. These are in no particular order, and are fairly self explanitory.  
+
Now you have a whole bunch of commands at your disposal. These are in no particular order and are fairly self explanatory.  
  
 
{{bc|
 
{{bc|
Line 90: Line 92:
 
}}
 
}}
  
To get a list of all the commands just run:
+
To get a list of all the commands, run:
 
{{bc|
 
{{bc|
 
$hamachi ?
 
$hamachi ?
 
}}
 
}}
  
'''Note:''' Make sure you change the status of the channel(s) you are in to online if you want to perform any network actions on computers in there.
+
'''Note:''' Make sure you change the status of the channel(s) you are in to "online" if you want to perform any network actions on computers in there.
  
 
===As a Daemon===
 
===As a Daemon===
  
You can run hamachi as a daemon this way:
+
You can run Hamachi as a daemon this way:
  
 
Copy your configuration to ''/root'' directory:
 
Copy your configuration to ''/root'' directory:
Line 152: Line 154:
 
</nowiki>}}
 
</nowiki>}}
  
Remeber to add ''hamachi'' to your ''daemons'' array in ''/etc/rc.conf'', it should be put after ''tuntap''.
+
Remember to add ''hamachi'' to your ''daemons'' array in ''/etc/rc.conf'', it should be put after ''tuntap''.
  
 
And do not forget to:  
 
And do not forget to:  
Line 161: Line 163:
  
 
==GUI==
 
==GUI==
Various GUI frontends to hamachi are available in the AUR.
+
Various GUI frontends for Hamachi are available in the AUR.
  
For hamachi 1:
+
For Hamachi 1:
  
 
*haguichi (Gtk2, mono)
 
*haguichi (Gtk2, mono)
Line 169: Line 171:
 
*hamachi-gui (Gtk2)
 
*hamachi-gui (Gtk2)
  
For hamachi 2 beta:
+
For Hamachi 2 (beta):
  
 
*quamachi (Qt4)
 
*quamachi (Qt4)
Line 175: Line 177:
  
 
==Troubleshooting==
 
==Troubleshooting==
===If Hamachi times out soon after launch===
+
===Hamachi times out soon after launch===
 
If hamachi stops working after a short period of time it can be that the client is timing out. Create ~/.hamachi/config and add the following to it:
 
If hamachi stops working after a short period of time it can be that the client is timing out. Create ~/.hamachi/config and add the following to it:
 
   
 
   
Line 182: Line 184:
 
}}
 
}}
  
===If you have problem connecting to some hosts===
+
===If you have problems connecting to some hosts===
Check if they are using Hamachi2, if that is the case then it is a known issue in Hamachi2 client connecting to the Hamachi linux client.
+
Check if they are using Hamachi 2. If that is the case, then it is a known issue with the Hamachi 2 client connecting to the Hamachi Linux client.
  
===If ''/etc/init.d/logmein-hamachi'' is not found===
+
===''/etc/init.d/logmein-hamachi'' is not found===
Replace this with ''/etc/rc.d/logmein-hamachi''.
+
Replace that path with ''/etc/rc.d/logmein-hamachi''.
  
 
===Error when trying to run hamachi-init===
 
===Error when trying to run hamachi-init===
If there is error while trying to load libstdc++.so.5 you want to install it can be found from extra repository so you can install it with Pacman -S libstdc++5
+
If there is an error while trying to load libstdc++.so.5, you want to install it. This library can be found in the ''extra'' repository, so you can install it by running {{ic|pacman -S libstdc++5}}.
  
If you get error while trying to load libcrypto.so.0.9.7 temporarily solution is to create link from /usr/lib/libcrypto.so.0.9.7 to /usr/lib/libcrypto.so with ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0.9.7
+
If you get an error while trying to load libcrypto.so.0.9.7, a temporary solution is to create a link from /usr/lib/libcrypto.so.0.9.7 to /usr/lib/libcrypto.so by running {{ic|ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0.9.7}}.
  
===See also===
+
==See also==
 
* [https://secure.logmein.com/products/hamachi/ Project home page]
 
* [https://secure.logmein.com/products/hamachi/ Project home page]

Revision as of 12:48, 30 June 2012

Hamachi is a proprietary (closed source) commercial VPN software. With Hamachi you can organize two or more computers with an Internet connection into their own virtual network for direct secure communication.

Initial Configuration

To run Hamachi you need /dev/net/tun.

This is created by the tun module. As root, run:

modprobe tun

Or you can manually create /dev/net/tun by running:

mkdir /dev/net
mknod /dev/net/tun c 10 200

Also, make sure to add the "tun" modules to rc.conf so that /dev/net/tun is created next time your computer turns on.

MODULES=(... ... ... ... ... tun ... ... ...)

Download And Install Hamachi

Manual installation

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Why use make install and skip package management? (Discuss in Talk:Hamachi#)

Head to hamachi.cc and download their Linux client.

Untar it:

tar zxvf hamachi-x.x.x-x.tar.gz

Compile:

cd hamachi-x.x.x-x
make install

And run tuncfg:

cd tuncfg
./tuncfg

Run hamachi-init:

$hamachi-init

And that's the installation.

Hamachi 2 (beta)

Version 2 of the Linux Hamachi client exists and is currently in beta. It is available from the labs page on the Hamachi website; however, the vendor's tarball requires LSB and will not install correctly. You should use the logmein-hamachiAUR package from the AUR instead.

Configuration

Hamachi 2 (beta)

Hamachi 2 is configured in /var/lib/logmein-hamachi/h2-engine-override.cfg (create that file if it doesn't exist). Unfortunately, it isn't easy to find a comprehensive list of possible configuration options, so here are a few that you can use.

Using the hamachi command line tool as a regular user

In order to use the hamachi command line tool as a regular user, add the following line to the configuration file:

Ipc.User YourUserNameHere

Automatically setting a custom nickname

Normally, Hamachi uses your system's hostname as the nickname that other Hamachi users will see. If you want to automatically set a custom nickname every time Hamachi starts, add the following line to the configuration file:

Setup.AutoNick YourNicknameHere

You can also manually set a nickname using the hamachi command line tool:

# hamachi set-nick YourNicknameHere

However, this needs to be done every time Hamachi is (re-)started, so if you always want to use the same nickname, setting it automatically (as explained above) is probably easier.

Running Hamachi

Start up the (matt) daemon

$hamachi start

Now you have a whole bunch of commands at your disposal. These are in no particular order and are fairly self explanatory.

$hamachi set-nick bob
$hamachi login
$hamachi create my-net secretpassword
$hamachi go-online my-net
$hamachi list
$hamachi go-offline my-net

To get a list of all the commands, run:

$hamachi ?

Note: Make sure you change the status of the channel(s) you are in to "online" if you want to perform any network actions on computers in there.

As a Daemon

You can run Hamachi as a daemon this way:

Copy your configuration to /root directory:

cp -R ~/.hamachi /root/

Create a script in /etc/rc.d/ called hamachi using your preferred editor:

. /etc/rc.conf
. /etc/rc.d/functions

DAEMON=/usr/bin/hamachi
NAME=hamachi
DESC="Hamachi VPN client"
PID_FILE=/var/run/daemons/hamachi

case "$1" in
    start)
        #Check for running tuntap, start when not running
        ck_daemon tuntap && /etc/rc.d/tuntap start
        stat_busy "Starting $DESC"
        $DAEMON -c /root/.hamachi $1 > /dev/null
        if [ $? -gt 0 ]; then
            stat_fail
        else
            add_daemon $NAME
            stat_done
        fi
        ;;
    stop)
        stat_busy "Stopping $DESC"
        [ -f $PID_FILE ] && $DAEMON -c /root/.hamachi $1 > /dev/null
        if [ $? -gt 0 ]; then
            stat_fail
        else
            rm_daemon $NAME
            stat_done
        fi
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "usage: $0 {start|stop|restart}"
	;;
esac
exit 0

Remember to add hamachi to your daemons array in /etc/rc.conf, it should be put after tuntap.

And do not forget to:

chmod +x /etc/rc.d/hamachi

GUI

Various GUI frontends for Hamachi are available in the AUR.

For Hamachi 1:

  • haguichi (Gtk2, mono)
  • ghamachi (Gtk2)
  • hamachi-gui (Gtk2)

For Hamachi 2 (beta):

  • quamachi (Qt4)
  • haguichi (Gtk2, mono)

Troubleshooting

Hamachi times out soon after launch

If hamachi stops working after a short period of time it can be that the client is timing out. Create ~/.hamachi/config and add the following to it:

KeepAlive 10

If you have problems connecting to some hosts

Check if they are using Hamachi 2. If that is the case, then it is a known issue with the Hamachi 2 client connecting to the Hamachi Linux client.

/etc/init.d/logmein-hamachi is not found

Replace that path with /etc/rc.d/logmein-hamachi.

Error when trying to run hamachi-init

If there is an error while trying to load libstdc++.so.5, you want to install it. This library can be found in the extra repository, so you can install it by running pacman -S libstdc++5.

If you get an error while trying to load libcrypto.so.0.9.7, a temporary solution is to create a link from /usr/lib/libcrypto.so.0.9.7 to /usr/lib/libcrypto.so by running ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0.9.7.

See also