Thursday, July 27, 2006

How to run the free version of Hamachi as a Windows Service

I recently tried out the Hamachi VPN client, but I was disappointed to see that the free version of Hamachi wouldn't run as a Windows Service, like OpenVPN.

It is possible to use an application like SrvAny, from the Windows NT Resource Kit to overcome this, but this is beyond your average user.

But within a half hour, I had created a simple little service launcher for it, using Visual Studio. This neat little app appears as a Windows service, and requires no configuration. When it starts, it checks the registry to determine where Hamachi is installed, then spawns Hamachi. When the service is stopped, it automatically kills the Hamachi process. Likewise, if the instance of Hamachi dies for whatever reason, the service will stop. This means that you can use Windows' inbuilt automatic service restart facilities to restart the service if Hamachi dies.

The downside is that the application cannot be configured, because there is no visible GUI. This isn't much of a problem as you can configure the application by running it normally and then closing the application, before you start the service.

This software is available as freeware from the link below.

Download the Hamachi Background Service launcher (10KB)