Android is based on linux kernel, so in theory Android system is able to accomplish many tasks in Linux.

Install Termux

First we need a terminal emulator. Linux users may be familiar with this. It’s a programme to interact with kernel by command. Here Termux is recommended, the latest version is released at f-droid.

Install Arch Linux

1
pkg install proot-distro

All available linux-distro could be listed by command

1
proot-distro list

Here, we choose archlinux, because installing packages on Arch is easy, and most packages are up-to-date.

1
proot-distro install archlinux

Wait for the installing process to finish. Then we login to the system.

1
proot-distro login archlinux

Here, we have logged in archlinux as root. Then change source,

1
vim /etc/pacman.d/mirrorlist

add

Server = https://mirrors.sjtug.sjtu.edu.cn/archlinuxarm/$arch/$repo

on top of the file. Then update source and packages.

1
pacman -Syyu

Add a new user

1
useradd -g wheel -m cyliu

Set password for cyliu.

1
passwd cyliu

Install sudo and edit sudo file.

1
2
pacman -S sudo
visudo

Uncomment the following line

1
%wheel ALL=(ALL) ALL

The user cyliu is successfully added as administor.

Switch to user cyliu.

1
su cyliu

Then you can configure you terminal as you do in your server and add packages you need.

Install graphic user interface.

1
sudo pacman -S xorg xfce4 tigervnc

Set a password for vnc.

1
vncpasswd 

Next, start vnc.

1
vncserver :0

Now port 5900 is active. Then the GUI can be seen from a vnc viewer, e.g. realvnc. Connect to 127.0.0.1:5900, input the password you set for vnc, then it’s all done.

Don’t try KDE!!! KDE is modern and elegant though. Qt is not supported by Android proot, I don’t know the reason. Also, some programmes written in qt behave abnormally on xfce.

Then have fun!