GUI auto-connect

This forum is for all inquiries relating to the installation of OpenVPN from source and with binaries.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please visit (and READ) the OpenVPN HowTo http://openvpn.net/howto prior to asking any questions in here!
Post Reply
mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

GUI auto-connect

Post by mmilliss » Sun Mar 11, 2018 8:32 pm

Is there a way to have the GUI autoconnect on startup on Windows 10? I've had a look at the documentation and can't find a way to do this.
OR Can the Windows OpenVPNService be configured to connect at startup? I got this working by adding an "auth-user-pass password.txt" line to my config file but this means I now have the username and password in the clear on my file system which doesn't seem very secure and also I now can't use the gui to connect/disconnect.

I'm running OpenVPN 2.4.5 on Windows 10.

Any help appreciated.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Mon Mar 12, 2018 2:14 pm

You are stuck "between a rock and a hard place" ..

Openvpn only reads user/pass from a clear text file ..
The GUI cannot be used if you use the service to start openvpn ..

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Mon Mar 12, 2018 8:09 pm

*sigh*
Thanks for the reply. Do you know if there are any plans to improve this user experience? Is there somewhere I can request this feature?

Seems weird that a VPN, which is a good privacy/security tool, would use plaintext passwords in a file on my filesystem - it goes against everything I know about good security practices.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Mon Mar 12, 2018 8:52 pm

The new GUI will save encrypted passwords.

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Mon Mar 12, 2018 9:04 pm

Also, when just using the gui alone is there a way to get it to auto-connect on startup/login?

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Mon Mar 12, 2018 9:07 pm

TinCanTech wrote:
Mon Mar 12, 2018 8:52 pm
The new GUI will save encrypted passwords.
Is that the GUI with the latest version?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Mon Mar 12, 2018 9:08 pm

mmilliss wrote:
Mon Mar 12, 2018 9:07 pm
Is that the GUI with the latest version?
Always ..

Try: "openvpn-gui --help"

Edit: In fact all versions can auto start.

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Thu Mar 15, 2018 11:16 am

Thanks for the help but I'm running on windows and can't seem to find a way to pass the --connect command to the program using the windows services gui.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Thu Mar 15, 2018 12:28 pm

You can not use the Openvpn Service to start the Openvpn-GUI.

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Thu Mar 15, 2018 8:28 pm

I'm probably highlighting my lack of windows knowledge but the GUI is running when I login, isn't this started by the windows service?

I was hoping I could just add the --connect paramater to the start command and it would just work but it doesn't seem to be this way.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Thu Mar 15, 2018 9:00 pm

Search your registry for openvpn-gui

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Thu Mar 15, 2018 9:19 pm

Can I just say thanks again for your help on this, it's been much appreciated. I'll have a look when I get home tonight.

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Fri Mar 16, 2018 9:14 am

So I found this entry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OpenVPNServiceInteractive and tried changing the ImagePath entry from this "C:\Program Files\OpenVPN\bin\openvpnserv.exe"
to this "C:\Program Files\OpenVPN\bin\openvpnserv.exe" --connect "AU Melbourne.ovpn"
but got an Error 1053: The service did not respond to the start or control request in a timely fashion.

then tried this "C:\Program Files\OpenVPN\bin\openvpnserv.exe --connect AU Melbourne.ovpn"
but got Error 2: The system cannot find the file specified

then this "C:\Program Files\OpenVPN\bin\openvpnserv.exe" "--connect AU Melbourne.ovpn"
but got this again Error 1053: The service did not respond to the start or control request in a timely fashion.

then this "C:\Program Files\OpenVPN\bin\openvpnserv.exe" "--connect" "AU Melbourne.ovpn"
but got this again Error 1053: The service did not respond to the start or control request in a timely fashion.

What am I doing wrong?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Fri Mar 16, 2018 12:58 pm

See my last post ...

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Sat Mar 17, 2018 7:16 am

I searched the registry and got a hit in all these locations.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UFH\SHC
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
HKEY_CURRENT_USER\Software\OpenVPN-GUI
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\OpenVPN_UserSetup
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\bam\UserSettings\S-1-5-21-2742388443-2443409778-2540095943-1001
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\bam\UserSettings\S-1-5-21-2742388443-2443409778-2540095943-1002
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\bam\UserSettings\S-1-5-21-2742388443-2443409778-2540095943-1003
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bam\UserSettings\S-1-5-21-2742388443-2443409778-2540095943-1001
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bam\UserSettings\S-1-5-21-2742388443-2443409778-2540095943-1002
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bam\UserSettings\S-1-5-21-2742388443-2443409778-2540095943-1003
HKEY_USERS\S-1-5-21-2742388443-2443409778-2540095943-1001\Software\Microsoft\Windows\CurrentVersion\UFH\SHC
HKEY_USERS\S-1-5-21-2742388443-2443409778-2540095943-1001\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store
HKEY_USERS\S-1-5-21-2742388443-2443409778-2540095943-1001\Software\OpenVPN-GUI

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Sat Mar 17, 2018 1:53 pm

Code: Select all

HKEY_CURRENT_USER/software/microsoft/windows/currentversion/run

mmilliss
OpenVpn Newbie
Posts: 10
Joined: Sun Mar 11, 2018 7:22 am

Re: GUI auto-connect

Post by mmilliss » Sun Mar 25, 2018 10:06 am

I found the registry entry that you have referred to. Do I just create an entry for OpenVPNGUI with this value
C:\Program Files\OpenVPN\bin\openvpn-gui.exe --connect "AU Melbourne.ovpn"

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: GUI auto-connect

Post by TinCanTech » Sun Mar 25, 2018 12:42 pm

You probably need the full path to the .ovpn file as well.

blackhiden
OpenVpn Newbie
Posts: 3
Joined: Mon Feb 26, 2018 1:23 am

Re: GUI auto-connect

Post by blackhiden » Thu Apr 19, 2018 9:56 am

Make .bat file and put it to startup directory.
Unfortunately, this solution only work if you don't add password on your account

Post Reply