12 gennaio 2024

Pivpn su sistemi debian/ubuntu based non supportati - PiVPN for unsupported Debian/ubuntu derivatives



 PiVPN è un ottimo sistema per realizzare velocemente un server vpn domestico.

E a che serve?

Beh, fondamentalmente a collegarsi da remoto al pc di casa vostra.

Realizzare una vpn è una faccenda relativamente complessa e richiede un minimo di competenza anche usando PiVpn che è un software in grado di automatizzare il 95% delle attività di installazione e configurazione.

Ma quel 5% residuo (procurarsi un DNS dinamico, aprire le porte del router, definire un IP statico per il server ecc.) va fatto a mano. Il wizard di PiVpn è ben fatto ma non fa miracoli.

Tuttavia tra 100 e 5 c'è una bella differenza e un gran risparmio di tempo e fatica.

Personalmente, infatti, ho configurato più volte server VPN partendo da zero ed è un compito, ormai, più noioso che impegnativo e preferisco usare PiVpn e risparmiarmi la noia.

Ma c'è un problema:

PiVPN si installa solo e soltanto su 

Raspbian and Raspberry PI OS bastai su Debian Stretch, Buster e Bullseye. Su Ubuntu Server, DietPi e

Alpine Linux.

E le derivate di Debian/Ubuntu?

Beh, la documentazione dice che potrebbe funzionare ma loro non danno supporto in merito.

Di fatto, l'installer di PiVPN si rifiuta di proseguire se non rileva i sistemi operativi supportati ufficialmente.

E allora come si fa?

Ecco qua il trucchetto:

Per esempio, da Linux Mint è necessario modificare (momentaneamente) il file /etc/os-release come segue: dopo il setup si può rimettere tutto come stava prima. Su Mint 21.1 e LMDE6 poi PiVPN si installa e funziona perfettamente:


#NAME="Linux Mint"

#VERSION="21.2 (Victoria)"

#ID=linuxmint

#ID_LIKE="ubuntu debian"

#PRETTY_NAME="Linux Mint 21.2"

#VERSION_ID="21.2"

NAME="Ubuntu"

VERSION="22.04 (Jammy)"

ID=ubuntu

ID_LIKE="ubuntu debian"

PRETTY_NAME="Ubuntu 22.04"

VERSION_ID="22.04"

HOME_URL="https://www.linuxmint.com/"

SUPPORT_URL="https://forums.linuxmint.com/"

BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"

PRIVACY_POLICY_URL="https://www.linuxmint.com/"

VERSION_CODENAME=victoria

UBUNTU_CODENAME=jammy


oppure, per LMDE


#PRETTY_NAME="LMDE 6 (faye)"

#NAME="LMDE"

#VERSION_ID="6"

#VERSION="6 (faye)"

#VERSION_CODENAME=faye

#ID=linuxmint

#HOME_URL="https://www.linuxmint.com/"

#SUPPORT_URL="https://forums.linuxmint.com/"

#BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"

#PRIVACY_POLICY_URL="https://www.linuxmint.com/"

#ID_LIKE=debian

NAME="Debian"

VERSION="12"

DEBIAN_CODENAME=bookworm

ID=debian


Dopodiché, basta lanciare curl -L https://install.pivpn.io | bash da un terminale root e seguire il wizard. Ed il gioco è fatto: in pochi minuti avrete il vostro server vpn.


In Google Translator's English:


PiVPN is an excellent way to quickly create a home VPN server.

And what's the point?

Well, basically to connect remotely to your home PC.

Creating a VPN is a relatively complex matter and requires a minimum of expertise even using PiVpn which is software capable of automating 95% of installation and configuration activities.

But that remaining 5% (procuring a dynamic DNS, opening the router ports, defining a static IP for the server, etc.) must be done by hand. The PiVpn wizard is well done but doesn't work miracles.

However, between 100 and 5 there is a big difference and a great saving of time and effort.

Personally, in fact, I have configured VPN servers several times starting from scratch and it is now a task that is more boring than challenging and I prefer to use PiVpn and save myself the boredom.

But there's a problem:

PiVPN installs only and only on Raspbian and Raspberry PI OS based on Debian Stretch, Buster and Bullseye. On Ubuntu Server, DietPi and Alpine Linux.

What about Debian/Ubuntu derivatives?

Well, the documentation says it might work but they don't support it.

In fact, the PiVPN installer refuses to continue if it does not detect officially supported operating systems.

So how do you do it?

Here's the trick:

For example, from Linux Mint it is necessary to (temporarily) modify the /etc/os-release file as follows: after setup you can put everything back as it was before. On Mint 21.1 and LMDE6 then PiVPN installs and works perfectly:

#NAME="Linux Mint"

#VERSION="21.2 (Victoria)"

#ID=linuxmint

#ID_LIKE="ubuntu debian"

#PRETTY_NAME="Linux Mint 21.2"

#VERSION_ID="21.2"

NAME="Ubuntu"

VERSION="22.04 (Jammy)"

ID=ubuntu

ID_LIKE="ubuntu debian"

PRETTY_NAME="Ubuntu 22.04"

VERSION_ID="22.04"

HOME_URL="https://www.linuxmint.com/"

SUPPORT_URL="https://forums.linuxmint.com/"

BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"

PRIVACY_POLICY_URL="https://www.linuxmint.com/"

VERSION_CODENAME=victoria

UBUNTU_CODENAME=jammy


and, for LMDE


#PRETTY_NAME="LMDE 6 (faye)"

#NAME="LMDE"

#VERSION_ID="6"

#VERSION="6 (faye)"

#VERSION_CODENAME=faye

#ID=linuxmint

#HOME_URL="https://www.linuxmint.com/"

#SUPPORT_URL="https://forums.linuxmint.com/"

#BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"

#PRIVACY_POLICY_URL="https://www.linuxmint.com/"

#ID_LIKE=debian

NAME="Debian"

VERSION="12"

DEBIAN_CODENAME=bookworm

ID=debian


After that, just run curl -L https://install.pivpn.io | bash from a root terminal and follow the wizard. And that's it: in a few minutes you will have your VPN server.

Nessun commento:

Posta un commento

Che ne dici?