[LINUX] I want to use the Ubuntu desktop environment on Android for the time being (Termux version)


This section describes how to build the minimum desktop environment for using Android Studio published earlier. There is no Japanese input, but I think it can be built in the shortest time instead.

→ Described the setting procedure for Japanese input in the desktop environment. I want to use the Ubuntu desktop environment on Android for the time being (Termux version-Japanese input in the desktop environment)

important point

Installing a desktop environment (LXDE or Xfce) can take several hours. I think it is better to secure time before implementing.


Install Termux and XSDL on the Play Store. Termux is an environment in which a type of OS called Linux runs. Since Android is also an OS, it is a bit complicated environment where the OS runs on the OS. XSDL is the application responsible for the desktop screen. Termux only supports up to the command line, so get XSDL to support your desktop screen.

Termux settings

Start Termux and update the package (like a warehouse of Linux applications) with the following command:

#Package update
pkg upgrade

pkg is a wrapper for the apt command. The apt command refers to a program for manipulating packages. Termux basically uses pkg to install the application.

Then run termux-setup-storage to allow files to be exchanged between Termux and Android.

#Make files handled by Android available from Termux

A dialog will appear asking if Termux can access it, so select OK.

Describes the correspondence between Termux and Android directories. Please refer to the delivery of files.

Termux Android
/data/data/com.termux/files/home/storage/shared/ (Main body side)/sdcard/
/data/data/com.termux/files/home/storage/downloads/ (Main body side)/sdcard/Download/
/data/data/com.termux/files/home/storage/external-1/ (SD Card side)/storage/(SD Card name)/Android/data/com.termux/files/
/storage/(SD Card name)/ (SD Card side)/storage/(SD Card name)/

Ubuntu installation

Next, build the Ubuntu environment on Termux. Ubuntu is also a type of OS. It is a form of building Linux called Ubuntu on top of Linux called Termux, and putting Linux on top of Linux. It's not the official website, but it does show you how to install Ubuntu. This time I will use this method. At the following site, execute the command in the place where Installation steps are written.


Describes the correspondence between Ubuntu and Android directories. Please refer to the delivery of files.

Ubuntu Android
/sdcard/ (Main body side)/sdcard/
/storage/(SD Card name)/ (SD Card side)/storage/(SD Card name)/

The official website below describes how to install Ubuntu, but I didn't know how to share files with Android such as SD Card, so I won't use it this time.


Booting Ubuntu

As described in 10.Now just start ubuntu: in Installation steps of the above site, the command to start Ubuntu from Termux is described.

cd ubuntu-in-termu

Install Ubuntu desktop environment

From here, it will be the operation on Ubuntu.

First, update the package with apt.

apt update
apt upgrade -y

Next, install the desktop environment. As far as I checked, I can use two types, LXDE and Xfce. It seems that LXDE is lighter, but Xfce looks better and is not as light as LXDE, but it is light enough. I think you can choose here as you like.

It will take several hours here, depending on the speed of the network and smartphone. The settings described below will appear in the middle (although a little later) rather than at the beginning or end. The recommended method is to start the installation, leave it for a few hours, configure it, and then leave it for a few hours again.

· LXDE installation

apt install -y lxde
#Since there is a question about the area on the way, select it by operating 6 → Enter → 79 → Enter. The meaning of the numbers is 6:Asis、79:It will be Tokyo.
#Next, I have a keyboard question, but select it by operating 31 → Enter → 1 → Enter. The meaning of the numbers is 31:America(US)、1:Engrish(US)Will be. If you like software keyboards, this is Hacker'Since I use the s Keyboard, I think this choice is correct.
#You will be asked to choose the desktop managers gdm3 and lightgdm, but if you are not particular about it, you should choose the light lightgdm.

・ Installation of XFCE

apt install -y xfce4

Environment settings

Launch XSDL and wait for a while. At the end, a screen displaying a character string will appear, so make a note of the following.

The following string should appear on the second line from the top. Make a note of the DISPLAY port number.

export DISPLAY = (some IP address): (port number)

The following string should appear on the third line from the top. Make a note of the PULSE_SERVER port number as well.

export PULSE_SERVER = (IP address of something): (port number)

You don't have to write down the IP address. Go back to Ubuntu on Termux again. In order to connect to XSDL, write down the port number and local IP address you wrote down earlier in the configuration file.

#If you don't have the text editor vim installed, install it
apt install -y vim

# .Describe the XDSL connection settings in bashrc
vim .bashrc

Also at the bottom of .bashrc, write the following:

export DISPLAY =: (the DISPLAY port number you noted earlier) export PULSE_SERVER = (PULSE_SERVER port number you noted earlier)

If you don't know how to use vim, just remember the following.

Keyboard keys role
i Enter input mode from command mode
ESC Exit input mode and return to command mode
:wq Save and exit. Operate in command mode.

Only this time, manually execute the settings described earlier. From the next time, it will be executed automatically, so the following operations will not be necessary.

source .bashrc

Launch desktop environment

First, launch XSDL. Wait until the screen where the port number etc. appears. Then go back to Termux and run the following command on Ubuntu.

・ For LXDE


・ For Xfce


Go back to XSDL and wait for a while and you should see the Ubuntu desktop environment up and running.

UserLAnd, which launches the desktop environment with the touch of a button, is easier around here.

Reference site

Linux environment UserLAnd running on Android supports XServer XSDL

Recommended military art for Termux while commuting

Install Ubuntu on Android tablet

Recommended Posts

I want to use the Ubuntu desktop environment on Android for the time being (Termux version)
I want to use Ubuntu's desktop environment on Android for the time being (UserLAnd version)
I want to use Ubuntu's desktop environment on Android for the time being (Termux version-Japanese input in desktop environment)
For the time being using FastAPI, I want to display how to use API like that on swagger
I want to move selenium for the time being [for mac]
I want to create a Dockerfile for the time being.
For the time being, I want to convert files with ffmpeg !!
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
I tried running PIFuHD on Windows for the time being
I want to develop Android apps on Android
I want to separate the processing between test time and production environment
[Hi Py (Part 1)] I want to make something for the time being, so first set a goal.
How to use MkDocs for the first time
Use logger with Python for the time being
Run yolov4 "for the time being" on windows
Use the latest version of PyCharm on Ubuntu
I played with Floydhub for the time being
I want to use the activation function Mish
I tried Python on Mac for the first time.
Flow memo to move LOCUST for the time being
Molecular dynamics simulation to try for the time being
I tried python on heroku for the first time
I will install Arch Linux for the time being.
Next to Excel, for the time being, jupyter notebook
What I did to ssh to the VPS Ubuntu environment
I want to restart CentOS 8 on time every day.
I want to use the R dataset in python
I will try to summarize the links that seem to be useful for the time being
I don't know what HEIC is. But for the time being, let's use PNG!
I want to create a lunch database [EP1] Django study for the first time
I raised the Python version from 2 to 3, but every time I restart the ubuntu terminal, the version remains 2.
I want to use Mac / emacs key bindings (keyboard shortcuts) on Ubuntu xkeysnail recommendations
[TensorFlow] I want to master the indexing for Ragged Tensor
I want to use the latest gcc without sudo privileges! !!
I want to use only the normalization process of SudachiPy
[For those who want to use TPU] I tried using the Tensorflow Object Detection API 2
I want to absorb the difference between the for statement on the Python + numpy matrix and the Julia for statement
I don't tweet, but I want to use tweepy: just display the search results on the console
I want to use a virtual environment with jupyter notebook!
I didn't know how to use the [python] for statement
"Stop committing Japanese files to git on Mac> <" For the time being, I wrote a script to search for incompatible Japanese files on Mac and Linux.
[Introduction to Reinforcement Learning] Reinforcement learning to try moving for the time being
I made a function to check if the webhook is received in Lambda for the time being
I want to get the name of the function / method being executed
I want to record the execution time and keep a log.
Java programmer tried to touch Go language (for the time being)
I want to read the html version of "OpenCV-Python Tutorials" OpenCV 3.1 version
LINEbot development, I want to check the operation in the local environment
I tried to display the video playback time (OpenCV: Python version)
Use Docker Desktop for Windows to start the latest odo with 2 commands
[Note] I want to completely preprocess the data of the Titanic issue-Age version-
Tips for manipulating numpy.ndarray from c ++ -I want to use an iterator-
I want to use the Django Debug Toolbar in my Ajax application
I was addicted to not being able to use Markdown on pypi's long_description
I want to use the Qore SDK to predict the success of NBA players
For the first time in Numpy, I will update it from time to time
Add words to MeCab's user dictionary on Ubuntu for use in Python
Python: I want to measure the processing time of a function neatly
I want to pin Spyder to the taskbar
I want to output to the console coolly
I tried tensorflow for the first time