Tailscale add-on exits after every iHost reboot — root cause and working fix

Hi everyone,

I have been fighting this for weeks: after every iHost reboot the Tailscale add-on
ends up in exited / restart-loop state and local access is lost. The only workaround
was to delete and reinstall the add-on (which resets the preferences) and then re-apply
the route settings — until the next reboot.

I finally found the root cause in the containerboot source, and a configuration that
survives reboots. Posting it here because I could not find it anywhere on the forum.


Symptom

Container tailscale/tailscale shows Exited after reboot. The log ends with:

boot: Running 'tailscale up'
Error: changing settings via 'tailscale up' requires mentioning all
non-default flags. To proceed, either re-run your command with --reset or
use the command below to explicitly mention the current value of
all non-default settings:

    tailscale up --accept-dns=false --advertise-exit-node --advertise-routes=192.168.1.0/24

boot: Sending SIGTERM to tailscaled
boot: failed to auth tailscale: failed to auth tailscale: tailscale up failed: exit status 1

After that the container exits with code 1, and because iHost does not set a restart
policy, it stays down. Access to the LAN through Tailscale is gone.


Root cause

The iHost Tailscale add-on is the official tailscale/tailscale image, whose entrypoint
is containerboot. It ships with only two environment variables:

TS_STATE_DIR=/data/tailscalState
TS_SOCKET=/var/run/tailscale/tailscaled.sock

TS_AUTH_ONCE defaults to false in containerboot, which means every container
start runs tailscale up
. That is fine on a fresh install, because the saved
preferences are still empty.

The problem appears as soon as you use any non-default setting — advertising a subnet
route, advertising an exit node, --accept-dns=false, --ssh, tags and so on. Those
values get written into the saved preferences. On the next start, tailscale up is
called without them, Tailscale detects that the preferences would change
(checkForAccidentalSettingReverts in cmd/tailscale/cli/up.go), refuses to continue,
and containerboot treats that as fatal: it sends SIGTERM to tailscaled and exits 1.

So the sequence is always the same:

  1. Install the add-on → works.
  2. Enable subnet route / exit node → preferences now contain non-default flags.
  3. Reboot iHost → tailscale up collides with those preferences → exit 1 → dead.
  4. Delete and reinstall → preferences reset → works again until step 2.

That is why “delete and reinstall” seems to fix it, and why it always comes back.


The fix

Recreate the add-on with four environment variables instead of two:

TS_STATE_DIR=/data/tailscalState
TS_SOCKET=/var/run/tailscale/tailscaled.sock
TS_AUTH_ONCE=true
TS_EXTRA_ARGS=--accept-dns=false --advertise-exit-node --advertise-routes=192.168.1.0/24

Adjust TS_EXTRA_ARGS to exactly match the settings you actually use. The value above is
literally the command Tailscale prints in its own error message, which is the point: the
flags must match the saved preferences one-to-one.

Why it works

TS_AUTH_ONCE=true — when the state file is valid, containerboot never calls
tailscale up at all. It waits for the Running state on the IPN bus and then calls
tailscale set instead:

RegisterReq: got response; nodeKeyExpired=false, machineAuthorized=true; authURL=false
boot: Running 'tailscale set'
boot: Startup complete, waiting for shutdown signal

tailscale set uses a masked EditPrefs and has no “accidental setting revert”
check, so it cannot fail this way.

TS_EXTRA_ARGS — this is only appended to tailscale up (it is deliberately not
passed to tailscale set). So it matters only on the very first login, where it makes
the new preferences identical to what up was told — no mismatch, no error.

TS_STATE_DIR must point at a path that actually survives a reboot. Worth verifying:
if the state is lost, TS_AUTH_ONCE alone is not enough, because the container falls back
to an interactive login, and containerboot’s 60-second boot timeout then kills it.

Steps on iHost

  1. Generate an auth key in the Tailscale admin console
    (Settings → Keys → Generate auth key). A reusable key is convenient.
    Note: the auth key only authorises joining; once the node is registered it uses its
    own machine/node key, so the key’s expiry does not disconnect an existing device.
  2. Docker → tailscale/tailscale → Info → Delete.
    Use Delete, not Uninstall — Uninstall also removes the volume.
  3. Docker Hub → tailscale/tailscale → Run.
    • Network: host
    • Host volume: pick the existing volume, do not leave it empty
    • Environment variables: the four lines above
    • Port: leave empty
  4. Run, then open the auth URL from the log once to register the node.

After that, rebooting iHost brings Tailscale back on its own.


Verification

Before the fix, every reboot produced the flag-mismatch error and exit 1.

After the fix, a real reboot gave:

boot: Sending SIGTERM to tailscaled                      <- clean shutdown during reboot
RegisterReq: got response; nodeKeyExpired=false; machineAuthorized=true; authURL=false
boot: Running 'tailscale set'
boot: Startup complete, waiting for shutdown signal

and from another machine on the tailnet:

ping 100.x.y.z            -> 0% packet loss
curl http://100.x.y.z/    -> 200 OK
tailscale status          -> active; direct 192.168.1.100:xxxxx, tx/rx increasing

The node’s Created timestamp in tailscale status --json stays unchanged across
reboots, which confirms the identity is being reloaded from the persistent state and no
new node is being registered each time.


Two things worth knowing

Do not set TS_ROUTES if you also advertise an exit node. TS_ROUTES maps to
tailscale set --advertise-routes=..., and set replaces the advertised route list.
If your preferences contain 0.0.0.0/0 and ::/0 for the exit node, adding
TS_ROUTES=192.168.1.0/24 drops them. Use TS_EXTRA_ARGS instead and list every route
you want.

The subnet route still needs approving once. After the node registers, the route shows
up in the admin console under Machines → → Edit route settings. Advertising is the
node’s job; approving is yours.

iHost does not let you edit the environment of an already installed add-on, which is
why the add-on has to be recreated. The official guidance from eWeLink staff in other
threads is the same: containers are meant to be disposable, recreate them with the new
startup parameters.


Environment

  • iHost, eWeLink CUBE firmware 2.15.0, ARMv7
  • tailscale/tailscale:latest, containerboot v1.104.4
  • Subnet router for 192.168.1.0/24, exit node advertised as a backup path,
    a Keenetic router acting as the primary subnet router

Hope this saves someone the same weeks I lost. Happy to provide more log excerpts if
anyone wants to dig into the containerboot paths.