📱🐧 How to Install RLC (RootLess Chroot) in Termux: A Guide to Running Linux Distros on Android
Introduction:
RLChroot (RLC) offers an innovative solution for installing Linux distributions on Android devices without the need for rooting. It provides an LXC-like interface inspired by Udocker, making it easier to manage and run Linux environments on your Android device. In this guide, we'll walk you through the installation process and show you how to set up your first container.
Supported Distros:
RLC currently supports a subset of Debian-based distros, including Ubuntu, Debian, and Kali. Each of these distributions has specific releases that are compatible with RLC. Although there are plans to add more distros, newer additions may have some bugs, and users are encouraged to report any issues they encounter.
Requirements:
Unlike complex solutions like LXC/LXD, RLChroot utilizes proot for chrooting. As a result, it does not require Cgroups, VETH, seccomp, or any PAM modules. However, it's essential to note that RLChroot relies on host resources, which may impose limitations.
Installation:
To install RLChroot on your Android device, follow these steps:
- Visit the GitHub repository: https://github.com/WMCB-Tech/rlchroot.git
- Download the Debian package file from the repository.
- Install RLChroot using either the dpkg or apt package manager. If you encounter any dependency errors during installation with dpkg, resolve them by running apt install -f.
RLC Commands:
RLChroot provides a range of commands for managing containers. As the project evolves, additional commands may be added. Currently, the following commands are available:
- rlc-create: Used for creating containers.
- rlc-destroy: Allows you to delete containers.
- rlc-ls: Lists all installed containers.
- rlc-launch: Starts a specific container.
- rlc-import: Imports containers from external sources.
- rlc-export: Exports containers for sharing or backup purposes.
Future commands under development include rlc-snapshot, rlc-freeze, rlc-unfreeze, rlc-download, and rlc-info. Contributions in the form of pull requests are welcome to help implement these commands.
Setting up your first container:
Let's walk through the process of setting up an Ubuntu 18.04 container as an example:
- To create an Ubuntu 18.04 container, use the command: rlc-create bionic mycontainer. Replace mycontainer with the desired name for your container.
- For a Kali container, use the command: rlc-create kali my-kali-container.
Once the container is created, you can start it using the command: rlc-launch mycontainer. Alternatively, you can run a specific command within the container using rlc-launch mycontainer mycommand.
To see a list of installed containers, execute: rlc-ls.
Running the Container as Non-Rooted:
RLC is configured to run containers with sudo access, making them non-rooted. To launch a container as a non-root user, use the command: rlc-launch mycontainer su - user. This allows you to execute commands as a regular user.
If you want to run commands as a user, use: rlc-launch mycontainer sudo -i -u user mycommand.
Adding a User Account:
You can add user accounts to your container using either the useradd or adduser commands.
Destroying the Container:
When you no longer need a container or if it is broken, you can delete it using: rlc-destroy mycontainer. The command will prompt you to confirm the deletion.
Limitations:
It's important to be aware of some limitations imposed by RLChroot:
- RLChroot relies on proot, which can only emulate chroot. As a result, low-level administrative tasks such as creating chroots, mounting images, creating device nodes, or accessing devices are not possible due to Android security features.
- Some features are currently lacking, including full namespaces (only minimal namespaces are supported), Virtio Interface, full cgroups support, and seccomp support.
With RLChroot, you can enjoy running Linux distros on your Android device without the need for root access, providing a convenient and safe way to experiment with various Linux environments. Although there are some limitations, RLChroot offers an impressive range of capabilities for Linux enthusiasts on Android.