What the flip is UML?

UML stands for User-Mode Linux. It’s a Linux kernel that runs like a program. Here, you start it from regular Termux and it boots Ubuntu with its own kernel and init. Android keeps running the phone the whole time.[1][2]

Did my Android kernel get replaced?

Nope. We didn’t touch your damn Android kernel. linux-bionic is the guest kernel that Ubuntu boots. The standalone Termux kit doesn’t flash a boot image or require an Android reboot.[1][2]

Want to see the difference? Run uname -r in regular Termux to see Android’s kernel version. Run it inside the booted Ubuntu guest to see the UML kernel version.

Why does APatch say RC3 but Ubuntu says RC4?

v0.6.0-rc.3 is the APatch Linux release. 7.2.0-rc4-gd59c9ce45857 is the Linux build in its optional UML kit. Different projects, different version numbers. The new kernel supports SMP (symmetric multiprocessing), so Ubuntu can schedule work on more than one guest CPU.[2]

Is this the same Ubuntu as my APatch chroot?

No. A chroot shares Android’s kernel and uses the APatch daemon. UML runs its own kernel without that daemon. A chroot named ubuntu and the UML file ~/uml/ubuntu.ext4 are separate installs. Packages you install in one won’t show up in the other.

Can I try it without messing up my Ubuntu disk?

Yes. Keep ~/uml and put the new kernel and matching stub in ~/uml-smp. The SMP setup guide shows how to install the standalone kit without an APatch flash. It doesn’t come with an Ubuntu image; you need the one you already have, or another existing ARM64 Ubuntu ext4 image.[2]

After setup, close any other UML session using that disk. In regular Termux:

~/uml-smp/apatch-linux uml status
~/uml-smp/apatch-linux uml boot --trial --cpus 2

--trial boots Ubuntu normally but sends writes to a temporary overlay. Your original disk stays read-only, and trial changes aren’t saved. A plain uml boot opens the disk read-write. To try the old kernel again, add --kit "$HOME/uml" and leave off --cpus; the disk stays in the same place.[2]

Why the hell did it panic when Bash quit?

If the trace says PID: 1 Comm: bash and Attempted to kill init!, Bash wasn’t just your login shell. It was the guest’s init. Linux can’t keep that guest running after PID 1 exits. A zero exit code means Bash exited normally; it doesn’t point to an idle-thread crash or an Android kernel panic.

With --trial, Ubuntu’s normal init stays running when you log out. To stop the guest, run sudo poweroff inside Ubuntu, not in Termux.

Sources

[1] https://docs.kernel.org/virt/uml/user_mode_linux_howto_v2.html — Linux kernel: User-Mode Linux HowTo [2] https://github.com/Developer-lfierro743/apatch-chroot/releases/tag/v0.6.0-rc.3 — APatch Linux v0.6.0-rc.3 release notes


APatch Chroot — MIT licensed. Runs a root daemon; read safety first.

This site uses Just the Docs, a documentation theme for Jekyll.