3

I have a Windows XP SP2 machine with Hamachi service running. Usually I connect to it using Remote Desktop, and when I disconnect I can't connect to it again because the Hamachi VPN is down. How to prevent the Hamachi service to stop?

I am sure that Hamachi is configured as an automatic service.

David Pashley
  • 23,963
Jader Dias
  • 4,785

7 Answers7

10

Apparently the free version of Hamachi requires the GUI to be running in order to operate. When you disconnect your RDP session the free version of Hamachi will disconnect. The workaround appears to be to run the following command instead of disconnecting. (Note: Number 1 below is your session ID. To know what your current session ID, in the console, run query user or open the task manager and go to users and look at your session ID)

tscon 1 /dest:console

This may need to be run as administrator. This will transfer your session back to the local machine. Also note that when the session is transfered back to the local machine it will not be locked and will be available to anyone with physical access to the machine.

masegaloeh
  • 18,498
Keith
  • 201
5

If Hamachi is configure to run as a service, then it should not matter whether you just disconnect from the RDP sesssion, or log off, as it should be running in the background. You should check the services MMC to see that the service is there, and that it is running.

Sam Cogan
  • 39,089
4

Just add this in a .bat script:

tscon 1 /dest:console
rundll32.exe user32.dll, LockWorkStation

The first line transfers the remote session to the local desktop and the second line, locks it. Instead of disconnecting, just run the bat script.

Vince
  • 41
2

If you close the remote desktop session without logging off it shouldn't be an issue. If your using the microsoft rdp client just click the "X" at the top bar of the screen.

The only other thing I could think of is maybe the hamachi client is set to auto-disconnect if idle for X minutes. I'm not even sure if hamachi has that option, I've never really looked.

TrueDuality
  • 1,914
1

When I stopped to close the window through the X button, and started to Disconnect, then the problem not occurred again.

Jader Dias
  • 4,785
0

The batch script is a crude solution. The way I solved the problem is the following. I went into policy editor>Computer Conf.>Administrative Templates>Windows Components>Remote Desktop Services>Remote Connection Host>Connections>Restrict Desktop Remote services users to a single RDP session> Disabled the rule. After that you can go to the local machine(or use any remote software like TeamViewer) log in with your credentials> and start-up Hamachi> LOCK THE ACCOUNT so it will stay logged on. Now if you log in with RDP and go to task manager>users you will see that you two users logged in. After that, you can log in\log out with RDP how many times you want it will not log off the local session and thus Hamachi will stay on.

0

I briefly inspected the action Hamachi is doing. From what I found there, the Hamachi service (named Hamachi2SVC, running hamachi-2.exe) seemed to actively detect the Windows logoffs and ask their server what to do; in OP's case, the server instructs the client to disconnect.
To take around this mechanism, a way is to patch the program not to check for the logoffs. For Hamachi version 2.3.0.78, changing byte 0x10122E 0x85 to 0x31 (instruction test to xor) in C:\Program Files (x86)\LogMeIn Hamachi\x64\hamachi-2.exe works as expected, though not sure about other versions.

cosine
  • 1