Skip to content

Instantly share code, notes, and snippets.

@nning
Last active April 19, 2024 21:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nning/95f6d11fcf9bf620dbb45119642c1b18 to your computer and use it in GitHub Desktop.
Save nning/95f6d11fcf9bf620dbb45119642c1b18 to your computer and use it in GitHub Desktop.
Install tailscale on Steam Deck without root

Install Tailscale on Steam Deck without root

Make sure you have a password set for deck, because the install script will need sudo to suid root the tailscaled binary.

  • Create folder tailscale in home directory of deck user mkdir -p ~/tailscale
  • Make install script executable chmod +x ~/tailscale/tailscale-install-user.sh
  • Run install script ./tailscale/tailscale-install-user.sh
  • Run ./tailscale/tailscale up as elsewhere documented

Caveats

This will run tailscaled as user, so no changes to the SteamOS system partitions are necessary. The daemon will not be able to create a tun device, routes, or firewall rules, though. Access from Deck to VPN is only possible using a local SOCKS proxy. It is possible, however, to access the Deck via SSH through the VPN (which is sufficient in my case).

Additional Information

#!/usr/bin/env bash
set -euo pipefail
dir="$(mktemp -d)"
pushd .
cd "${dir}"
tarball="$(curl 'https://pkgs.tailscale.com/stable/?mode=json' | jq -r .Tarballs.amd64)"
version="$(echo ${tarball} | cut -d_ -f2)"
curl "https://pkgs.tailscale.com/stable/${tarball}" -o tailscale.tgz
tar xzf tailscale.tgz
mkdir -p ~/tailscale
cp -av tailscale_*/tailscale ~/tailscale
sudo cp -av tailscale_*/tailscaled ~/tailscale
cp -av ~/tailscale/tailscaled.env ~/tailscale/tailscaled.env.backup || true
cp -av tailscale_*/systemd/tailscaled.defaults ~/tailscale/tailscaled.env
cp -av ~/tailscale/tailscaled.service ~/.config/systemd/user
sudo chown root:deck ~/tailscale/tailscaled
sudo chmod u+s ~/tailscale/tailscaled
systemctl --user daemon-reload
systemctl --user enable tailscaled
systemctl --user start tailscaled
[Unit]
Description=Tailscale node agent
Documentation=https://tailscale.com/kb/
Wants=network-pre.target
After=network-pre.target NetworkManager.service systemd-resolved.service
[Service]
EnvironmentFile=/home/deck/tailscale/tailscaled.env
ExecStartPre=/home/deck/tailscale/tailscaled --cleanup
ExecStart=/home/deck/tailscale/tailscaled --tun=userspace-networking --port=${PORT} $FLAGS
ExecStopPost=/home/deck/tailscale/tailscaled --cleanup
Restart=on-failure
Type=notify
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment