# Trying to get Hamachi to work



## ArtemD (Nov 23, 2008)

Hello there fellow FreeBSD sysadmins

I have been trying to get Hamachi to work under FreeBSD 7.1-BETA2 (tried in 7.0 stable too) and all I get is this error when trying to run "hamachi start":

```
23 19:04:13.333 [   0] [20611] tap: recvmsg() failed 22
```

After this error hamachi-tuncfg dies.

If anyone knows a solution to this I (and I assume many others) would be grateful


----------



## Levenson (Nov 23, 2008)

First of all you should do this 

   Run '/usr/local/etc/rc.d/hamachi forcestart' from under the root account
   Run 'hamachi-init' to generate crypto identity (any account).
   Run 'hamachi start' to launch Hamachi daemon.
   Run 'hamachi login' to put the daemon online and to create an account.
   Run 'hamachi join <network>' to join the network.
   Run 'hamachi go-online <network>' to go online in the network.
   Run 'hamachi list' to list network members and their status.

here is more info


----------



## ArtemD (Nov 24, 2008)

Hi and thnx for the reply

I need to apologize for not mentioning that I followed the same steps you listed. Error occurs after I've done first 2 steps and try to do "hamachi start".


----------



## Mel_Flynn (Nov 24, 2008)

Hi, not familiar with the software in question, but recvmsg doesn't set EINVAL (errno 22). getsockopt(2) does, when:
[EINVAL]           Installing an accept_filter(9) on a non-listening
                        socket was attempted.

Does this make sense in the software context and possibly with your use of the accf_http module?


----------



## ArtemD (Nov 25, 2008)

I tried disabling accf_http and it didn't help


----------



## SirDice (Nov 25, 2008)

Is the if_tap kernel module loaded? Check with kldstat and ifconfig.


----------



## ArtemD (Nov 25, 2008)

Hello

if_tap.ko is loaded and tap0 device exists...and still hamachi gives the same error.


----------



## nixcamic (Feb 5, 2009)

I realize I'm resurrecting a really old thread here, but did you ever get this fixed? I'm having the same problem.


----------



## swmspam (Feb 20, 2009)

Wow, I'm a serious BSD n00b. My expertise is with Debian. I have several machines set up with intercompatibility with OSX, Debian, and Windows. However, I recently moved a lot of files to a new FreeNAS box, based on FreeBSD. I am currently trying to network it into my Hamachi network.

I ran kldstat to check dependencies. As expected (FreeNAS is a minimalist installation), linux.ko and if_tap.ko are not installed.

So I run

```
pkg_add -r linux-libgcc
```
and get a "File unavailable (e.g., file not found, no access". I browse ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.4-release/Latest/ and see that linux-libgcc is not available.

So now I try to install Hamachi and have FreeBSD solve the dependencies:

```
freenas:/#pkg_add -r linux-hamachi
Fetching ftp://ftp.freebsd.org/.../linux-hamachi.tbz... Done.
Fetching ftp://ftp.freebsd.org/.../linux_base-fc-4_13.tbz... Done.
Linux mode is not enabled.
Loading linux kernel module now...
kldload: can't load linux: No such file or directory
The linux kernel module could not be loaded.
Please enable linux mode manually and retry.
pkg_add: install script returned error status
pkg_add: pkg_add of dependency 'linux_base-fc-4_13' failed!
```

I can't even get started ... past the first step! What a n00b. Any suggestions to get me going?


----------



## MissileSilo (Feb 26, 2009)

I think you can't install this software on the amd64 version of FreeBSD. I tried installing it on FreeBSD 7.1 amd64 and got this error after I typed "hamachi start":


----------



## ArtemD (Feb 26, 2009)

Hi

I found this advice for getting Hamachi to work on FreeBSD. It was originally posted by Steven Borrelli on Facebook:



> I got it running, after many tries (and failures).
> 
> I'm using a minimal installation of FreeBSD 7.0. It's been a while since I dealt with the hamachi. I think i tried compiling it from the ports collection but the program didn't work, so I had to grab the hamachi OSX version of tuncfg. Specifically, I got hamachi-0.9.9.9-15-osx.tar.gz, copied tuncfg/tuncfg to /sbin/tuncfg, and I believe it worked just fine after that. So, here's my hamachi config script that I run at startup:
> 
> ...



I haven't tried it myself yet thou.

Best regards,
Artem


----------



## MissileSilo (Feb 26, 2009)

```
/sbin/tuncfg: Exec format error. Binary file not executable.
```


----------



## swmspam (Feb 27, 2009)

My problem is having all the right dependencies to compile tun. I can't get the "make" command to work. See http://apps.sourceforge.net/phpbb/f...23&t=617&sid=b8a5b612a2470352d3ab309fc2bf5491


----------



## chalbersma (Jul 5, 2009)

*I'm pretty sure I have Hamachi running.*

So here's what I did.

Added the ucl package because my network thought that it was a worm of some sort.  Life on a college campus eh?


```
$ sudo pkg_add -r ucl
```

Install hamachi


```
$ cd /usr/ports/security/hamachi
$ sudo make install
```


```
$ sudo /usr/local/etc/rc.d/hamachi forcestart
$ cd
$ hamachi-init
$ hamachi join <Network>
Password:
```

and I'm running

Good luck


----------



## MissileSilo (Jul 6, 2009)

chalbersma said:
			
		

> So here's what I did.
> 
> Added the ucl package because my network thought that it was a worm of some sort.  Life on a college campus eh?
> 
> ...




```
[root@freebsd64b72 /usr/ports/security/hamachi]# hamachi start
ELF binary type "0" not known.
su: /usr/local/bin/hamachi: cannot execute binary file
```


----------



## chalbersma (Jul 7, 2009)

Is your Linux compat turned on?

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-lbc-install.html


----------

