Tailscale + Mosh Recovery (Headless Mac mini)
Problem
After a Tailscale update or daemon restart on a headless Mac mini, mosh sessions break. Common symptoms (any combination):
tailscale statusreturns:failed to connect to local Tailscale service; is Tailscale running?mosh <host>returns:could not get canonical name for <host>: nodename nor servname provided, or not known, thenConnection closed by UNKNOWN port 65535, thenDid not find remote IP address (is SSH ProxyCommand disabled?).- Tailscale GUI app CLI returns:
Tailscale.CLIError error 1. which tailscalereports a path that does not actually exist on disk.tailscale upregisters the machine as<hostname>-1(a duplicate of the original node — IP changed).
The two underlying problems are causally linked: Tailscale daemon trouble forces a re-auth → new Tailscale IP → existing mosh-server processes are bound to the old IP and become unreachable.
Context / Triggers
| Sign | Likely cause |
|---|---|
| Mac mini's tailscale status says daemon not running | GUI app daemon needs a logged-in user session — won't run headless |
| which tailscale returns a path that ls says doesn't exist | Shell PATH cache + missing symlink (often the Homebrew symlink dropped during update) |
| Two Tailscale installs: GUI app at /Applications/Tailscale.app AND Homebrew Cellar | Dual install — one's daemon is fighting for the socket |
| mosh fails only after a working tailscale up re-registration | Stale mosh-server processes bound to the prior Tailscale IP |
| Old hostname offline + new hostname <name>-1 in admin console | Re-auth created a new node; old one is stale |
Solution
Work in this order: Layer 1 (Tailscale daemon) then Layer 2 (mosh cleanup). If only mosh is broken and tailscale status is healthy, skip Layer 1.
Layer 1: Tailscale daemon health (headless Mac mini)
The headless constraint: the standalone Tailscale.app GUI bundle's daemon needs an active user session. On a headless Mac mini (no monitor, no auto-login), the GUI daemon never starts. The right setup for headless is Homebrew's tailscale package run as a launchd service — it's a system service that survives reboots without any logged-in user.
Step 1.1: Confirm the symptom + identify installs
tailscale status # likely: "failed to connect to local Tailscale service"
which tailscale # may report a path that doesn't exist
ls -la /Applications/Tailscale.app # GUI app present?
brew list tailscale 2>/dev/null # Homebrew install present?
ls -la $(brew --prefix)/Cellar/tailscale # Cellar contents if Homebrew has it
If both installs exist, that's the dual-install conflict. The CLI symlink at /opt/homebrew/bin/tailscale may have been removed by a recent update — leaving the daemon running (or not) and no CLI to talk to it.
Step 1.2: Remove the GUI app's broken CLI shim (if present)
The GUI app installs a shim at /usr/local/bin/tailscale that errors with Tailscale.CLIError error 1 when the GUI app isn't running. Remove it to avoid PATH ambiguity:
sudo rm -f /usr/local/bin/tailscale
Step 1.3: Re-link the Homebrew CLI
The Homebrew binary still exists in $(brew --prefix)/Cellar/tailscale/<version>/bin/tailscale; it's just unlinked.
brew link tailscale
hash -r # clear shell PATH cache
which tailscale # should now report /opt/homebrew/bin/tailscale
If brew link complains about a conflict, the conflicting path was likely the GUI shim from Step 1.2 — re-run Step 1.2 and try again. If you've decided to remove the GUI app entirely, brew link --overwrite tailscale is acceptable.
Variant: orphan-after-autoremove
If which tailscale returns nothing right after a brew uninstall of something else reported Autoremoving ... tailscale: the daemon is still running on the unlinked binary — brew link --overwrite tailscale restores the CLI without touching it. Full diagnosis + 2026-05-22 incident: