Skip to content

Android-in-sandbox: guest kernel binder + binfmt_misc + config drift guard - #3

Draft
sosso wants to merge 1 commit into
mainfrom
android-redroid-kernel
Draft

Android-in-sandbox: guest kernel binder + binfmt_misc + config drift guard#3
sosso wants to merge 1 commit into
mainfrom
android-redroid-kernel

Conversation

@sosso

@sosso sosso commented Aug 5, 2026

Copy link
Copy Markdown
Member

What this is

The kernel side of getting Android (redroid) — and the full RSHomebuyerApp build/run loop — working inside a matchlock sandbox VM, plus a drift guard for the kernel config build and the complete runbook so the recipe doesn't live only in gitignored scratch dirs.

Proven end-to-end 2026-08-04 on instance 1: Android 15 boots in ~2 min, the debug APK builds in-VM (x86_64 NDK under qemu via binfmt_misc), and the app signs into the instance's own Rails with photos served by the in-VM web container. Zero bytes of app code executed on the host.

📊 Full exploration report (what was tried, what was found, next direction):
https://claude.ai/code/artifact/0faaea79-4e27-4024-8d8e-e8a5d4748eef

Changes

  • guest/kernel/{arm64,x86_64}.config — binder/binderfs + binder devices, BINFMT_MISC, SELinux-permissive chain (SECURITY/SECURITY_NETWORK/AUDIT/SECURITY_SELINUX/SELINUX_DEVELOP), cgroup v1 MEMCG_V1/CPUSETS_V1. Removes two phantom symbols that were silently doing nothing (CONFIG_CGROUP_V1 doesn't exist in 6.19; CONFIG_SELINUX was never the real symbol).
  • guest/kernel/verify-config.sh + known-drift.txt, wired into the kernel Dockerfile — olddefconfig drops unknown/unmet options silently; the build now fails on any new drift. The known-drift list is the untriaged pre-existing debt (11 legacy-iptables symbols etc.); shrinking it is the real fix.
  • docs/android-redroid-runbook.md — the full recipe: kernel build, per-instance kernel override (RSV2_SANDBOX_KERNEL, no fleet pin change), redroid boot + its empty-route-table fix, the per-VM MITM-CA keystore trap, per-userns binfmt registration, in-VM APK build, shield networking rules, and the rsv2 seed-data touch-ups.
  • docs/android/ — the in-VM build/binfmt scripts referenced by the runbook.
  • repro-kernel-config-drift.sh — standalone drift repro used to derive the known-drift list.

Deliberately NOT in this PR

  • No sandboxKernelVersion pin bump — instance 1 runs binder2 via env override; rolling the fleet is a separate decision (SELinux+AUDIT carry cost; soak on instance 1 first).
  • Nothing in the RealScoutV2-1 repo.

Next direction

Rosetta directory share (VZLinuxRosettaDirectoryShare) to replace qemu TCG for x86_64 binaries — near-native NDK builds, security-neutral (read-only share, translation runs in-guest), benefits every sandbox. Details in the artifact.

🤖 Generated with Claude Code

https://claude.ai/code/session_017JAyNw3W5vo3dwZJA8ZBgE

…redroid)

Adds the kernel features containerised Android needs (binder/binderfs,
SELinux permissive chain, cgroup v1 memcg/cpuset) plus BINFMT_MISC so
qemu-user can run Google's x86_64-only SDK tooling in the arm64 guest.

olddefconfig drops unknown/unmet options silently — two phantom symbols
(CONFIG_CGROUP_V1, CONFIG_SELINUX) were sitting in the configs doing
nothing. verify-config.sh now fails the Docker kernel build on new drift;
known-drift.txt carries the untriaged pre-existing drops.

docs/ carries the full Android-in-sandbox runbook and the in-VM build
scripts so the recipe survives outside gitignored scratch dirs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017JAyNw3W5vo3dwZJA8ZBgE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant