an old macbook as an always-on remote machine
i wanted my old personal macbook awake and on my tailnet 24/7 with the lid closed, so i can ssh or screen-share into it from anywhere
the macbook stays somewhere else with the lid closed, on a charger. it never sleeps, stays on the tailnet, and i connect to it with ssh and the built-in Screen Sharing app.
never sleep, lid closed
sudo pmset -a sleep 0
sudo pmset -a disablesleep 1
sudo pmset -a displaysleep 5 # the display can still sleep, that's fine
sudo pmset -a autorestart 1 # power back on after a power cut
disablesleep 1 is the one that matters: it keeps the mac awake with the lid closed and no external display. check with pmset -g.
always on the tailnet
no Tailscale app here: neither app version can start before login or act as a Tailscale SSH server (comparison). instead, the CLI-only tailscaled from homebrew, running as a system daemon, so the mac joins the tailnet at boot:
brew install tailscale
sudo brew services start tailscale
sudo tailscale up
ssh
Tailscale SSH, so no Remote Login and no keys to manage. on the macbook:
sudo tailscale set --ssh
then from any device on the tailnet:
ssh macbook
macbook is the machine’s MagicDNS name.
screen sharing
turn on System Settings → General → Sharing → Screen Sharing. then open the Screen Sharing app on another mac and connect to macbook, or from a terminal:
open vnc://macbook
exit node / subnet router
since it’s always on anyway, it can also be:
- an exit node: route any device’s internet traffic through it, e.g. to get a home IP while travelling
- a subnet router: reach devices on its local network that can’t run Tailscale (a printer, a NAS)
sudo tailscale set --advertise-exit-node
sudo tailscale set --advertise-routes=192.168.1.0/24 # your LAN range
then approve both for the machine in the admin console (Edit route settings).
notes
- the lock screen is shared too: connect, unlock in the remote window, work, then lock it again (⌃⌘Q) before disconnecting. closing the window doesn’t lock it
- reaching it from a work laptop that’s on another tailnet: two tailnets on one mac