Skip to content

fix(driver-vm): run sandbox supervisor as guest pid 1#2299

Open
drew wants to merge 1 commit into
mainfrom
1998-vm-pid-one/drew
Open

fix(driver-vm): run sandbox supervisor as guest pid 1#2299
drew wants to merge 1 commit into
mainfrom
1998-vm-pid-one/drew

Conversation

@drew

@drew drew commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Run the VM guest bootstrap as PID 1 so it can exec openshell-sandbox in place. This prevents /init.krun from appearing as an unverifiable ancestor during network policy evaluation and incorrectly denying allowed egress.

Related Issue

Closes #1998

Changes

  • Set KRUN_INIT_PID1=1 in the authoritative libkrun guest environment and remove caller overrides
  • Clear the runtime-only switch in the guest bootstrap before launching the supervisor
  • Add unit coverage for guest environment construction and document the VM PID 1 invariant
  • Run VM smoke and all host-gateway e2e tests by default

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)
  • cargo test -p openshell-driver-vm libkrun_guest_env
  • mise run e2e:vm
  • OPENSHELL_E2E_VM_TEST=host_gateway_alias mise run e2e:vm

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew drew requested review from a team, derekwaynecarr, maxamillion and mrunalp as code owners July 15, 2026 15:27
@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status test:e2e Requires end-to-end coverage labels Jul 15, 2026
@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

PR Review Status

Validation: This is a concentrated VM-driver fix for the confirmed and linked bug in #1998, authored by a repository maintainer.
Head SHA: ef9cade570d1012d0070ccdcac1ac1fe7e3ca369

Review findings:

  • No blocking correctness or security findings remain.
  • Residual test risk: the updated VM harness covers the binary-scoped host-gateway egress path locally, but the current branch E2E workflow does not run libkrun. The author reports the VM and focused host-gateway tests passing; test:e2e is required for the repository CI gate because this changes VM lifecycle and network-policy behavior.

Docs: Fern docs are not needed because this restores documented VM behavior without changing commands, configuration, or user workflow. The architecture invariant is documented in architecture/compute-runtimes.md.

Next state: gator:watch-pipeline

@github-actions

Copy link
Copy Markdown

Label test:e2e applied for ef9cade. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@johntmyers johntmyers added gator:merge-ready and removed gator:watch-pipeline Gator is monitoring PR CI/CD status labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gator:merge-ready test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: vm driver denies allowed network egress due to /init.krun ancestor integrity failure

2 participants