OpenVPN + PIA - Complete Idiots Guide?

  • Good evening all,

    My OMV 4.x box has been purring away quite happily for the last few months, even has it's first storage drive and is actually doing something at last!

    I would like to connect it to my Private Internet Access VPN to use it as a centralised Transmission hub, but I've no idea where to start.

    Does anyone have a complete idiots guide to doing such a thing?

    Thanks in advance.


    OMV 4.x - D975XBX2 - Xeon X3220 - 4GB ECC Samsung DDR2 800MHz - Syba SI-PEX40064 SATA3 Card - 64GB Drevo SSD Boot Drive - Other in progress :rolleyes:

  • Seeing as no one seems to be willing to step forward with the "Complete Idiots Guide to Setting Up OpenVPN On OpenMediaVault", I've had to go ahead & write my own.

    I hope this helps anyone who, like myself, is a Linux novice and a OMV noob.

    • Install OpenVPN on your OMV system, either directly or via SSH
      apt-get install openvpn
    • Download the configuration files for your particular VPN (in my case PIA) using wget, they should be available from your providers website
      Please note that the following URL is for the secure PIA OpenVPN files, if you are not using PIA these will be of no use to you, but I'm leaving the URL in as an example.
    • In my case, I had to install unzip to extract the contents of the .zip archive
      apt-get install unzip
      I then made a directory to extract the files to
      mkdir ~/<directory_name>
      and extracted with
      unzip <filename>.zip -d ~/<directory_name>
      Your mileage may vary here, as you might have downloaded your OpenVPN configuration files archived in a different way.
    • Change directory to where you just extracted the files to
      cd ~/<directory_name>
    • Copy the .crt and .pem files, as well as the .ovpn file of your choice to /etc/openvpn
      cp <filename>.crt <filename>.pem <filename>.ovpn /etc/openvpn
    • Make a file to store your VPN login information in
      nano /etc/openvpn .secrets
      and enter your username and password into it in order
      save and exit nano
    • Open the .ovpn file you copied using nano and change the line
      auth-user-pass .secrets
    • Rename the .ovpn file to .conf
      mv <filename>.ovpn <filename>.conf
    • You can test your OpenVPN connection at this point by running
      openvpn --config <your_config>.conf
    • If you want your OpenVPN connection to run at startup, add the following systemd entry
      systemctl enable openvpn@<name_of_your_conf_file>.service
    • Reload systemd
      systemctl daemon-reload
      and start OpenVPN service
      service openvpn start

    Reboot your system, and your OpenVPN connection should automatically start.

    This is my very first tutorial on anything Linux wise, so I hope the format and instructions are clear enough, and I really hope it helps someone out.


    OMV 4.x - D975XBX2 - Xeon X3220 - 4GB ECC Samsung DDR2 800MHz - Syba SI-PEX40064 SATA3 Card - 64GB Drevo SSD Boot Drive - Other in progress :rolleyes:

    Edited once, last by Sui_Generis ().

  • Unfortunately, i don't use openvpn so I couldn't help. But your instructions look good to me. We appreciate when people write guides like this :)

    omv 5.5.11 usul | 64 bit | 5.4 proxmox kernel | omvextrasorg 5.3.6 plugins source code and issue tracker - github

    Please read this before posting a question.
    Please don't PM for support... Too many PMs!

  • I did something similar, for some reason my searches didn't bring up this thread
    all outgoing traffic goes on the tunnel, everything local stays local. I've quoted the instructions I used from PIA for posterity.

    key words: private internet access, openvpn, transmission, pia

    First I followed the directions at this link https://www.privateinternetacc…mment/33974#Comment_33974 except I didn't run it.

    then I followed the instructions at this link https://www.privateinternetacc…e-start-at-boot-linux-vpn
    it isn't clear but the author intends the file to be in /etc/init.d/ and have it named "vpn" . Because my ovpn file had spaces in the name I copied it to be another easier to use name.

    At first I was going to try to make only certain apps use the VPN and thought that I had to enable the VPN per app but it turns out that once the VPN client is running all outgoing traffic runs on the VPN. I'm good with that.

    Transmission won't work out of the box though you have to hunt for a setting - Micro Transport Protocol (µTP) ---- Enable µTP. should be disabled.

    to test if my VPN was working I did two things.

    from the command line I did wget this downloads a text with the ip address used to connect.

    then I went to, grabbed the magnetic link and uploaded it to Transmission. This will tell you the IP address Transmission is using.

  • How hard would it be to make a module out of this?
    it would have to do the following;

    • install open-vpn
    • download and extract all the conf files from PIA (i imagine other providers may be similar)
    • store the user pass in a txt file
    • modify selected config file to point to the user/pass file (change 2 lines) (i would copy the selected file naming it something friendly and modify that)
    • create the shell script to run the vpn software with the selected config file
    • be able to turn off/disable/uninstall the vpn software
    • test the connection (use wget and display the text).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!