Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How let VPN start at startup ?

  1. #1
    Join Date
    Sep 2024
    Beans
    5

    How let VPN start at startup ?

    I was able to setup a VPN (openvpn) connection. Now I would let the VPN start just after have done the login. How to do that? Thanks for Your attention. Massimo

  2. #2
    Join Date
    Jun 2024
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How let VPN start at startup ?

    It depends on what application you're using and how immediate you want the connection. Without specifics, I can recommend using systemd for the automation connection at startup like this: https://unix.stackexchange.com/quest...-using-systemd

    Create a file named auto_vpn.service in ~/.config/systemd/user with the following content:

    [Unit]
    Description=Connect to Proton-VPN
    BindsTo=graphical-session.target

    [Service]
    Type=simple
    ExecStart=/usr/bin/protonvpn-cli connect -f
    ExecStop=/usr/bin/protonvpn-cli disconnect
    Restart=on-failure
    RestartSec=30
    StartLimitInterval=350
    StartLimitBurst=10
    RemainAfterExit=yes

    [Install]
    WantedBy=xsession.target


    Now run:

    systemctl --user daemon-reload
    systemctl --user start auto_vpn.service
    Run `systemctl --user enable auto_vpn.service

    Thats it.

  3. #3
    Join Date
    Sep 2024
    Beans
    5

    Re: How let VPN start at startup ?

    I thank You for Your kindness, but I'm not comfortable with commands directly sent to the operating system. My scarce knowledge stops me.

  4. #4
    Join Date
    Jun 2024
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How let VPN start at startup ?

    Oh I see. Well, there are ways around that to learn how to use Ubuntu effectively.

    Look up "bash shell programming" on YouTube. Setup a test environment. This can be a virtualbox installation, gnome box installation, or a different PC. Use this environment to make shell scripts. You will learn about user and root access, and from there you can see what is possible.

    This example is a user script, so it shouldn't negatively impact your machine. But I'm happy you are careful enough not to do something without learning about it.

    The tool I'm using is called systemd. You can use systemd for all sorts of things. My favorite thing is to create a daemon with it.

    Good luck.

  5. #5
    Join Date
    Sep 2024
    Beans
    5

    Re: How let VPN start at startup ?

    Thanks again. I'll follow Your suggestions.

  6. #6
    Join Date
    May 2008
    Beans
    4,509
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How let VPN start at startup ?

    Help > Your Desktop > Startup Applications (Choose what applications to start when you log in)

  7. #7
    Join Date
    Sep 2024
    Beans
    5

    Re: How let VPN start at startup ?

    Impossible for me to point to the VPN

  8. #8
    Join Date
    May 2018
    Location
    Here and There
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: How let VPN start at startup ?

    Quote Originally Posted by massimox View Post
    Impossible for me to point to the VPN
    What DE is used here, I'll assume Gnome, and what VPN are you using/
    All that will help us to help you.
    "When you practice gratefulness, there is a sense of respect toward others." >>Dalai Lama

  9. #9
    Join Date
    Sep 2024
    Beans
    5

    Re: How let VPN start at startup ?

    Correct sorry.
    Ubuntu 24.04.1 LTS, Gnome, Network Manager installed. Into Settings>Network I compiled the OpenVPN page.
    After each session start I enter System Menu and press the VPN button. That's all.

  10. #10
    Join Date
    May 2018
    Location
    Here and There
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: How let VPN start at startup ?

    Thought so a home brew VPN.
    Can you show us this please:
    Code:
    nmcli connection show
    "When you practice gratefulness, there is a sense of respect toward others." >>Dalai Lama

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •