OpenVPN autostart on Windows 10
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVPN User
- Posts: 44
- Joined: Wed Jun 19, 2013 9:43 am
OpenVPN autostart on Windows 10
So, I have Windows 10 with all updates and try to autostart VPN. I have only one config file, from OpenVPN GUI connection is easily established, but after reboot, it does not autostart.
I went to services.msc and set OpenVPNService to automatic and also OpenVPN Legacy Service to automatic... and after restart, it is not started. And yes, I ticked "Start OpenVPN at Windows startup" in settings.
Any other idea?
I went to services.msc and set OpenVPNService to automatic and also OpenVPN Legacy Service to automatic... and after restart, it is not started. And yes, I ticked "Start OpenVPN at Windows startup" in settings.
Any other idea?
-
- OpenVPN User
- Posts: 44
- Joined: Wed Jun 19, 2013 9:43 am
Re: OpenVPN autostart on Windows 10
BTW, I am using OpenVPN version 2.4.9.
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: OpenVPN autostart on Windows 10
Those services only start files in C:\Program Files\OpenVPN\ConfigMatejKovacic wrote: ↑Wed Oct 21, 2020 7:18 pmI went to services.msc and set OpenVPNService to automatic and also OpenVPN Legacy Service to automatic
-
- OpenVPN User
- Posts: 44
- Joined: Wed Jun 19, 2013 9:43 am
Re: OpenVPN autostart on Windows 10
Well, I have a config file in C:\Program Files\OpenVPN\config (config, not Config). But it does not start.
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: OpenVPN autostart on Windows 10
Your log should give you the answer.
-
- OpenVPN User
- Posts: 44
- Joined: Wed Jun 19, 2013 9:43 am
Re: OpenVPN autostart on Windows 10
Well, the problem is there is no log. I mean, there is log, if I start connection manually. And in that case, connection works just fine. But the automatic connection doesn't start.
In Linux, there is /etc/default/openvpn file with AUTOSTART directive. That works just fine.
Unfortunately, I am not really a Windows user, but as I understand, services.msc should be the solution. Unfortunately it is not.
In Linux, there is /etc/default/openvpn file with AUTOSTART directive. That works just fine.
Unfortunately, I am not really a Windows user, but as I understand, services.msc should be the solution. Unfortunately it is not.
-
- OpenVPN Protagonist
- Posts: 11138
- Joined: Fri Jun 03, 2016 1:17 pm
Re: OpenVPN autostart on Windows 10
The services start Openvpn profile in the \config directory where Openvpn is installed.
If these don't work for you then you either don't have your profile in the right place or there is an error in the config. If you don't have a log then configure one using --log and --verb .. see the manual for details.
If these don't work for you then you either don't have your profile in the right place or there is an error in the config. If you don't have a log then configure one using --log and --verb .. see the manual for details.
-
- OpenVpn Newbie
- Posts: 1
- Joined: Wed May 26, 2021 2:38 pm
Re: OpenVPN autostart on Windows 10
Hi there,
(not sure if it's cool to revive old posts, but I'm in a similar situation, so I figured I'd give it a go)
I am using OpenVPN GUI v 11.24.0.0 on Windows 10, and I would like to automatically log on to my server on startup. I followed the instructions and installed the program as a service, which launches properly. I also placed exactly one config file in Program Files\OpenVPN\config-auto (the file works properly under manual connection) - but nothing is happening. The service is running upon login, but I am not connected. I am not sure how to debug this. Couple of questions:
1.TinCanTech suggests to activate the log, but I am not sure how to do that. Do I log it through OpenVPN GUI, or from the windows service side?
2. Another major source of confusion is whether the service just automates the GUI functionality, or is a separate process - in other words: are any settings I am modifying in OpenVPN GUI - specifically "launch on user logon" - connected to the service, or can I turn that off and still get automatic logon via the service?
3. Finally, I am using password and certificate - does this affect how the service functions? In other words: when I manually log in through the GUI the first time I am asked for username and password. How is this resolved in the service?
Thanks for your help!
dulli
(not sure if it's cool to revive old posts, but I'm in a similar situation, so I figured I'd give it a go)
I am using OpenVPN GUI v 11.24.0.0 on Windows 10, and I would like to automatically log on to my server on startup. I followed the instructions and installed the program as a service, which launches properly. I also placed exactly one config file in Program Files\OpenVPN\config-auto (the file works properly under manual connection) - but nothing is happening. The service is running upon login, but I am not connected. I am not sure how to debug this. Couple of questions:
1.TinCanTech suggests to activate the log, but I am not sure how to do that. Do I log it through OpenVPN GUI, or from the windows service side?
2. Another major source of confusion is whether the service just automates the GUI functionality, or is a separate process - in other words: are any settings I am modifying in OpenVPN GUI - specifically "launch on user logon" - connected to the service, or can I turn that off and still get automatic logon via the service?
3. Finally, I am using password and certificate - does this affect how the service functions? In other words: when I manually log in through the GUI the first time I am asked for username and password. How is this resolved in the service?
Thanks for your help!
dulli
-
- OpenVpn Newbie
- Posts: 1
- Joined: Fri Jun 11, 2021 4:24 pm
Re: OpenVPN autostart on Windows 10
Hi,
I have the same problem,
Gui start on windows startup but not my server ( server.ovpn and other file place in config directory) , I need to start the manually the server in gui.
In previous version of the service this operation work fine.
Any Idea ?
I have the same problem,
Gui start on windows startup but not my server ( server.ovpn and other file place in config directory) , I need to start the manually the server in gui.
In previous version of the service this operation work fine.
Any Idea ?
-
- OpenVpn Newbie
- Posts: 17
- Joined: Mon Jun 07, 2021 4:10 pm
Re: OpenVPN autostart on Windows 10
I went through this last night. First, the gui and the service are unrelated. Pick one or the other. Service for automation, gui for manual start.
The documentation seems to be very old. Here's how I sorted it out.
1) Put your server.ovpn in C:\Program Files\OpenVPN\config-auto
2) Create a text file called "stdin.txt" and put it in the same folder.
3) Open stdin.txt and put your server key passphrase and save. Then - and this is what caused me a headache last night - the file has to be ANSI encoded otherwise you'll get a key decrypt error and your server instance won't start. This is nowhere in the documentation. I couldn't find it by searching the internet either. I just guessed it was probably an encoding issue and guessed it should be ANSI. I guessed right.
4) edit server.ovpn and add:
Code: Select all
askpass "C:\\Program Files\\OpenVPN\\config-auto\\stdin.txt"
-
- OpenVpn Newbie
- Posts: 1
- Joined: Sun Feb 06, 2022 11:41 pm
Re: OpenVPN autostart on Windows 10
So that I might possibly save some poor soul the 2 days of misery that I went through trying to get this to work, I add the following.
The instructions from 'admininator on Jun 11, 2021' are good, but there is something left out, at least with regard to the 64-bit Windows install circa February 2022.
You have a choice when you install the program to 'Install Now' or 'Customize'. If you do not do a custom installation, the OpenVPN Service will *NOT* be installed and your ovpn files in the /Program Files/OpenVPN/config-auto directory will be ignored on boot. OpenVPN will work, but only after you successfully login to windows. Not good if you want to login to Active Directory.
The instructions from 'admininator on Jun 11, 2021' are good, but there is something left out, at least with regard to the 64-bit Windows install circa February 2022.
You have a choice when you install the program to 'Install Now' or 'Customize'. If you do not do a custom installation, the OpenVPN Service will *NOT* be installed and your ovpn files in the /Program Files/OpenVPN/config-auto directory will be ignored on boot. OpenVPN will work, but only after you successfully login to windows. Not good if you want to login to Active Directory.
- vandreytrindade
- OpenVpn Newbie
- Posts: 18
- Joined: Sun Jul 26, 2015 1:14 pm
Re: OpenVPN autostart on Windows 10
@lochnerr,
Thanks a lot!
Thanks a lot!
-
- OpenVpn Newbie
- Posts: 1
- Joined: Sun Oct 08, 2023 1:22 am
Re: OpenVPN autostart on Windows 10
I wonder where the auto connect certificates and keys have to be stored: In the same 'config-auto' folder together with the .ovpn file or can/should they stay in the 'config' folder?
-
- OpenVpn Newbie
- Posts: 1
- Joined: Wed Dec 13, 2023 10:18 am
Re: OpenVPN autostart on Windows 10
Instead of using askpass in the .ovpn file I added this line
and put a file "auth" in the C:\Program Files\OpenVPN\config-auto folder with the username in the 1st line and the password in the 2nd.
Works well.
Code: Select all
auth-user-pass auth
Works well.