This is significantly easier than I expected. Going pack to the zeroth post in this series, I am shocked at how far the community has pushed Android OS to become a desktop replacement OS.
Some of this work was undertaken by corporations. This is most clearly shown by Samsung Dex, a desktop skin of Android that is installed on most of Samsung's latest devices. It is still Android under the hood, and it isn't perfect either, but it provides a basic, Chromebook-Esque interface to Android. This software package is partly the reason why I chose the Samsung Galaxy S7 Tab as well.
The two apps to start developing in a Linux container on Android OS are:
To be honest, you don't need AndroidNix to get this working, but it certainly helps.
Termux is a free and open-source terminal emulator for Android OS. More importantly, it comes bundled with many of the GNU Core Utils and a package manager that wraps around
apt. This allows for the downloading and installation of software that has been specifically compiled to run on Android and AARCH x64 devices from the shell.
The major downside with Termux is that most software has to be ported to run on Android. Some software packages run completely fine on Android without any porting process, however, most programming languages do. Luckily, the community that supports Termux is constantly filing issue requests on GitHub to add new software and implement ports of the software into the Termux repositories.
But for what we are doing, we won't be relying on Termux's package management solution that much. Rather, we will be using AndroidNix.
- Download and install F-Droid on your Android device.
- Within the F-Droid app, search for
- Download and install Termux via the F-Droid app.
The F-Droid app is necessary as the Google Play version of Termux is out of date.
If you are uncomfortable with installing a 3rd party app store on your device, you can read more about how to install Termux here.
AndroidNix is a collection of scripts that allow for the creation of a Linux container inside of a
[proot](https://proot-me.github.io/), a userspace implementation of
[chroot](https://en.wikipedia.org/wiki/Chroot). They also have a GitHub page where you can examine the scripts that they run. But to make life a lot simpler for us, we will be using their Android app which offers a user-intuitive way to select a distro and (if you want) a desktop environment or window manager.
This app simply copies the command necessary to install the
proot to your device's clipboard and then you have to run that in Termux.
- Open the Google Play Store app on your Android device.
- Within the Google Play Store app, search for
- Download and install AndroidNix via the Google Play Store app.
I am working on a GitHub repository to set up a Termux Linux container exactly as I want it. You are more than welcome to use my
[install.bash](https://github.com/NicholasSynovic/termux-linux-container/blob/main/install.bash) script to install Ubuntu 20.04 with the XFCE desktop environment.
- Download it from GitHub
- In Termux, execute
chmod +x install.bash
- In Termux, execute
This install script only installs the Linux distribution. It doesn't change any system settings or install any non-default software.
This install script is not automated and does require user input in its current form.
- Open AndroidNix, select your OS, desktop environment, or window manager (if desired), and then click the "Open Termux" button.
- Paste the command in your clipboard and then press your
Enterkey to execute the command.
- Follow the onscreen prompts to complete the installation.
- (Optional) After installing, run
yes | unminimizeto install any remaining software not explicitly set up or installed during the normal installation.
- Download the VNC Viewer app from Google Play Store.
- Create a new connection to
PORTis the port number you specified in your setup.
- Connect to the desktop environment.
If your desktop environment is laggy or slow, try changing the connection quality to
High in VNC Viewer.
- To stop a vnc server:
- To start a vnc server:
In the Linux container:
Congrats! You have created a Linux container on top of Android OS. You and I are on our way to getting rid of our hefty laptops once and for all and doing all of our work truly from the palms of our hands. Assuming you have a big enough hand to palm an Android tablet that is.
But this was the easy part. Currently, we still have to deal with:
- No installed IDE or text editor
- No installed programming languages
- No installed desktop software
And, most scary of all:
- Everything runs as the root user
All of this and more will be covered in later tutorials.
Nicholas M. Synovic