Hamachi: Failed to connect to the engine

After getting the Hamachi 2 update (without a prior notice, nicely done… No more auto update if they continue to break stuff) I started to notice a bunch of XPs receiving this error after a reboot: Failed to connect to the engine.

Hamachi is auto started, at boot, because we have a shortcut in the startup folder. No other way to auto start the free version (as far as I know).

Yet, when starting Hamachi manually after the PC had booted, there were no more errors. So it’s clear Hamachi tried to start before the engine (see services.msc -> LogMeIn Hamachi Engine or something) was started.

And reinstalling Hamachi only seemed to work on one of the XPs.

As there’s no easy way to delay the starting up of a program, I used some dirty vbs and batch… Kinda.

Here’s my solution:

Place both scripts in the Hamachi directory (c:\program files\logmein hamachi\)

hamachiStart.vbs:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & ".\hamachi.bat" & Chr(34), 0
Set WshShell = Nothing

hamachi.bat:

@echo off
ping -n 30 127.0.0.1 >NUL
"C:\Program Files\LogMeIn Hamachi\hamachi-2-ui.exe"
exit

Hamachi.vbs will start the bat file. This seems to be the only way to prevent a command prompt from opening (and staying open all the time).

Hamachi.bat will ping itself for 30ish seconds (don’t think there’s a cleaner way to do this…) and then start the Hamachi GUI.

If you’re still having problems, increase 30 to something like 60 or even more.

Anyway, last thing you’ll need to do is to make a shortcut of hamachi.vbs, and drag it into the startup folder.

Reboot, wait a bit, and enjoy.

Console Hamachi

I wrote before, that the console version of Hamachi didn’t seem to generate tun/tap driver errors. But after rebooting my Mac I was no longer able to start Hamachi.

1
2
Nazgul:hamachi-0.9.9.9-20-osx yeri$ ./hamachi start
25 19:08:15.659 [   0] [14306] tap: connect() failed 2 (No such file or directory)

So I guess I’ll have to wait for a fix after all. ๐Ÿ™

Hamachi(X) on Leopard

When playing with KisMAC, I noticed something weird in my /var/log/system.log;

1
2
3
4
$date com.apple.launchd[1] (tuncfgd$pid) posix_spawnp("/usr/sbin/tuncfg", ...):
No such file or directory
$date com.apple.launchd[1] (tuncfgd$pid) Exited with exit code: 1
$date com.apple.launchd[1] (tuncfgd) Throttling respawn: Will start in 10 seconds

tun is (trying) to restart every 10 (!) seconds.
I tried updating Hamachi‘s tun/tap drivers, without any success. It kept restarting the process every 10 seconds.

After a bit of Googling, it seemed to be a known problem. So I decided to uninstall Hamachi & the tun/tap drivers.

1
2
3
4
5
6
sudo rm -r /usr/bin/hamachi
sudo rm -r  /usr/bin/hamachi-init
sudo rm -r  /usr/sbin/tuncfg
sudo launchctl unload /System/Library/LaunchDaemons/tuncfgd.plist
sudo rm -r /System/Library/LaunchDaemons/tuncfgd.plist
sudo rm -r /Applications/HamachiX

This should solve the restarting problem. You might want to reboot to be sure.

When uninstalling the drivers, HamachiX will be gone; there will be no way to use it. You can decide to ignore the spawning-processes, and keep using Hamachi as-is, but the spawning processes might slow down your computer. But HamachiX should work (although it often crashed here).

I tried reinstalling the tun/tap drivers, but the same happens. I guess I’ll have to wait for a fix. ๐Ÿ™

On the other side, I’ve tried the console version of Hamachi (so no HamachiX) which seems to be working fine (so far). Just missing out on the handy GUI. *Edit*