Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Connect to VPN before login to computer

    Scheduled Pinned Locked Moved OpenVPN
    5 Posts 3 Posters 1.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      piotres
      last edited by

      Hello there,
      Is there a way to have OpenVPN connected before the user logs in to the computer?
      Since everyone working from home I can not push AD GPOs per machine.

      JKnottJ 1 Reply Last reply
      Reply Quote 0
      • JKnottJ
        JKnott @piotres
        last edited by

        @piotres

        It's certainly possible in Linux. Not sure about Windows.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        M 1 Reply Last reply
        Reply Quote 0
        • M
          marvosa @JKnott
          last edited by marvosa

          You would have to run the client as a service, so it starts with the OS before login:

          https://openvpn.net/cloud-docs/user-guide-openvpn-as-a-system-service-on-windows/

          https://openvpn.net/community-resources/running-openvpn-as-a-windows-service/

          P 1 Reply Last reply
          Reply Quote 0
          • P
            piotres @marvosa
            last edited by

            @marvosa
            I am aware of running OpenVPN as a service, but how can I provide user's credentials?

            M 1 Reply Last reply
            Reply Quote 0
            • M
              marvosa @piotres
              last edited by marvosa

              @piotres
              One option, add the following to the client's config:

              auth-user-pass pass.txt

              then add a 2 line text file called "pass.txt" in the same folder as the client's config using the following format:

              username
              password

              Another option, create a separate instance for auto-connect users that auth's from certificate only.

              Another option, create a service account for auto-connect users, so solutions similar to the above can be deployed without input from the end-user. We did this at my last gig with Cisco AnyConnect.

              Another possible option, it looks like the "auth-user-pass" directive can be invoked via the command line, so it may be possible to add something like the following to the parameters section of the service instead of modifying the client config:

              --config C:\Program Files\OpenVPN\config\myvpnconfig.ovpn --auth-user-pass "C:\Program Files\OpenVPN\config\pass.txt"

              1 Reply Last reply
              Reply Quote 1

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
              Privacy Policy · Cookie Policy