In this article I will tell you how to install proot Debian manually. This tutorial might also works for proot Ubuntu.
Step by step, I will install proot Debian from minimum rootfs provided by Temux maintainers and setup a XFCE desktop with audio. Root permission is not required. After setting up the system, I will tell you how to start dekstop environment in on-click, without typing commands in terminal.
The reason that I choose Debian over Ubuntu is Snaps. On Ubuntu 20.04 or higher, more and more packages will be redirected to install snap packages when running apt install
commands, while snapd does not work on Termux proot. I would use a snap-free distro rather than disabling snapd on Ubuntu.
Note: If you don’t want to install everything step by step, use automated scripts made by Termux community instead.
1. Prerequisites
RAM > 6GB
Storage > 10GB
Install Termux from F-Droid.
Then setup Termux X11.
Setup virglrenderer
2. Download Debian rootfs
- Install proot-distro and pulseaudio
|
|
- Edit
.profile
with VIM:
|
|
- Download Debian rootfs using proot-distro
|
|
- Log into Debian proot.
--user
will make you directly login to the specific user (only root available in the fresh installation).--shared-tmp
will mount Termux’stmp
directory in proot.
|
|
- Install sudo, vim, Firefox in proot
|
|
3. Change Debian mirrors
(Optional) This would make APT downlaoading faster.
Find mirrors on Debian mirrors
- Edit sources.list
|
|
- Replace each line with new links(note currently the codename is
bookworm
):
|
|
- Refresh packages list
|
|
4. Add a normal user
It is recommended to create a normal user for your security. Don’t do everything in root.
- Change root password
|
|
- Add group “wheel” and “video”
|
|
- Add new normal user named “user” and change his password
|
|
- We need to add normal users to sudoers. Type
visudo
then find something likeroot ALL=(ALL:ALL) ALL
. Add this in the next line of it.
|
|
- Switch to normal user
|
|
5. Install desktop environment
XFCE4 is a lightweight desktop environment.
Install XFCE4 desktop environment. Type “0” when apt asking for the keyboard layout.
|
|
6. Setup locales
- Setup timezone. For example, Asia/Taipei.
|
|
- Install locales
|
|
- Edit /etc/locale.gen with vim:
vim /etc/locale.gen
. Uncomment (remove “#”) your langauge. For example en_US.UTF-8
|
|
- Generating locales and set the language of system.
|
|
7. Start desktop environment (manually)
Relaunch Termux
Launch Termux X11 app, keep it opening in the background. Go back to Termux and type the following commands to run Termux X11.
|
|
- Log into Debian as
user
.
|
|
- Start desktop environment
|
|
- You shall see XFCE4 desktop showing at Termux X11. Tap flaoting window and revoke permission to make it go full screen.
8. Start desktop environment in one-click
We can use Termux Widget to start everything automatically. Thanks to Korean developers from clien.net!
Install Termux API and Termux Widget
Go to system settings → all apps, turn on “Permit Drawing Over Other Apps” for Termux.
Restart Termux. Create a shortcut in Termux (not in proot-distro)
|
|
- Type these
|
|
- Make it executable.
|
|
Go to your home screen, long press and add widgets → select “Termux Widget”. You would see the shortcut we made is on the list.
Click “startproot_debian.sh” then the XFCE desktop would opened automatically.
Swipe down the notification bar, click
Preferences
of Termux X11. Then you can switch touch screen mode to simulating touchpad.To use soft keyboard of phone in Termux X11, swipe the bar at the bottom and you will see a field for inputing texts.
If the fonts are too small in Termux X11, click Settings Manager at top-left → Appearance and change font size or select 2x window scaling.
To stop the XFCE session, press CTRL+C in Termux. Then logout of proot Debian.
|
|