Terminology
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
Terminology in the Termux-Desktops project encompasses the various environments, libraries, graphics APIs, and hardware drivers required to run a full Linux Desktop environment on Android. Understanding these terms is critical for navigating the differences between native execution, user-space containers, and hardware-accelerated rendering.
This guide provides a technical overview of the components that allow Termux to bridge the gap between Android's Bionic-based system and standard Linux Glibc-based applications. It specifically covers the interaction between the Android kernel, specialized graphics drivers like Turnip and Zink, and various desktop environments such as XFCE4, GNOME, and KDE Plasma.
Sources: Documentation/terminology.md:1-5, README.md:32-60
Linux Environments
The project categorizes Linux execution on Android into three primary methodologies, each offering different levels of isolation and performance.
Environment Types
- Native Termux: Running Linux commands and packages directly within the Termux app without additional virtualization or containerization. It uses Android's native libraries.
- PRoot: A user-space implementation of
chrootthat intercepts system calls to simulate a different root directory. It does not require root access. - Chroot: A directory "jail" that changes the apparent root directory for the current process. It accesses host resources via bind mounting and requires administrative (root) privileges.
Sources: Documentation/terminology.md:7-17, README.md:32-60
Environment Comparison
| Feature | Proot | Native | Chroot |
|---|---|---|---|
| Needs Root? | No | No | Yes |
| App Compatibility | High (Linux Apps) | Limited (Termux Repo) | High (Linux Apps) |
| Performance | Moderate | Good | Good |
| Mechanism | Syscall Interception | Direct Execution | Namespace Isolation |
Sources: README.md:65-75
Libraries and System Architecture
A fundamental challenge in Termux-Desktops is the incompatibility between standard Linux binaries and the Android system.
- Glibc (GNU C Library): The standard C library used by most Linux distributions. PRoot and Chroot environments utilize Glibc.
- Bionic: Google's custom C library designed for Android. Binaries built for standard Linux (Glibc) cannot run on Bionic without recompilation or a compatibility layer.
- glibc-runner (grun): A tool that allows running Glibc packages within native Termux without patching for Bionic.
Sources: Documentation/terminology.md:21-33
The following diagram illustrates the relationship between the Android Kernel and the different execution environments:
Graphics and Rendering
Hardware acceleration is achieved through a stack of translation layers and drivers that bridge mobile GPUs to desktop OpenGL standards.
Graphic APIs
- OpenGL: High-level API for 2D/3D graphics, primarily used on desktops.
- OpenGL ES: A subset of OpenGL designed for mobile and embedded devices.
- Vulkan: A low-level, high-efficiency API providing explicit GPU control.
- DirectX/Direct3D: Microsoft's proprietary graphics suite; utilized in this project via translation layers for Windows application compatibility.
Sources: Documentation/terminology.md:37-47
GPU Drivers and Translation Layers
The project utilizes specific drivers to enable hardware acceleration, particularly for Qualcomm Adreno and ARM Mali GPUs.
- Zink: A Gallium driver that allows OpenGL applications to run on top of Vulkan drivers.
- Freedreno: An open-source OpenGL driver for Adreno GPUs.
- Turnip: An open-source Vulkan driver for Adreno GPUs (part of the Freedreno project).
- VirGL: A virtual OpenGL renderer that allows guest environments to use host GPU capabilities, generally offering lower performance than Zink+Turnip.
- GL4ES: A wrapper that translates desktop OpenGL calls into OpenGL ES calls.
Sources: Documentation/terminology.md:53-110, Documentation/HardwareAcceleration.md:12-25
Driver Hierarchy for Adreno GPUs
The combination of Zink and Turnip currently provides the most efficient hardware acceleration for compatible Adreno devices.
Windows Compatibility Layers
To run Windows software on Android, the project leverages a combination of CPU emulation and API translation.
- Wine: A compatibility layer that enables Windows applications to run on Linux by translating Windows API calls.
- Box86 / Box64: Emulators that allow x86 and x86_64 Linux binaries to run on ARM/ARM64 architectures.
- WineD3D: Translates Direct3D calls to OpenGL.
- DXVK: Translates Direct3D calls to Vulkan for better performance.
- Mobox: A specialized configuration combining these tools for optimized Windows execution within Termux.
Sources: Documentation/terminology.md:120-138, Documentation/native/termux_native.md:60-90
Conclusion
The Termux-Desktops project relies on a complex hierarchy of environments (PRoot, Chroot, Native) and graphics stacks (Zink, Turnip, VirGL) to overcome the architectural differences between Android and standard Linux. By selecting the appropriate combination of these components, users can achieve varying levels of performance and application compatibility on mobile hardware.
Sources: Documentation/terminology.md:141-145, README.md:78-85