22 February 2008

Hamachi on Kubuntu Linux doesn't login... (Logging failed)

I'm a proud user of Hamachi. It's a cross-platform VPN solution:
"Hamachi is a zero-config VPN client for Windows and Linux (currently Beta for Mac). It allows you to, very easily, create a virtual private network that can be logged into and accessed for all over the net. It does this by creating IP tunnels to each VPN client, making them directly accessible to all the other clients on the VPN. Hamachi also encrypts the connections it creates to allow for secure access."
Today, after a long time, I had a problem with it. It couln't login to the Hamachi network. On Linux. On Windows it works fine after few retries (30s or so of retrying...). Therefore, the same mechanism can be used on Linux: retry until success :)

On my Kubuntu Gutsy 7.10, as well as on OpenSuse 10.1, I get the following message:
stomic@dell02:~> hamachi login
Logging in ....>.. failed
stomic@dell02:~> hamachi login
Logging in ....>.. failed
stomic@dell02:~> hamachi login
Logging in ....>.. failed
stomic@dell02:~> hamachi login
Logging in ....>.. failed

But this is boring...
So, I've wrote a one-liner that retries for 100 times, or until a login is successful:
CNT=1; echo -n "Logging in... " ; while [ `hamachi login | grep -c failed` -eq 1 -a $CNT -lt 100 ]; do echo -n "$CNT "; let CNT=$CNT+1; sleep 2; done; echo

You should use this command instead of a simple "hamachi login".
The output is now:

Logging in... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

You can also make an alias for this command with the bash command:
alias "command"="whatever"


Riccardo said...

Unlickyly I still can't login on linux... the strange thing is that if I launch a virtual machine with windows there hamachi works perfectly!
Thanks anyway, your idea gave me some minutes of hope :-)

Metastable said...

I am having the same problem - logging in is no problem, but I am unable to create a network, or login to an existing network from Linux - no matter how many times I try. I actually left a script running the whole night to try to create a network with random network names, and to log in to a network that I'd created using my windows machine - no luck.

Let me know if you've figured this out - I don't see too many posts for this problem with Hamachi + Linux