OpenVPN not working after "wakeup" on Windows.

I had the same issue on Win 7 Home Premium x64. Here's my workaround:

Create two new tasks in task scheduler, which run from a user account with elevated privileges, whether logged in or not, without storing the password. Each of these tasks triggers on event System:Power-Troubleshooter:1 (this is wake up from sleep).

The first task has no delay and no conditions, and runs "C:\Windows\System32\sc.exe" with arguments "stop OpenVPNService" (note the lack of spaces in the service name).

The second task is delayed for 10 seconds or so with no conditions (though I recommend killing it if it lasts more than a minute and retrying if it fails), and runs "C:\Windows\System32\sc.exe" with arguments "start OpenVPNService"

You could of course have a single event to run a batch script, but that introduces some security concerns so running sc directly is probably the way to go. You need the two steps because neither sc nor net have a "restart" command - just "start" and "stop."

Anyway, this is far from ideal, and would be better solved by OpenVPN itself, but it does fix the immediate problem. If you have trouble getting this to work, you may need to play around at the command line (in a shell with administrator privileges) to get the command arguments right.

Tags: openvpn, power managment, wakeup
Last update:
2014-12-07 16:25
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.