Files
appsandbox/tools/linux/agent
James Stringer 45285394d9 Fix capture daemons hanging guest shutdown when IDD is disconnected
appsandbox-display / -audio / -input installed SIGINT/SIGTERM via
signal(), which on glibc carries BSD SA_RESTART semantics. With the
listen socket blocking and no SO_RCVTIMEO, a SIGTERM at poweroff ran
the handler (set g_stop=1) but the kernel auto-restarted the blocking
accept() instead of returning EINTR — so the existing
`if (errno == EINTR) continue;` re-check never fired and the daemon sat
blocked in accept(). systemd then waited the full TimeoutStopSec (~90s)
per unit before SIGKILL, which presented as the VM hanging at shutdown.
Reconnecting the IDD display made accept() return a real connection, the
loop re-evaluated g_stop, and shutdown finally completed — the tell.

Switch all three to sigaction() with sa_flags=0 (no SA_RESTART), exactly
matching appsandbox-agent.c, which already shuts down promptly for this
reason. accept() now returns EINTR on SIGTERM and the loop exits cleanly.
2026-05-30 12:59:02 -04:00
..
2026-05-19 20:21:43 -04:00
2026-05-19 20:21:43 -04:00
2026-05-19 20:21:43 -04:00

App Sandbox Linux guest daemons

In-VM Linux daemons that speak the same vsock wire protocol the Windows App Sandbox host expects. See docs/linux-idd-implementation-plan.md in the repo root for full architecture and wire-protocol reference.

Daemons (this directory)

Binary Channel Listens on Privilege Status
appsandbox-agent control vsock :1 root (system) implemented
appsandbox-input input vsock :3 root (system) planned
appsandbox-display frames + cursor vsock :2 root (system) planned
appsandbox-clipboard clipboard vsock :5, :6 user (user unit) planned

Build (inside the VM)

sudo apt-get install -y build-essential
make

Install + enable (inside the VM)

sudo make enable

This installs to /usr/local/bin/, drops the systemd unit into /etc/systemd/system/, runs daemon-reload, then systemctl enable --now appsandbox-agent.service.

Smoke test

systemctl status appsandbox-agent
journalctl -u appsandbox-agent -f

You should see listening on AF_VSOCK port 1. Once the host-side Phase 1 service-GUID switch lands, the App Sandbox UI's agent dot will turn green within a few seconds of the unit being active.

Uninstall

sudo make disable
sudo rm /usr/local/bin/appsandbox-agent /etc/systemd/system/appsandbox-agent.service
sudo systemctl daemon-reload