Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vpn_client [2022/02/07 01:52] – cleaned up headers, added troubleshooting section (thanks Vulmiy), added instructions for script setup atarivpn_client [2024/01/28 00:57] (current) – add note in tailscale setup section to access resources behind a tailscale subnet router cs
Line 1: Line 1:
-===== OpenVPN client =====+====== OpenVPN client ======
 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. 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.
  
Line 92: Line 92:
 Adapt the ''<replace me>'' to your VPN of course. Adapt the ''<replace me>'' to your VPN of course.
  
 +==== My VPN works fine on my PC but not on my Raspberry Pi/other SBC! ====
 +
 +The ARM build of Batocera does not include the necessary ''/dev/net'' directory and node structure that OpenVPN relies on by default. This can be added in with the script like so:
 +
 +<file bash custom.sh>
 +#!/bin/bash
 +
 +if test "$1" != "start"
 +then
 +  exit 0
 +fi
 +
 +if [ ! -d /dev/net ]; then
 +  mkdir -p /dev/net 
 +  mknod /dev/net/tun c 10 200
 +  chmod 600 /dev/net/tun
 +fi
 +
 +openvpn /userdata/system/openvpn/<replace_me>.ovpn &
 +</file>
 +
 +Adapt the ''<replace me>'' to your VPN of course.
 +
 +====== Tailscale VPN configuration ======
 +
 +While not packaged with Batocera by default, the Tailscale VPN service (which is essentially a fancy wrapper for Wireguard and has a free tier) can be added and functions on both the x86 and ARM-based versions of Batocera. This can provide you with benefits including [[netplay|Netplay with Retroarch cores]] and multiplayer on PPSSPP standalone without needing port forwarding, as well as the ability to SSH or SCP into your device from another network. There are some extra steps if you are on an ARM-based single-board computer, but it is confirmed working on Batocera versions as early as V31 and tested with both 32-bit and 64-bit boards (the Odroid XU4 and the Odroid N2L, respectively). You should have an account made with Tailscale ahead of trying this.
 +
 +  * Download a Tailscale build from the static binaries section (if using an SBC, grab the one that matches your CPU architecture. ARM for the tested XU4 and ARM64 for the N2L): https://pkgs.tailscale.com/stable/#static
 +  * On your Batocera computer, create the directory /userdata/tailscale and move tailscale, tailscaled and the systemd folder inside your respective static build tarball to that folder. On a Windows computer, you can use 7-Zip to unpack the .tgz file twice, then sent it to Batocera with WinSCP. 
 +  * Create a file called "custom.sh" in /userdata/system (can also be done with WinSCP). Add the following to /userdata/system/custom.sh
 +
 +<file bash custom.sh>
 +#!/bin/bash
 +
 +if test "$1" != "start"
 +then
 +  exit 0
 +fi
 +/userdata/tailscale/tailscaled -state /userdata/tailscale/state > /userdata/tailscale/tailscaled.log 2>&1 &/userdata/tailscale/tailscale up
 +</file>
 +
 +  * **IF YOU ARE ACCESSING RESOURCES BEHIND A TAILSCALE SUBNET ROUTER:** By default, Tailscale clients specifically for Linux do not accept routes advertised by subnet routers. If you wish to access resources in the subnet router's network, the ''tailscale up'' command needs an ''--accept-routes'' flag appended. [[https://tailscale.com/kb/1241/tailscale-up?q=--accept-routes|Tailscale Docs]]
 +  * Using the above script block as a reference, the last line will look like this if you want to enable this feature:
 +
 +<code>
 +/userdata/tailscale/tailscaled -state /userdata/tailscale/state > /userdata/tailscale/tailscaled.log 2>&1 &/userdata/tailscale/tailscale up --accept-routes
 +</code>
 +
 +  * **IF YOU ARE USING AN ARM SBC:** You need to use WinSCP or another program with this function to check that the tailscale and tailscaled files in /userdata/tailscale have the execute permission. Go to that directory and right click on both files, then click "Properties." Make sure to check the checkboxes for "Owner" and "Group" marked "X," then hit OK.
 +  * SSH to your Batocera computer with PuTTY or another program, or access Batocera's local terminal. Run this command after logging in as root:
 +
 +<code>
 +/userdata/tailscale/tailscaled -state /userdata/tailscale/state > /userdata/tailscale/tailscaled.log 2>&1 &/userdata/tailscale/tailscale up
 +</code>
 +
 +  * Tailscale will present you with a web link in the terminal, which you need to type into a separate PC's browser. From there, you'll log into Tailscale's web UI and connect the device.
 +  * In the Tailscale web UI, click the "..." to the right of your newly-connected Batocera device and click "disable key expiry" so you never have to do this again!
 +  * You should see the "Connected" status in the Tailscale web UI any time you turn on your Batocera computer now. Running the command "ip a" in terminal should show the word "tailscale" somewhere in the networking readout.
 +
 +To add your friends to the same Tailscale network for multiplayer (who can be running non-Batocera versions of PPSSPP like Android for that use case), you can go through this process yourself and authenticate their devices by logging in as yourself, or you can invite them to join your Tailnet. Note that the free version of Tailscale only allows you to add two other people to your network, but if you sign in as yourself on all the devices, you can get as many as 100.
  • vpn_client.1644195127.txt.gz
  • Last modified: 2 years ago
  • by atari