How to make the VPN client connect automatically at logon Print

  • VPN installazione client, vpn autologin, vpn windows
  • 2

 

Automatic OpenVPN Client Connection at Windows Startup

Many users want their OpenVPN connection to start automatically when the computer boots. Although OpenVPN for Windows does not have a built-in option for this, it can be configured manually.

 

Startup command

Use the following startup command to automatically connect to a specific .ovpn configuration file:

  • Windows 32 bit: "C:\Program Files\OpenVPN\bin\openvpn-gui.exe" --connect xxxxx.ovpn
  • Windows 64 bit: "C:\Program Files (x86)\OpenVPN\bin\openvpn-gui.exe" --connect xxxxx.ovpn

Replace xxxxx.ovpn with the actual configuration file name located in the OpenVPN/config folder.

 

Registry configuration

  1. Open regedit.
  2. Navigate to: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  3. Add a new string entry (e.g., openvpn).
  4. Paste the startup command as its value.

 

Important notes

  • If Windows is not installed on C: or OpenVPN is installed in a different folder, update the path accordingly.
  • On Windows Vista, 7, and 8, OpenVPN-GUI must be run as Administrator. You can set this under Properties → Compatibility → Run as administrator.

 

Automatic login with username and password

By default, OpenVPN will prompt for credentials at startup. To automate this, you can save your login details in a text file (note: this is insecure). Recent versions of OpenVPN allow secure credential storage within the app; use this manual method only for older versions.

  1. Create a password.txt file in the OpenVPN/config folder with:
    Line 1 → username
    Line 2 → password
  2. Edit your .ovpn file and change auth-user-pass to auth-user-pass password.txt.
  3. Install OpenVPN version 2.3 or later if your build does not support this feature.

 


Was this answer helpful?

« Back