Page 1 of 1
Talking to Tunnelblick
Posted: Mon Mar 31, 2014 10:30 am
by peter.s
I hope I've posted this in the right section

I'm trying to talk to another program, but I'm not having much luck.
For those who don't know it - Tunnelblick is an open source interface for OpenVPN (
https://code.google.com/p/tunnelblick/ ). Rather than having my program deal with VPN configurations, I want to tell Tunnelblick to connect to a specific server or country with its existing configurations.
I've written a script that will open and quit the program easily enough, but when it's open I can't get it to make a connection.
Does anyone have any ideas?
Re: Talking to Tunnelblick
Posted: Mon Mar 31, 2014 11:29 am
by peter.s
I've just discovered that I can get Tunnelblick to generate a .plist file - to tell it to open and connect on computer start-up.
Is there some way I can utelise a .plist file? Perhaps stash it somewhere and direct Tunnelblick to it?
Re: Talking to Tunnelblick
Posted: Mon Mar 31, 2014 7:16 pm
by mwieder
There's a commandline interface to Tunnelblick called openvpnstart buried inside the app hierarchy in /Applications/Tunnelblick.app/Contents/Resources. If you launch it with no arguments it will fill several screens with info. Untested here because I only have need of a single vpn server connection, but you should be able to point it to a config file to connect to a different server. I'm not sure whether a plist file will do the trick, the help info mentions .conf, .opn, or .tblk files.
BTW, my default plist file for Tunnelblick is in ~/Library/Preferences/net.tunnelblick.tunnelblick.plist.
Re: Talking to Tunnelblick
Posted: Tue Apr 01, 2014 2:14 pm
by peter.s
Thanks mwieder for your response.
I've had a look at that file and can't figure out what I can do with the openvpnstart command. I am a novice with code (but trying hard). I've tried a few things unsuccessfully, so I suspect I will need to include some AppleScript into my stack?
Tunnelblick does keep its main plist in User/Library/Preferences. If in Tunnelblick I select a VPN profile to connect when Tunnelblick starts, that command is included in that plist. The plist is updated if I select a different profile.
But, if I select a VPN profile to connect on computer start, Tunnelblick puts a new plist in Library/LaunchDaemons.
My thinking is that I could generate a plist for each profile to connect on open, and hijack them from their folders - put them where I want and direct my app to them? But how does one utilise a plist - is it some kind of Apple Event?
Or is it better to somehow use the openvpnstart command?
Scratching my head hereā¦
