Skip to content

A sandboxed, 2nd termux, isolated or jailed termux environment with proot

License

Notifications You must be signed in to change notification settings

yazdandeli/termux-proot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Running a sandboxed Termux environment

termux-proot

A sandboxed, 2nd termux, isolated or jailed termux environment with proot

Test something out in sandboxed environment with 0% Afraid of getting bricked in your real termux. Human is curious, Ain't we?

Also support on non-Android distro, Including Debian, Alpine, and etc.

Setup & Installation

Before installing, We need these 3 packages to be installed in your Termux:

  • curl for fetching & downloading latest termux bootstrap.
  • unzip for unzipping Termux Bootstrap.
  • proot for start sandboxed environment.

These required packages should be installed in your host/system.

And finally, set up sandboxed environment:

curl -sLO git.io/termux-proot.sh
chmod +x termux-proot.sh

# Will setup by itself & start sandboxed environment
./termux-proot.sh

Uninstalling

Uninstalling termux-proot is literally, very easy.

rm termux-proot.sh

# The command below can use for reinstalling.
proot -0 rm -rf ~/.termux-fs

# The command below can use for reinstalling/Updating Android base system.
proot -0 rm -rf ~/.android-base

Environment Variables

termux-proot also has it's own environment variables and it's changeable. They are:

  • TERMUX_SANDBOX_PATH - Path to where Termux sandbox folder located. Default is $HOME/.termux-fs
  • TERMUX_SANDBOX_APPPATH - A variable that used to simulate Termux app path. Default is /data/data/com.termux
  • TERMUX_SANDBOX_ENV - A variable that used to reveal a environment variable to guest. Can used like TERMUX_SANDBOX_ENV="FOO=BAR BAR=FOO" ./termux-proot.sh
  • TERMUX_SANDBOX_PROOT_OPTIONS - A variable that used to add some proot arguments. Can used like TERMUX_SANDBOX_PROOT_OPTIONS="-b /sdcard" ./termux-proot.sh
  • TERMUX_ANDROID_BASE - Path to Android base system. Default is $HOME/.android-base

Advantages

  • Sandboxed /system
  • More secured

Disadvantages

  • DNS is static. Should using static resolver that located at /etc/hosts or /system/etc/hosts. You may need to echo unresolved-domain.com >> /system/etc/static-dns-hosts.txt and run /system/bin/update-static-dns to get your unresolved-domain.com work.
  • Some certain thing is not available (like OpenSLES, dalvikvm, and etc).
  • ARM variant may require a custom seccomp profile to remove restrictions from personality() system call. Whereas Docker Hub contains prebuilt ARM image, it is outdated and won't receive updates anymore.

Community

About

A sandboxed, 2nd termux, isolated or jailed termux environment with proot

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%