[solved] OpenVPN 2.5 server process closes on user logout

This forum is for admins who are looking to build or expand their OpenVPN setup.

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.
Post Reply
DaveG_NZ
OpenVpn Newbie
Posts: 5
Joined: Sat Jun 26, 2021 10:17 am

[solved] OpenVPN 2.5 server process closes on user logout

Post by DaveG_NZ » Sat Jun 26, 2021 10:28 am

I've installed Openvpn 2.5 on a Windows Server 2012 system using the default install options. All of the configs and certs are setup OK. On the install notes it says to use Openvpn Gui to start the server, which it does and the openvpn server runs fine and accepts connections.

The problem I have is that when the windows user account that ran Openvpn gui is logged off, the openvpn server shuts down and connections stop.

The installation was done from a windows server admin account and the same account is used when running the gui to start the openvpn server.

This isn't my first openvpn server install, but it is the first using the interactive service and google hasn't revealed what I'm missing here.
Last edited by DaveG_NZ on Sun Jun 27, 2021 1:25 am, edited 1 time in total.

300000
OpenVPN Expert
Posts: 685
Joined: Tue May 01, 2012 9:30 pm

Re: OpenVPN 2.5 server process closes on user logout

Post by 300000 » Sat Jun 26, 2021 4:12 pm

User logged off so network logged off too so how openvpn can connect anyway? What do you expect ? That is how Windows works and there is nothing openvpn can do. If you want you need to running it as windows service all the time connect.

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

Re: OpenVPN 2.5 server process closes on user logout

Post by TinCanTech » Sat Jun 26, 2021 4:40 pm

la signification de l'interface graphique est l'interface utilisateur graphique

DaveG_NZ
OpenVpn Newbie
Posts: 5
Joined: Sat Jun 26, 2021 10:17 am

Re: OpenVPN 2.5 server process closes on user logout

Post by DaveG_NZ » Sun Jun 27, 2021 12:22 am

300000 wrote:
Sat Jun 26, 2021 4:12 pm
User logged off so network logged off too so how openvpn can connect anyway? What do you expect ? That is how Windows works and there is nothing openvpn can do. If you want you need to running it as windows service all the time connect.
I'm trying to setup openvpn to run as a service on the server 2012.

So far, I've tried:

putting the config file in the config-auto folder and restarting the OpenvpnService service
running a task that runs openvpn-gui.exe --connect server.ovpn

Neither seem to start the service with the required config ie. I can't connect to the vpn from my PC client

The only thing that does work is running openvpn-gui from a user login on the server and selecting the connect option. That works fine and I can connect to the vpn from my PC. But as soon as the user is logged out on the windows server the connection drops.

DaveG_NZ
OpenVpn Newbie
Posts: 5
Joined: Sat Jun 26, 2021 10:17 am

Re: OpenVPN 2.5 server process closes on user logout

Post by DaveG_NZ » Sun Jun 27, 2021 12:29 am

TinCanTech wrote:
Sat Jun 26, 2021 4:40 pm
la signification de l'interface graphique est l'interface utilisateur graphique
agreed, I should have made it clear in my OP that I'm trying to run openvpn as a service but haven't been successful yet.

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

Re: OpenVPN 2.5 server process closes on user logout

Post by TinCanTech » Sun Jun 27, 2021 12:57 am

You are aware that Openvpn generates a log where progress is recorded ?

I call it the log pile ..

DaveG_NZ
OpenVpn Newbie
Posts: 5
Joined: Sat Jun 26, 2021 10:17 am

Re: OpenVPN 2.5 server process closes on user logout

Post by DaveG_NZ » Sun Jun 27, 2021 1:24 am

OK, I've resolved the problem. Among the many troubleshooting steps I tried, I had changed the logon setting of the openvpn service to use a local admin account, after changing it back to use the local system account it picked up the config from config-auto folder and has started the vpn service successfully. Sorry for the noise.

DaveG_NZ
OpenVpn Newbie
Posts: 5
Joined: Sat Jun 26, 2021 10:17 am

Re: OpenVPN 2.5 server process closes on user logout

Post by DaveG_NZ » Sun Jun 27, 2021 1:34 am

TinCanTech wrote:
Sun Jun 27, 2021 12:57 am
You are aware that Openvpn generates a log where progress is recorded ?

I call it the log pile ..
Yes, but I was looking in the user profile dir for the logs and omitted to check the log in the Program Files Openvpn folder where it said that wintun required system privileges. Running the service under an admin user login wasn't acceptable but using local system account was OK.

Post Reply