Run openvpn without GUI in the client mode
5,511
OpenVPN provide a Windows Service
for exactly this requirement. Open your computer management services windows and enable the openvpnservice
.. This will auto start all openvpn config files in ..\openvpn\config
directory.
Related videos on Youtube
Author by
Alan Coromano
Updated on September 18, 2022Comments
-
Alan Coromano over 1 year
I need to run my openvpn binary file in the client mode from the command line or something (maybe from a python script) supplying it with location of the client.ovpn file, then connect to a server and then later properly disconnect. Of course, I don't need its GUI to be shown.
How can I do that?
I need to do it on Windows at the moment if it matters.
-
Alan Coromano over 8 yearsand how to disconnect?
-
Alan Coromano over 8 yearsand I don't want to auto start all openvpn conf files, reread my question.
-
dotvotdot over 8 yearsTo stop
openvpn
you can simply stop theopenvpnservice
and this will exit all open configs. Rewrite your question to explain the specific problem. -
Alan Coromano over 8 yearsthe question is to run it, but not autorun it on windows boot.
-
Alan Coromano over 8 yearsI don't need to stop all open config. I want to be able to run and stop openvpn with one specific config at any given time.
-
dotvotdot over 8 yearsYou can create a batch file to start and stop the
openvpnservice
and have only one configuration file in theopenvpn\config
directory. If you require multiple configs rewrite your question to clearly explain what you need. -
Alan Coromano over 8 yearsI'm saying again: run and close openvpn multiple time with different config file which may or may not be the "config" directory.