Tunnelblick will almost certainly hang if wifi is disconnected after M1 Mac goes to sleep

619 views
Skip to first unread message

Jansen Yong

unread,
Jun 5, 2022, 5:43:02 AM6/5/22
to tunnelblick-discuss
Hi there,

I am experiencing this frequent application hang if wifi is disconnected after M1 Mac goes to sleep.

Mac: M1 MacBook Pro 2020
OS: MacOS 12.5 Beta (21G5037D)

Steps to reproduce the application hang:
1. Open tunnelblick 3.8.7a, connect to a VPN server.
2. With the VPN still connected, close the clamshell of the Mac.
3. Turn off the wifi router and go to sleep :).
4. After 7-8 hrs of sleep :), open the clamshell of the MacBook (before turning on wifi), the tunnelblick app will certainly get stuck and there is no way to force quit it. The tunnelblick app logo does not show up in the Apple menu bar, but the connection status box does showed up on the upper right hand side with a spinning wheel, showing reconnecting XX:XX:XX time (time is not moving).

There is no way to force quit it (does not show up in the Apple force quit application menu), and I usually resolve it by restarting the entire machine.

TL:DR: App hang if wifi does not reconnect before a Mac wake up. If I turn on wifi router first, allow a few minutes for wifi router to startup completely, THEN only open the Mac clamshell, there is no issue at all.

I would say I am able to reproduce this issue 70% of the time if my Mac wakes before wifi reconnect.

Any help would be greatly appreciated!

Jansen Y.

Tunnelblick developer

unread,
Jun 5, 2022, 5:47:42 AM6/5/22
to tunnelblick-discuss
  1. The Tunnelblick icon may not show up in the menu bar because of the "notch" for the camera in an M1 MacBook Pro. That's an Apple problem. You might be able to get it to appear if you don't display all of Apple's status items.
  2. You can set Tunnelblick to not disconnect the VPN when the computer goes to sleep in Tunnelblick's Advanced Settings window.
  3. You can try disabling all logging by Tunnelblick and OpenVPN on the Settings tab of Tunnelblick's VPN Details window.

Jansen Yong

unread,
Jun 5, 2022, 5:59:18 AM6/5/22
to tunnelblick-discuss
Hi there,

I forgot to mention, mine is a M1 MBP 13" with no notch. The logo DOES appear when it is operating normally. However, when tunnelblick does hang, the tunnelblick logo will disappear from the Apple menu bar. Only the upper right status box is visible (with a spinning wheel mouse icon, and no way to force close it. The status box just freezes.)

Will make a vid when it happen and update you.

-JY

Testy Tester

unread,
Aug 17, 2022, 3:11:26 AM8/17/22
to tunnelblick-discuss
Perhaps this is related to my sleep issue? Though in my case, tunnelblick hangs even if the network is up.


Note that you can actually rescue things without rebooting. You just need to go into the terminal to kill the stuck openvnp process. Or you can set up a shell function like this:
kvpn () {
    sudo kill -9 $(ps axguw|awk '/^nobody.*openvpn/ {print $2}')
}

Then you can just do "kvpn" in the shell, and a few seconds later the tunnelblick menu will work again. It's still not in a functional state, so the easiest thing to do it quit it and start the app again. This is, all in all, a usability nightmare and I really hope it will be fixed soon. In the meantime you can revert to version 5730, which doesn't have this bug, but there have been security updates since then that make that a poor choice.

Testy Tester

unread,
Aug 31, 2022, 2:28:19 PM8/31/22
to tunnelblick-discuss
See my recent message in that other thread. At least in Ventura, and probably in earlier MacOS, you can completely fix it in a couple of seconds:

kvpn () {
    echo killing:
    ps axguw | awk '/Tunnelblick\.app/ {print
        system("kill -9 " $2)
        }'
    open /Applications/Tunnelblick.app
}

This will restart Tunnelblick and leave the working tunnel in place. If, unlike in my case, that doesn't work for you, try this instead for the third line:
    ps axguw | awk '/Tunnelblick\.app/ || /^nobody.*openvpn/ {print

Note however that you'll need to do that as root. Or else change the fourth line to
        system("sudo kill -9 " $2)

Testy Tester

unread,
Jul 29, 2023, 4:26:54 AM7/29/23
to tunnelblick-discuss
My problem, which may well be the same as yours, has been fixed as of 4.0.0b8. I suggest you try that.
Reply all
Reply to author
Forward
0 new messages