Hello guys, devlog here!I finally got the Linux sandbox in Zero-Assist working end-to-end! The sandbox runs Alpine Linux through PRoot directly on Android without requiring root.Getting it working was harder than expected, though. I ran into several Android-specific issues.Fixing the SandboxThe first problem was Alpine’s heavy use of BusyBox hardlinks. My TAR extractor used File.copyTo(), which didn’t preserve executable permissions, causing errors like:proot error: execve(“/bin/sh”): Permission denied
I fixed this by preserving executable bits:linkTarget.copyTo(outFile, overwrite = true)
if (linkTarget.canExecute()) {
outFile.setExecutable(true, false)
}
Some hardlinks were also extracted before BusyBox itself, so I added a second repair pass after extraction to restore critical commands like /bin/sh, /bin/ls, and /bin/cat.Symlinks were another problem because Android can block their creation. I added a fallback that copies the target when creating the actual symlink fails:try {
Files.createSymbolicLink(outFile.toPath(), Paths.get(linkName))
} catch (e: Exception) {
fallback.copyTo(outFile, overwrite = true)
}
I also had problems directly executing PRoot because some Android app directories can be noexec. The solution was to launch PRoot through Android’s system linker:val args = arrayOf(
“/system/bin/linker64”,
prootPath,
“–rootfs=$rootfsPath”,
“/bin/sh”, “-c”, command
)
I also added corrupted download detection and automatic Alpine mirror fallback, making the rootfs installation much more reliable.Giving the AI Linux ToolsAfter getting the sandbox stable, I added two AI tools:sandbox_execute — Executes commands inside Alpine and supports persistent shell state, working directories, environment variables, timeouts, and background processes.sandbox_manage_process — Lets the AI list, monitor, read logs from, and kill background processes.For example, the AI can execute:{
“command”: “python3 –version && uname -a”,
“working_dir”: “/root”
}
Or start a background server:{
“command”: “python3 -m http.server 8000”,
“background”: true
}
The execution pipeline now looks like:AI Agent
↓
Rust Tool Layer
↓
Authenticated Local HTTP Bridge
↓
Kotlin Sandbox Manager
↓
PRoot
↓
Alpine Linux
The Rust runtime communicates with the Kotlin sandbox through a localhost bridge on 127.0.0.1:49481, protected by a randomly generated per-process bearer token.And now the sandbox is fully functional end-to-end!The AI can execute real Linux commands, install packages, maintain persistent shell sessions, run scripts, start background processes, inspect their logs, and manage them — all inside Alpine Linux running directly on Android without root.This was one of the hardest parts of Zero-Assist so far, but now the AI finally has its own real Linux environment to work with.
Comments 2
did u do this for 12 hours non stop tht crazy 😭
yeah i mean there were lots and lots of issue here , also now after testing harder i find out that there are the more issues in the installation of the proot distro , after testing on multiple different types of devices theres a new issue(Rootfs integrity check failed — missing: [bin/sh, usr/bin/env]) ive litterly spent 4 hrs on this error , useed multiple ai etc (free tier as i dont have pro of any) this issue is still there , im just fed up of this issue now
Sign in to join the conversation.