Skip to content

About

Use Zerotier VPN on the Steam Frame

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

ZeroTier on the Steam Frame (and other immutable aarch64 Linux)

Run ZeroTier One on a Steam Frame without compiling anything, and without touching the read-only /usr - using the official prebuilt arm64 binary plus file capabilities and a systemd user service.

SteamOS is an immutable, Arch-based image: /usr is read-only, there is no apt/pacman as a supported package manager, and a factory reset wipes system-level hacks. The usual curl https://install.zerotier.com | sudo bash path does not apply. This projects's approach:

piece where it lives needs root?
ZeroTier binaries ~/.local/lib/zerotier/bin/ no
capability grant stamped on that one binary one sudo at install time
node identity, joined networks ~/.local/state/zerotier-one/ no
autostart ~/.config/systemd/user/zerotier-one.service no
config ~/.config/zerotier-steamframe/zt.conf no

Everything sits in the home directory, so it survives SteamOS updates and is gone after a factory reset - no system file is ever modified.


Why this works

ZeroTier has to create a TUN interface, which requires CAP_NET_ADMIN. That is normally a reason to run as root, but Linux can grant the capability to a single binary instead:

$ getcap ~/.local/lib/zerotier/bin/zerotier-one
/home/<user>/.local/lib/zerotier/bin/zerotier-one cap_net_admin,cap_net_raw=eip

With that stamp the daemon runs as your ordinary user, starts from your systemd user manager at login, and never asks for sudo again. /dev/net/tun is mode 0666 on SteamOS and CONFIG_TUN=y, so nothing else is needed.


Requirements

  • aarch64 Linux with an immutable root (/usr read-only) - tested on SteamOS "holo" on the Steam Frame; any Arch/Debian/Fedora aarch64 box works too
  • systemd user session (a normal graphical or text login)
  • curl, tar, ar or dpkg-deb, and libcap (setcap/getcap)
  • internet access at install time - this repository ships no ZeroTier binary; it is downloaded from ZeroTier's own server (license notes)

Quick start

git clone https://github.com/redneptun/zerotier-steamframe
cd zerotier-steamframe
./install.sh --networks "0011223344556677 8899aabbccddeeff" --now

(These are two example network IDs - use your own Zerotier network IDs. They are stored in ~/.config/zerotier-steamframe/zt.conf, which is git-ignored.)

install.sh will:

  1. fetch zerotier-one_<ver>_arm64.deb from download.zerotier.com and check its SHA-256,
  2. stage zerotier-one, zerotier-cli, zerotier-idtool into ~/.local/lib/zerotier/bin,
  3. ask for your password once to stamp cap_net_admin,cap_net_raw on that binary,
  4. write ~/.config/systemd/user/zerotier-one.service and enable it,
  5. start it and join the networks you passed.

Then:

$ ./zt status
== service ==
  state     : active
  autostart : enabled
== node ==
  address   : 0a1b2c3d5e
== info ==
200 info 0a1b2c3d5e 1.16.2 ONLINE
== networks ==
200 listnetworks <nwid> <name> <mac> <status> <type> <dev> <ZT assigned ips>
200 listnetworks 0011223344556677 my_vpn 02:00:00:00:00:01 OK PRIVATE zt00112233 10.10.0.5/24
== interfaces ==
zt00112233       UNKNOWN        10.10.0.5/24 fe80::1/64

A private network will stay REQUESTING/ACCESS_DENIED until you authorize the node: open your ZeroTier controller's Members page and approve the 10-digit address printed by ./zt id.

Commands

Everything is driven through ./zt (no sudo anywhere):

command what it does
./zt status service state, node address, listnetworks, zt* interfaces
./zt doctor health check: binary, capabilities, unit, /dev/net/tun, API reachability
./zt start / stop / restart control the service now
./zt enable / disable autostart at login
./zt join [ID ...] join networks (default: ZT_NETWORKS from zt.conf); persists
./zt leave ID|all leave one or every network
./zt networks / peers / id list networks, peers, or this node's address
./zt logs [-f] journalctl --user -u zerotier-one.service
./zt paths / version show every path in use / installed version

Configuration

~/.config/zerotier-steamframe/zt.conf is a shell snippet written on first install; see conf/zt.conf.example for every setting: ZT_VERSION, ZT_DEB_DIST, ZT_DEB_SHA256, ZT_PREFIX, ZT_STATE, ZT_PORT, ZT_NETWORKS, ZT_UNIT. Command-line flags override it:

./install.sh --help

Precedence: flags > zt.conf > built-in defaults. Network IDs are only ever kept in zt.conf (git-ignored), never in the scripts.

Updating ZeroTier

./install.sh --version 1.16.3 --sha256 <digest> --force --now

Staging a new binary clears its file capabilities, so the installer always re-applies them - that is the one place sudo is needed

Removing it

./uninstall.sh            # unit + binaries (keeps the node identity)
./uninstall.sh --purge    # also deletes identity and joined networks

No sudo: nothing was installed as root, and the capability vanishes with the binary.


Repository layout

install.sh                        one-shot setup (fetch, stage, setcap, unit)
uninstall.sh                      clean removal, --purge also drops the identity
zt                                day-to-day CLI (status/doctor/join/logs/...)
lib/common.sh                     settings, path resolution, systemd + CLI helpers
lib/fetch.sh                      download + checksum + unpack the upstream .deb
lib/setcap.sh                     the one privileged step, run via sudo by install.sh
systemd/zerotier-one.service.in   user-unit template (@DAEMON@/@STATE@/@PORT@)
conf/zt.conf.example              every setting, with comments
docs/HOW-IT-WORKS.md              why the unprivileged design, and the alternatives
docs/TROUBLESHOOTING.md           symptoms -> fixes
docs/LICENSE-NOTES.md             ZeroTier licensing; why no binary is committed

Security notes

  • Least privilege. The binary gets exactly two capabilities (cap_net_admin, cap_net_raw) - not root, not setuid, not a sudoers entry. ./zt doctor shows them.
  • One sudo, one file. The privileged step only stamps a capability on a binary inside your home. It never writes to /usr, /etc or a system unit directory, so it cannot brick the OS update path.
  • Secrets. ~/.local/state/zerotier-one/identity.secret is your node's private key and authtoken.secret guards the local control API; both are created by ZeroTier with private permissions. Back up identity.secret if you care about keeping your 10-digit address. zt.conf is written mode 600 and git-ignored because it holds your network IDs.
  • Nothing is taken on trust beyond HTTPS. The package comes from ZeroTier's download server over TLS and its SHA-256 is checked against the pinned value in lib/common.sh. Pin a digest yourself when bumping versions.

Things to know

  • Autostart happens at login, not at boot. The Steam/Big Picture session starts the user manager, which is enough for a handheld. For a headless box, turn on lingering (one sudo): loginctl enable-linger <user>.
  • No full tunnel by default. ZeroTier only carries traffic for its own subnets; reaching hosts behind them needs routes/permissions on those networks (managed routes on the controller, or ip route yourself).
  • Port 9993 must be free for the control API; if it is not, set ZT_PORT (the CLI follows automatically through zerotier-one.port in the state dir).
  • Never update the binary by hand and skip setcap. Rewriting the file drops its capabilities and the daemon then dies with unable to configure TUN/TAP device. Re-run ./install.sh.
  • Running the tools from a sandboxed terminal (Flatpak VS Code, container) is fine for editing but not for systemctl --user//dev/net/tun - run the scripts on the host. SteamOS also exports a nested XDG_RUNTIME_DIR (/run/user/<uid>/nested_plasma) in the gaming session; zt detects both cases and corrects them, and ./zt doctor tells you what it found.

Tested on

Steam Frame (ARM big.LITTLE aarch64, Cortex-A520/A720/X4) running SteamOS "holo" (ID_LIKE=arch, VARIANT_ID=vr, immutable /usr), with upstream ZeroTier One 1.16.2 arm64 joining three private networks: node ONLINE, interfaces up, assigned addresses and routes installed, peers discovered, and everything rejoining automatically after a reboot.

Troubleshooting

Start with ./zt doctor; see docs/TROUBLESHOOTING.md for the common cases (missing capability, network stuck in REQUESTING, user unit not starting at login, port already in use, wrong terminal sandbox).

Contributing

Issues and pull requests welcome - especially reports from other aarch64 immutable/leaf OSes (Bazzite, Fedora Rawhide, router distros). POSIX sh only, shellcheck-clean where practical, and keep private values out of the tree.

License

The scripts, unit template and documentation in this repository are MIT licensed - see LICENSE. ZeroTier One itself is not covered by that license and is not redistributed here: it is downloaded from ZeroTier's official server at install time. See docs/LICENSE-NOTES.md and the upstream license. ZeroTier is a trademark of ZeroTier, Inc.; this project is not affiliated with or endorsed by ZeroTier, Inc.

About

Use Zerotier VPN on the Steam Frame

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages