Repository navigation
Releases
APatch Linux v0.6.0-rc.3 — ARM64 SMP UML trials
APatch Linux v0.6.0-rc.3 — ARM64 SMP UML trials
Manual prerelease. The stable APatch release and update feed are unchanged.
The module ID remains apatch_chroot, and the installed apatch-chroot alias
still works. No migration of the chroot store or ~/uml/ubuntu.ext4 is required.
What changed
- The optional ARM64 SMP kit is picked up in
~/uml-smp. It uses the matched
bionic kernel and stub and requires SECCOMP; no quiet one-CPU ptrace fallback.
The launcher defaults to two guest CPUs on a multi-CPU host. Use--cpus 1
for comparison or--kit "$HOME/uml"for the original runtime. uml boot --trialstarts normal Ubuntu on a temporary copy-on-write overlay.
The backing image is read-only and trial writes disappear when the launcher
exits. A normal boot without--trialstill persists changes.--read-onlyskips ext4 journal replay and is for recovery. Its default Bash
runs as PID 1; exiting it is not how to shut down a normal Ubuntu VM.
Downloads
| Asset | Use it for |
|---|---|
apatch-linux.zip |
Flashable APatch module with the RC3 CLI. No UML kernel or guest data is included. |
apatch-linux-uml-smp-arm64.zip |
Optional standalone Termux kit: the same RC3 CLI, matched ARM64 kernel and stub, build config, and hashes. No APatch flash needed for UML. |
SHA256SUMS |
Verify the two ZIP files before opening them. |
Start from the RC3 SMP guide.
The short version, after staging the optional kit in Termux home:
~/uml-smp/apatch-linux uml boot --trial --cpus 2Use trusted guest software only in UML SECCOMP mode. The kit does not include
an Ubuntu image, Alpine initramfs, or networking helpers. Keep the original
~/uml kit for rollback.
Verification
The bundled kernel/stub passed the ARM64 CI boot checks
at 1, 2 and 4 CPUs. In an isolated ARM64 test as a non-root UID, the RC3 Android
binary booted disposable Ubuntu 24.04.4 LTS with systemd and two CPUs. After
idle, work ran on both CPUs and systemctl poweroff stopped the guest. The
launcher removed the overlay, and the backing image's SHA-256 did not change.
Go tests, vet, and module layout checks passed. A flashed upgrade and a full
boot from the Termux app sandbox still need a device trial.
The kit's KERNEL-SOURCE.txt identifies the corresponding source and exact CI
build. RC3 names the APatch release; the guest kernel is 7.2.0-rc4-gd59c9ce45857.
See the changelog.
APatch Linux v0.6.0-rc.2 — Ubuntu-first preview
Manual testing prerelease for APatch on arm64 Android. This is not an automatic or stable update. The flashable module is apatch-linux.zip.
What’s new
- APatch Linux provides the existing chroot backend and an Ubuntu-first User-Mode Linux backend. The
apatch-chrootcommand remains an alias, and the module ID and chroot store are unchanged. apatch-linux uml bootfinds your existing~/uml/ubuntu.ext4and starts Ubuntu with its own ARM64 kernel and/sbin/init. It starts only when requested, not at Android startup.--networkis optional.- Your UML kit stays in place. No kernel, Alpine image, Ubuntu image, base archive, or personal helper scripts are bundled or installed. You do not need to re-create or migrate your existing Ubuntu chroot or UML guest.
Trying the preview
Download apatch-linux.zip and install it manually through APatch Manager if you want to test it. From a regular Termux shell, use apatch-linux uml status first. apatch-linux uml boot --read-only starts a recovery shell without guest disk writes. A normal boot opens the existing disk read-write. See the tagged UML guide for details.
What was verified
Go and Python tests passed (optional Xvfb test skipped), and the ZIP and Android arm64 binary were verified. The same binary booted a disposable Ubuntu 24.04.4 guest on Android as a non-root shell UID, ran systemd with cgroup v2, and shut down cleanly. The read-only recovery fixture was unchanged byte for byte. The original Ubuntu disk was not booted for testing. Installation and login in the normal Termux app domain, opt-in networking, and individual container engines were not tested for this preview.
SHA-256 (apatch-linux.zip): b9dc705d349f70f5013e11ef7d73d29b840bc37a12a2fce143da40c0df579403
v0.6.0-rc.1 — Native Go CLI preview
APatch Chroot v0.6.0-rc.1 — Native Go CLI preview
Prerelease for manual testing on rooted arm64 Android. GitHub's latest
stable release and APatch's stable update channel are not changing.
What's new
- A compiled
apatch-chrootcommand in Termux keeps the existing commands,
flags, and help. The broker and privileged backend still use Termux Python. login,run, anddesktopreport a dropped connection without a Python
traceback. The CLI restores the terminal; a normal guest exit returns the
guest's status. The broker skips stale relays and reports an unavailable core.portsreads the daemon's response, and flags after--go to the guest
unchanged. The update commands look for stable releases, including the final
v0.6.0once it is released.
Test status and installation
The Go client, local Unix socket and PTY tests, and the arm64 module ZIP were
verified before publication. Starting the new module and logging in from an
ordinary Termux shell on an Android device are not yet verified. The original
phone-specific reset cause is not confirmed.
For manual testing, download apatch-chroot.zip from this release and install
it through APatch Manager. Reboot when ready. From a regular Termux shell
(no su), check apatch-chroot --version, apatch-chroot ping,
apatch-chroot list, then apatch-chroot login ubuntu (or use your existing
container's name). Report any error rather than reinstalling the container.
The upgrade uses the existing module ID, rootfs location, and saved settings.
You do not need to reinstall, convert, or migrate your Ubuntu container. Do
not remove the container as part of installing or troubleshooting this build.
v0.5.6 — LXQt desktop
APatch Chroot v0.5.6 — LXQt desktop
Requires a rooted Android device with APatch and Termux. The LXQt feature is opt-in.
apatch-chroot desktopreuses Termux:X11 and optionally an existing Termux PulseAudio server. LXQt runs with private session and system D-Bus instances, a private/dev/shm, and no raw Android audio devices. The existingsystemctlshim is unchanged.- RAM preflight refuses startup below 768 MiB of Android
MemAvailableby default.--checkchecks prerequisites without opening the desktop. This is not a hard RAM cap and does not change Android’s low-memory killer. - Display and sound flags now keep their guest environment on direct
runandexeccommands. - Documentation: the docs homepage and LXQt guide are live.
In APatch, install the attached apatch-chroot.zip as a module and reboot. Then follow the LXQt guide to install or upgrade the guest launcher before using apatch-chroot desktop ubuntu --check. Use a non-root guest account when possible.
Verification: The LXQt panel and Openbox were smoke-tested on a separate authenticated Xvfb display. Installing this module and using live Termux:X11 or PulseAudio passthrough on Android have not been verified for this release.
v0.5.5 — first test run fixes
v0.5.5 — first test run fixes (versionCode 20)
- hermes-gateway unit: real paths — the gateway lives at
/root/.local/bin/hermes(pipx/user install), not the venv layout the
example assumed; PATH + WorkingDirectory fixed (verified live: the
supervisor's ENOENT told us exactly where) - fork() DeprecationWarning gone — the session child is forked BEFORE
the control-socket thread starts (single-threaded fork) systemctl daemon-reload— re-read unit files without restarting
the init (systemd parity)- 32/32 tests green
v0.5.4 — Modified systemd: journal + first service
v0.5.4 — Modified systemd: the journal + our first service
The systemd suite now lives in its own folder (systemd/) — component
map included: what's needed to "run systemd" vs what we ship (and what's
deliberately N/A on Android). Same MIT clean-room pattern.
Added
- journald.py / journalctl — the container journal, stateless:
- service stdout/stderr (
/var/log/apatch-chroot/<unit>.log) merged
with structured lifecycle events (journal.jsonl: started / exited /
stopped / restarted / failed, written by the init supervisor) journalctl -u UNIT [-f] [-n N|all] [-r] [-S "10 min ago"] [-U ...],
positional units,--list-boots,--no-pager/-o shortaccepted,
real binaries kept asjournalctl.real
- service stdout/stderr (
- RestartSec= — units now honor the delay (pending-restart queue in
the supervisor; the Hermes gateway unit uses RestartSec=10). systemd/examples/hermes-gateway.service— the first real service:
the Hermes Agent gateway as a proper unit (User/WorkingDirectory/
Environment/ExecStart/Restart=always/RestartSec=10, WantedBy=
multi-user.target). Push it into/etc/systemd/system/and it starts
on every--initboot.- Help page 2 —
apatch-chroot --help --page 2(session flags,
hardening escape hatches, the in-container systemd suite). Front page
hints at it. - Client VERSION fixed — was frozen at v0.4.0.8 since that release
(help banner + check-update now track the real version).
Changed
systemctl.py+loginctl.pymoveddaemon/→systemd/(the
Modified systemd suite). Paths updated in the daemon + tests.
Tests
- 9 new journald tests. 31/31 green (systemctl 11 + loginctl 11 +
journald 9), three consecutive runs.
v0.5.3 — loginctl
v0.5.3 — loginctl (same pattern as systemctl)
Added
loginctlreplacement (MIT, clean-room) —daemon/loginctl.py,
staged into the container as/usr/bin/loginctl(real binary kept as
loginctl.real):- filesystem session registry (
/run/apatch-chroot/sessions/*.json);
every login registers itself — plain logins inline,--initlogins
via the init supervisor — and dead-leader records are pruned
automatically (no cleanup handshake) - verbs: list-sessions / list-users / list-seats, show-session,
session-status, show-user, user-status, terminate-session,
terminate-user, kill-session, kill-user, enable-linger,
disable-linger - linger with real behavior:
enable-linger USER→ when the login
shell exits, background services keep running (sshd/webapp survive
logout); the next--initlogin adopts them via pidfiles;
apatch-chroot killstill stops everything. Default (no linger) is
unchanged: exit = stop services.
- filesystem session registry (
- Init supervisor (
systemctl.py init) now registers its login session
and honors linger on shutdown.
Tests
- 11 new tests (
test_loginctl.py): registry round-trip, auto-prune of
dead sessions, find/filter, linger round-trip, terminate (real
process), output formats, unknown-verb rc. 22/22 green total.
v0.5.2 — hotfixes + new README
v0.5.2 — hotfixes + new README
Fixed
- Test harnesses pointed at a stale deploy path (
/data/local/tmp/apatch-chroot/client/...); the daemon actually deploys to/data/apatch-chroot/. Fixed intest_mounts.py,test_client.py,test_alpine.py— the live harnesses run again. systemctl list-unitsfallback (init down): called the status reader twice per unit; now once. Same output, half the work.
Added
- New README: fortress hardening table, shared storage, networking +
ports, container DNS, the Python systemctl service manager, tests, honest release-status section.
Tests
test_systemctl: 11/11 green, three consecutive runs (fixed a thread-race flake in the control-socket test by waiting for the socket to be bound).
v0.5.1 — the init that never was
v0.5.1 — the init that never was
Fixed: --init never actually worked in any release. stage_init() was
called AFTER os.chroot(), where the daemon's own scripts are invisible —
so the init supervisor and the systemctl shim were never staged, the login
silently degraded to a plain exec, and the guest's real systemd systemctl
answered "Running in chroot, ignoring command". (The v0.5.0 hardening made
this visible; it was not the cause.)
Added
- Own Python systemctl replacement (MIT, clean-room) —
daemon/systemctl.py, staged as the guest'ssystemctland init:- init/supervisor mode: parses systemd-style unit files
(/etc/systemd/system/*.service), starts enabled units in dependency
order (After/Wants/Requires, cycle-safe), reaps zombies, handles
SIGTERM (stops services in reverse order), supports
Type=simple/forking/oneshot, User=, Environment/EnvironmentFile,
WorkingDirectory, Restart=no/on-failure/always (bounded). - command mode:
systemctl list-units / start / stop / restart / status / is-activeover a chroot-local unix socket;enable / disablecreate
realmulti-user.target.wantssymlinks (like systemd) and work even
with the init down; status-style verbs degrade to pidfile/proc reads
when no init is running — never a chroot-refusal again. - logs in
/var/log/apatch-chroot/<unit>.log, pidfiles in
/run/apatch-chroot/<unit>.pid(same conventions as before).
- init/supervisor mode: parses systemd-style unit files
- Staging now prefers the Python path when the guest has
python3;
the POSIX sh supervisor + shim remain as the no-python fallback
(apatch-init.sh,apatch-systemctl-sh).
Fixed
stage_initcalled beforeos.chroot()in both entry paths
(login/run and exec) — the shim + init finally get installed.
Tests
- 11 new stdlib-unittest tests (
test_systemctl.py): unit parsing,
Environment/EnvironmentFile, dependency order + cycle handling,
enable/disable symlink round-trip, degraded status, live process
start/stop/restart, control-socket round trip — 11/11 green.
v0.5.0 — fortress + doors
v0.5.0 — fortress + doors
The containment overhaul plus the quality-of-life doors users asked for.
Upgrading is safe: existing containers keep working, no layout changes.
Added
--shared-storage— Android shared storage inside the container at
/mnt/sdcard(with a/sdcardsymlink). Prefers the raw backing store
/data/media/0(no FUSE recursion, stable ownership) and falls back to
/storage/emulated/0. Files the guest writes show up for Android apps.apatch-chroot ports— prints the phone's LAN IP and every listening
TCP port. The container shares the kernel network namespace with Android,
so a webapp binding0.0.0.0:<port>inside the chroot is reachable from
the LAN with zero port forwarding (e.g. Hermes' webapp).- Container-owned DNS —
/etc/resolv.confis now a managed file:
Google (8.8.8.8, 8.8.4.4) + Cloudflare (1.1.1.1, 1.0.0.1), rewritten on
every login. Your own config (no marker, working nameservers) is respected. --no-harden/--keep-sysadmin— escape hatches for the new
containment (see below).--keep-sysadminre-adds CAP_SYS_ADMIN for
FUSE/AppImage users at the cost of mount containment.
Changed — containment hardening (default ON)
The whole point: what happens inside the chroot cannot break the host
Android system. All namespace-scoped, host mount table untouched:
-
/proc
subset=pid(hidepid=2 fallback) — the guest, even as root,
sees only its own process tree. Host processes are invisible. -
/sys mounted READ-ONLY — no sysfs writes from inside (no driver
unbinds, no kernel knobs). -
/dev/block + /dev/socket masked — no block devices reachable (no
dd-to-mmcblk0 bricking) and no Android control sockets (the
property_service socket would let root set HOST system properties). -
Capability bounding-set drops (one-way, inherited by every
descendant, setuid/setcap can't regain): SYS_MODULE, SYS_RAWIO,
SYS_PTRACE, SYS_ADMIN*, NET_ADMIN, SYS_BOOT, SYS_TIME, SYS_TTY_CONFIG,
MKNOD, SYSLOG, AUDIT_CONTROL, MAC_*, BPF, PERFMON and friends. The guest
root can no longer load host kernel modules, reconfigure HOST networking
(shared netns!), change the host clock, reboot the host, or create device
nodes that bypass the masks.
*--keep-sysadmin re-adds SYS_ADMIN only. -
Broker: clean SIGTERM shutdown that unlinks stale sockets (no more
EADDRINUSE after an abrupt Android shutdown); watchdog/kill reap
orphaned session pids so a recycled pid is never signalled.
Notes
- Hardened guests lose: FUSE/AppImage mounts and host-network
reconfiguration (by design). Use--keep-sysadmin/--no-harden
when you truly need them. - VPN caveat: container traffic follows the host routing table and bypasses
per-app VPN routing (root UID is not in any VPN app list). Documented;
policy-routing integration is future work. - 11 crypto/container tests + live login verified on-device.