This version is outdated by a newer approved version.DiffThis version (2022/02/06 20:49) is a draft.
Approvals: 0/1

This is an old revision of the document!


You can easily connect your Batocera to a VPN, as we ship OpenVPN with the distribution. However, it requires some manual configuration, and the steps involved will most probably be depending on your VPN provider.

In this example here, I will be connecting a Batocera 5.27 client to a NordVPN server, and adapt it to PIA when possible. The method here can be adapted to other VPN providers quite easily, please feel free to share your experience on the forum of Discord channel.

  • Create a new folder for your OpenVPN configuration with mkdir /userdata/system/openvpn
  • If your VPN provider offers you pre-configured openVPN configuration files download them in that directory.

With NordVPN, I can get access to those files with:

cd /userdata/system/openvpn
wget https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip
unzip ovpn.zip 
rm ovpn.zip

With PIA:

cd /userdata/system/openvpn
wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
unzip openvpn.zip
rm openvpn.zip
  • Then, you need to create a new authentication file /userdata/system/openvpn/auth.txt that contains only two lines: first line is your login, second line is your password. No space, no tab, no empty line, just those two lines with login and password provided by your VPN server vendor. In the case of NordVPN, you can get them from the dashboard.

  • Select the VPN server you want to connect to, and find the associated openVPN configuration file. For example here, I want to connect to a VPN hosted in France, and will select the configuration file /userdata/openvpn/ovpn_udp/fr661.nordvpn.com.udp.ovpn. Edit this file, find the line that states auth-user-pass and append your authentication credentials file path to it:
auth-user-pass /userdata/system/openvpn/auth.txt
  • Save the file… and now your VPN configuration is done! To connect to the VPN, just launch the command line:
openvpn /userdata/system/openvpn/ovpn_udp/fr661.nordvpn.com.udp.ovpn

Similarly wit PIA:

openvpn /userdata/system/openvpn/us_silicon_valley.ovpn
  • You can verify that you are correctly connected to the VPN by checking your public IP address before and after openvpn is started by using the command curl ipinfo.io or curl ifconfig.me
  • If you want to start up your VPN connection every time Batocera boots, you can add the command openvpn /userdata/system/openvpn/ovpn_udp/fr661.nordvpn.com.udp.ovpn & to the local custom startup script /userdata/system/custom.sh – this will be the very last process fired up in the boot sequence
  • vpn_client.1644176983.txt.gz
  • Last modified: 2 years ago
  • by lbrpdx