easyIDE / Blog / How easyIDE runs Ubuntu on Android without root (PRoot explained)
How easyIDE runs Ubuntu on Android without root (PRoot explained)
easyIDE's terminal is a real Ubuntu 24.04 shell with apt, and the phone or tablet is not rooted. Here is how, and what the trade-offs are.
The pieces
- An Ubuntu base image is downloaded once and unpacked into the app's private storage (with a guard against archive paths escaping it).
- PRoot runs every guest process. It intercepts system calls with
ptraceand rewrites file paths, so/usr/bin/python3inside the guest maps to a file inside the app. No kernel changes and no root. - The terminal is a real pseudo-terminal, so full-screen programs, colors and Ctrl-C behave normally.
Why it is allowed on modern Android
Android blocks executing files from an app's writable storage under SELinux. easyIDE ships PRoot as a native library in the APK, which Android does allow to run, and PRoot loads the guest's programs itself.
Details that make apt work
- Android denies hard links in app storage; dpkg uses them for backups, so PRoot emulates them as symlinks (
--link2symlink). - The guest starts with a cleared environment, so the Android app's variables never leak into Linux.
sudois a small shim: you are already root inside the guest, and real setuid binaries cannot work under PRoot.
Projects live outside Linux
Your code is stored outside every Ubuntu tree and bound in at /projects/<name>. You can delete or reinstall an environment without losing a project, and several projects can share one environment.
Trade-offs
- Speed: system-call-heavy work (big
npm installs, compiling) is slower than native Linux because each call is intercepted. Editing and most running code is not noticeably affected. - Not a security boundary: PRoot gives you a working userland; it does not isolate projects from each other or contain hostile code. Run code you trust.
- No systemd or kernel modules: services run as ordinary processes.
Rooted device? An opt-in chroot backend exists in the code but has not been run on hardware yet.