Advanced Settings file location

69 views
Skip to first unread message

Benjamin Riou

unread,
Dec 12, 2024, 11:07:40 AM12/12/24
to tunnelblick-discuss
Hello

We would like to programmatically configure some Advanced Settings, especially the "Reconnect when computer wakes up" checkbox.

This setting is not stored on the .TBLK archive -- we don't know where the configuration file is stored for "Advanced Settings".

Our goal is to automatically provision TunnelBlick on our computers, installing the TBLK archive and have this "Reconnect When Computer Wakes Up" unchecked. 

I also checked the documentation (https://tunnelblick.net/cPkgs.html) and did not found anything relevant.

Can you point me to the relevant place adjust Advanced Settings programmatically ?

Thanks !
Ben 

This message, including attachments, is confidential and intended solely for the intended recipient.

Tunnelblick Developer

unread,
Dec 12, 2024, 11:34:21 AM12/12/24
to tunnelblick-discuss
Most of Tunnelblick's settings are stored as macOS "preferences" or "defaults". They can be accessed via the command line using the "defaults" command. See Preferences for more details.

The preference you need is the per-configuration "-doNotReconnectOnWakeFromSleep" preference; you want to set it to true. To clear the checkbox, you could include an entry in the .tblk's Info.plist named "TBPreference-doNotReconnectOnWakeFromSleep" with a value of true.

Note that the preference name should be prepended with the name of the configuration if you are not using it in an Info.plist, for example, if you use it in the "defaults" command.

Benjamin Riou

unread,
Dec 14, 2024, 2:49:51 AM12/14/24
to tunnelblick-discuss

Thank you for your prompt response. I tried to clear the checkbox in multiple ways, without success.


First, by including an Info.plist file in my TBLK folder to be imported, as shown :  
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="1.0">
<dict>
<key>TBPackageVersion</key>
<string>1</string>
<key>TBReplaceIdentical</key>
<string>Force</string>
<key>TBPreference-doNotReconnectOnWakeFromSleep</key>
<true/>
</dict>
</plist>
```

No success.
Then I tried via the `default` command as shown below 

sudo defaults write net.tunnelblick.tunnelblick "Doctrine_VPN-doNotReconnectOnWakeFromSleep" -bool yes
sudo defaults write net.tunnelblick.tunnelblick "skipWarningThatDNSIsNotWorking" -bool yes
sudo defaults write net.tunnelblick.tunnelblick "skipWarningAboutDnsProblems" -bool yes
sudo defaults write net.tunnelblick.tunnelblick "skipWarningThatIPAddressDidNotChangeAfterConnection" -bool yes
sudo defaults write net.tunnelblick.tunnelblick "updateCheckAutomatically" -bool no

Here, Doctrine_VPN is the name of the configuration.

However, this approach also failed. The checkbox remains unchanged in the GUI, even after restarting Tunnelblick.

I can confirm that the configuration appears to update successfully when checked using defaults read, but the changes have no effect elsewhere.

I am currently using Tunnelblick 6.0beta09 (build 6130).

Am I missing something here?

Thank you!


Tunnelblick Developer

unread,
Dec 14, 2024, 8:14:32 AM12/14/24
to tunnelblick-discuss
The Info.plist file did not work for me, either, even after I changed "Force" to "force", and restarted Tunnelblick. It should work; I'll look into that.

The "defaults" command did work for me, without the "sudo", after restarting Tunnelblick:
  • You need not, and should not use the "sudo" command to change defaults.
  • Is the VPN is named "Doctrine_VPN", with an underscore? VPN names can contain spaces. If it is actually named "Doctrine VPN with a space", then use that.


Tunnelblick Developer

unread,
Dec 14, 2024, 10:35:57 AM12/14/24
to tunnelblick-discuss
The Info.plist file worked for me after I changed "TBPreference-doNotReconnectOnWakeFromSleep" to "TBAlwaysSetPreference-doNotReconnectOnWakeFromSleep".

Benjamin Riou

unread,
Dec 16, 2024, 3:19:41 AM12/16/24
to tunnelblick-discuss
I can confirm that. Thank you very much! 

Warm regards

Максим Sss

unread,
Jan 10, 2025, 10:59:26 AM1/10/25
to tunnelblick-discuss
Good day,
Is there any chance to change
Allow changes to manually-set network settings
Prepend domain name to search domains

Please ?

Tunnelblick Developer

unread,
Jan 10, 2025, 11:03:20 AM1/10/25
to tunnelblick-discuss
Yes. Each of them is a per-configuration preference, so the key must be prefixed with the name of the configuration:
  • "-allowChangesToManuallySetNetworkSettings"
  • "-prependDomainNameToSearchDomains"

Максим Sss

unread,
Jan 10, 2025, 11:11:09 AM1/10/25
to tunnelblick-discuss
that works, thank you!
Reply all
Reply to author
Forward
0 new messages