Skip to content

deploy/sbx: install-host.sh does not install moca-egress, so SBX hosts get no guest egress #623

Closed

Description

@pdettori

Problem

v0.8.0 ships guest egress for the microVM tier (P4.1, #277), but deploy/sbx/install-host.sh — the
installer for the SBX0 service's KVM host — has no egress wiring at all. deploy/microvm/setup-microvm.sh
does it for the P6 microVM deployment; deploy/sbx was never taught the same.

What deploy/microvm has and deploy/sbx lacks:

Piece deploy/microvm deploy/sbx
moca-egress binary install_egress_binary (setup-microvm.sh:305) —
allowlist env file, written only when absent install_egress_env (setup-microvm.sh:321) —
moca-egress.service install_units —
worker ordered after the proxy After=/Wants=moca-egress.service (microvm-worker.service:55-56) — ([email protected])
MOCA_EGRESS_CONTROL_SOCK for the worker microvm-worker.service:166 — (neither the unit nor the per-worker env file install-host.sh:107-112 writes)
wait for the control socket, named failure setup-microvm.sh:529-537 —

Consequence: a host installed by deploy/sbx/install-host.sh runs workers with no egress, and the
v0.8.0 release note ("the per-Exec Firecracker microVMs behind mocactl sbx can now reach the outside
world") is true only on a host where egress was added by hand. The one live SBX0 host has it through
a manual drop-in (/etc/systemd/system/sbx-worker@<id>.service.d/egress.conf) plus a hand-installed
moca-egress.service and moca-egress.env — state that a re-install or a new host does not reproduce.

Proposed fix

  • install-host.sh installs moca-egress (binary from the bundle, or built), moca-egress.service,
    and a seeded moca-egress.env (written only when absent, as setup-microvm.sh does), reusing the
    deploy/microvm functions rather than copying them.
  • [email protected] gains After=/Wants=moca-egress.service and
    MOCA_EGRESS_CONTROL_SOCK=/run/moca-egress/control.sock. One moca-egress per host serves every
    template worker (P4.1 T3).
  • The installer waits for the control socket before (re)starting workers and fails naming
    journalctl -u moca-egress.
  • install-host.sh --uninstall (the record manifest) removes what it installed.
  • An opt-out (--no-egress) for a host that must stay offline; the worker then runs without
    MOCA_EGRESS_CONTROL_SOCK, as today.
  • The installer refuses a snapshot built before P4.1 when egress is on, or at least warns: a pre-P4.1
    snapshot has no guest egress listener (deploy/microvm/P4-ON-P6.md, "Guest egress").
  • deploy/sbx/tests/install-host.test.sh covers the new units and the env file; RUNBOOK.md and the
    sbx:install / sbx:upgrade procedures describe egress and the allowlist.

Acceptance

  • A fresh host from install-host.sh serves curl https://api.github.com/zen from inside a sandbox
    (allowlisted), and a non-allowlisted host is refused with 403 destination_denied.
  • The live host's manual drop-in can be deleted and a re-run of install-host.sh reproduces the
    same behaviour.

Related

Prerequisite for per-user credential injection on SBX egress (spec to follow), whose moca-egress
credential client token and interception CA are installed by this same script.

Activity

  1. added
    bug
    on Oct 27, 2026
  2. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions