Everything you need for day-to-day life with a Linux desktop in your pocket.
Background desktop session
ternux start starts the desktop as a managed background session and returns
when the X11 display is ready. Startup output is kept in
~/.local/share/ternux/session/desktop.log (the previous log is rotated at
1 MiB). Use tx status, tx stop, or tx logs desktop tail to manage and inspect it. Each configured desktop guest uses its own tagged Termux:X11 display, so multiple profiles can stay open at once. tx stop lists running guests and displays, then accepts one or more indexes or names separated by spaces or commas; enter 0 to cancel. tx stop db, tx stop ub, and tx stop alp target Debian, Ubuntu, and Alpine individually. tx stop --all closes every Ternux desktop. Android may still stop background processes under memory pressure;
reopen Termux:X11 if Android has reclaimed the session.
Keyboard input in Termux:X11
Ternux enables Termux:X11 enforceCharBasedInput before starting the desktop so Android soft keyboards can send committed text to terminal and other X11 apps. The setting is applied through the managed desktop launcher. If input still fails after an upgrade, run ternux restart once so the running X11 server is recreated with the setting.
Daily controls
After installation, new Termux host and managed guest shells show Terfetch.
Its ten Android/Linux/distro marks shuffle at each login; the summary also
shows kernel, uptime, packages, shell, terminal, CPU/GPU, memory, and storage.
Ternux hides Termux's stock welcome text with ~/.hushlogin;
Terfetch appears once at terminal-shell startup, and child interactive shells
inherit a guard against repeating it. TERFETCH_NO_AUTORUN=1 skips the
automatic summary for the current shell. Run terfetch to display it again or
terfetch --json for structured host or guest details.
| Command | What it does |
|---|---|
xgo |
List installed guests and select the Ternux desktop to start |
killx |
Open the session picker and stop one or several desktops |
db / dbr / dbroot |
Debian user / root shell |
ub / ubr / ubroot |
Ubuntu user / root shell |
alp / alpr / alproot |
Alpine user / root shell |
tx |
Short executable command for the ternux CLI |
terfetch |
Show the host or guest system summary; --json prints structured data |
sysmon |
Quick CPU/RAM/GPU-node overview |
clean-mesa |
Clear the shader cache (after driver changes) |
Installation sets each guest's root account to the same password entered
for that guest's sudo user, so su - uses that sudo password too. Change both
accounts together with tx password sudo. The password is not stored by Ternux
on the Termux host; each guest stores its password hash.
Because PRoot does not isolate the guest from the Termux app owner, root
shortcuts such as dbroot continue to enter as root without asking. su - in
the native Termux host instead refers to Android root and is unavailable on an
unrooted device.
A healthy start/stop routine:
- Start with
xgoor runtx start debian(or another installed profile). - Close apps normally inside the desktop.
- When done: log out of Xfce4 (Applications → Log Out), or run
tx stopfrom Termux and choose which guest display to close.tx stop --allcloses both.
Why bother? A leftover X11 socket or zombie PulseAudio process makes the next session "start" against a dead service — the desktop appears but audio or display behaves oddly. Ternux now owns one tagged display and session record per desktop, so stopping one guest leaves another guest display running.
Android microphone input
The desktop exposes Android audio input to guest apps through PulseAudio's
OpenSL ES source. Android may ask for Termux's microphone permission the first
time a guest app captures audio; grant Settings → Apps → Termux → Permissions
→ Microphone if needed. Idle sessions do not start a recording; the source is
used when a guest app requests capture. Volume Control also reads the source
while it is open to display the live input meter; closing the app releases that
stream and the source returns to idle. An idle desktop does not keep recording.
Termux:API's termux-microphone-record records to a file and cannot act as a
live PulseAudio input stream, so it is not the desktop's source. Android shows
its microphone privacy indicator while capture is active. The default Ternux Sound Recorder app captures only after Start, saves AAC/M4A by default, and can export MP3 locally with FFmpeg; files are saved in ~/Music/Ternux.
Run tx mic to check/request Termux:API's separate microphone permission. It
uses a bounded one-second probe, then stops and removes its private recording.
If Termux:API is missing, the command briefly opens the built-in OpenSL input
when the desktop audio source is available; audio is discarded, and Android may
ask for Termux's microphone permission. Desktop use does not depend on the
companion app. Run tx cam to request Termux:API camera permission with one
temporary rear-camera photo, which is deleted after capture. Both commands need
the termux-api package; Android's Termux:API app must come from the same
installation source as Termux. Without it, use Android Camera and open its
saved photo from the guest file manager. Termux and Termux:API have separate
Android permissions.
The Xfce About → System page reads CPU model names from /proc/cpuinfo.
Android may expose only ARM part IDs there, so the Ternux launcher supplies
recognized live model names from lscpu and adds the Android SoC identifier.
Unknown models remain labeled as unavailable instead of being guessed.
Audio and VLC controls
Fresh installs apply Ternux's graphite-and-emerald GTK 2/3/4 and Xfwm theme, Qt 5 GTK platform theme, branded app, folder, Thunar-action, category, and panel icon mappings with neutral Adwaita fallbacks, and the Ternux panel defaults across Xfce. Optional GUI apps such as Firefox ESR, Blender, GIMP, Krita, Inkscape, Audacity, Geany, and LibreOffice also have branded icon aliases; the base Evince PDF reader has one too. Common Thunar actions are stored in their own icon context. Fifteen portrait-first wallpapers preserve their aspect ratio in landscape. Apps using other toolkits may keep their own styling. PulseAudio Volume Control uses Debian's packaged application entry and the same desktop session. Xfwm compositing stays disabled because enabling it can make the whole Termux:X11 desktop black. VLC uses its full interface by default so playback controls remain visible. Android shared storage is mounted at /sdcard by default for managed guests, so model paths work without copying. Run termux-setup-storage once if the path is unavailable.
XFCE Task Manager performance
Ternux defaults the Task Manager to the current user's process list, flat view, and a one-second refresh interval to reduce repeated process scans on low-resource Android devices. Use the Task Manager's Show all processes option when you need to inspect system or other-user processes. The defaults are applied once and do not overwrite later preferences.
Ternux CLI — the permanent interface
When ternux is installed, the ternux command is your single entry point for
everything — install, diagnostics, repair, benchmarking, and daily desktop
management:
ternux install # Full installation (delegates to install.sh)
tx distro list # Show all installed PRoot guests and desktop recipe status
tx distro search alpine # Search available OCI images
ub # Ubuntu user shell; ubroot opens root shell
alp # Alpine user shell; alproot opens root shell
archx # Arch Linux user shell; archroot opens root shell
fed # Fedora user shell; fedr opens root shell
suse # openSUSE user shell; suser opens root shell
vsh # Void user shell; vroot opens root shell
kali # Kali user shell; kalir opens root shell
tx distro shell NAME # Profile user shell (image default for generic guests)
tx distro exec ubuntu -- uname -a # Run a guest command
tx distro image-install alpine:latest # Install a generic Alpine shell guest
tx distro uninstall NAME [--yes] # Remove a registered Ternux guest
tx install --distros debian,ubuntu,kali,alpine # Install independent desktop guests
tx distro image-install alpine:latest # Generic Alpine shell guest
tx start # Start the saved guest desktop
tx start ubuntu # Start Ubuntu explicitly
tx start ub # Same Ubuntu desktop using its short name
tx start alp # Start Alpine desktop using its short name
tx stop ubuntu # Stop Ubuntu explicitly
ternux restart # Restart the desktop session
ternux doctor # Run system diagnostics
ternux doctor --json # machine-readable structured diagnostics
ternux repair # Auto-fix common issues
ternux verify # Verify installation completeness
ternux benchmark # Run GPU benchmarks (glmark2, vkmark)
ternux profile # Show or save device hardware profile
ternux backend set virgl # Switch to VirGL backend
ternux gpu update # Refresh validated Debian Turnip driver (Zink)
ternux update # Update the CLI from the latest stable release tag
ternux logs # View and manage log files
ternux info --json # machine-readable system info
ternux state # Show installation state
ternux uninstall # Remove ternux components
The dispatcher recognizes --help, --json, --verbose, and --quiet globally,
but not every command defines JSON output. Commands shown below provide the
structured forms intended for automation; see the CLI reference.
Structured JSON output
Selected diagnostics and information commands produce machine-readable JSON:
ternux doctor --json | jq '.issues[]'
ternux info --json | jq '.gpu, .backend, .renderer'
ternux benchmark --json | jq '.glmark2_score, .vkmark_score'
See CLI reference for the implemented command and JSON fields.
Where things live (and why)
Termux host PRoot Debian
──────────── ────────────
~/.local/share/ternux/distros/NAME/launcher.sh launcher /home/<user> your home
~/.local/share/ternux/ state state /root root's home
~/storage/shared Android storage /sdcard same files; guest access is opt-in
- Debian home is inside the container — it travels with a
proot-distro backupand is deleted with the container. ~/storage/shared(Termux) and/sdcard(Debian) refer to Android shared storage. Ternux mounts it at/sdcardin managed guests when Android storage permission is available. Runtermux-setup-storageif the mount is missing.- Source code you care about should also live in a Git remote. A phone is easy to lose and containers are easy to delete — GitHub is not.
Workloads
Everyday desktop
Browser, file manager, terminal, editors, archives, office docs — the default
Xfce4 install covers all of it. Install more with sudo apt install <pkg>.
Tip: in Xfce4 → Settings → Appearance, pick a dark theme and set the panel to auto-hide — the phone screen is small, and dark is battery-friendly on AMOLED.
Blender viewport work
Install Blender with bash install.sh --with-blender, start the desktop, then
launch it from a Debian terminal:
blender
The captured Blender 4.3.2 system report saw the renderer
zink Vulkan 1.4(Adreno (TM) 825 (MESA_TURNIP)). That is evidence for the X11
OpenGL viewport path. It is not a Cycles GPU result: the same report listed
device type SOFTWARE and no Cycles GPU device. Keep scenes modest, save often,
and do not infer render speed from the archived glmark2 score.
Record your own evidence before and after a change:
glxinfo -B | tee ~/blender-gl-baseline.txt
blender --version | tee ~/blender-version.txt
Blender rendering on the Adreno GPU
For the established Termux/PRoot Redmi workstation, use EEVEE Next with GPU
offload through Zink/Turnip as the default render path. Cycles GPU is not
established on this device. --with-blender installs Xvfb as well. Headless
rendering still needs its X11 GL context: start a virtual display and pass both
environment variables to Blender:
Xvfb :9 -screen 0 1280x720x24 &
DISPLAY=:9 GALLIUM_DRIVER=zink blender -b --factory-startup --python render.py
Do not omit DISPLAY or GALLIUM_DRIVER=zink: on the measured setup those
routes fail rather than rendering on the GPU. Check glxinfo -B for the Zink /
Adreno / Turnip renderer before a long run. The complete reproducible workflow
and its limits are in the cartoon pipeline guide.
For agent-driven renders through the local MCP, see the Blender GPU MCP guide.
llama.cpp with Vulkan
--with-llm clones llama.cpp and builds its Vulkan backend inside Debian.
Supply a GGUF model you are licensed to use, then verify the binary and devices
before measuring it:
db
cd ~/llama.cpp
./build/bin/llama-cli --list-devices
./build/bin/llama-cli -m /path/to/model.gguf -ngl 99 \
-p "Explain Zink in two sentences." -n 128
./build/bin/llama-bench -m /path/to/model.gguf -ngl 99
The supplied device notes report a successful Vulkan build/use, but contain no
reproducible token-rate table. Treat --list-devices as capability evidence
and llama-bench output as the performance evidence. Save the exact model
filename, quantisation, context, GPU layers, commit, prompt/prefill rate,
generation rate, memory and temperature; changing any of them weakens a
comparison.
Start with a model that fits comfortably in available shared memory. There is no model size guaranteed to work on every 6–8 GB phone: Android, the desktop, model weights, context/KV cache and Vulkan allocations all compete for the same RAM.
stable-diffusion.cpp with Vulkan
This is a manual developer workload rather than an installer profile. The submitted notes report that a Vulkan-enabled build completed using this configuration pattern:
db
sudo apt update
sudo apt install -y git cmake build-essential libvulkan-dev \
glslang-tools glslang-dev
git clone --recursive https://github.com/leejet/stable-diffusion.cpp.git
cd stable-diffusion.cpp
cmake -S . -B build -DSD_VULKAN=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j2
./build/bin/sd-cli --help
A successful build proves neither successful image generation nor speed. For a defensible result, record the exact model and commit, resolution, steps, sampler, seed, command, elapsed time, peak memory, temperature and output image. Begin with a low resolution and a single image; stop if the device becomes uncomfortably hot or Android starts reclaiming processes.
Development
--with-dev installs Git, Node.js, Python (with venv) and build tools.
Terminal-based coding assistants work inside the container; account and
licence terms are between you and the provider.
Tip: run git inside the container (db), but push from wherever is
convenient. Android shared storage is visible at /sdcard in managed guest sessions
when Termux storage permission is available.
Authorised security lab
--with-network adds nmap and tmux. Use them only on systems, applications
and networks you own or have explicit written permission to test.
Know the limit: PRoot provides a Debian userspace, not unrestricted wireless. Monitor mode, packet injection and raw USB access stay behind Android's kernel rules — by design.
Backups
# In Termux — snapshot the whole container:
proot-distro backup debian --output ~/debian-backup.tar.gz
# Restore:
proot-distro restore debian ~/debian-backup.tar.gz
# Keep Android-side files safe too — they are NOT inside the container backup:
tar -czf ~/storage-backup.tar.gz -C ~/storage/shared .
When to back up: right after a verified install (your known-good baseline),
before big experiments, and before apt dist-upgrades.
Power, heat and longevity
- Sustained compute while fast-charging adds two heat sources. Start with a charged battery; if the phone warms quickly, disconnect charging, remove a heat-trapping case, lower screen brightness, and let the device cool in open air. Do not use a freezer, ice, or condensation-prone cooling.
- Prefer bounded work:
cmake --build build -j2, one image at a time, modest Blender scenes, and pauses between benchmark repetitions. More threads can reduce completion time but also raise peak temperature and memory pressure. - If the Termux:API app and package are installed,
termux-battery-statuscan expose a battery-temperature field. Treat it as one sensor, not the SoC junction temperature. Also heed Android thermal warnings, abrupt clock/FPS drops, charging pauses, instability, or a case that becomes uncomfortable to hold; stop the workload and cool the phone when any appears. - On Android 12+, a killed build is not automatically the phantom-process policy. Check memory pressure and OEM battery restrictions first, then use the evidence-led flow in Troubleshooting.
- The launcher holds a wake-lock while the desktop runs and releases it on exit. End the session when idle; a wake-lock prevents sleep and therefore consumes battery.
- Heavy sustained rendering, generation, large builds, and especially mining are poor phone workloads. No archived result here establishes sustained performance or a universally safe runtime.
ternux — Copyright (c) 2026 Sobuj Miah (@soobujmiah) · Apache-2.0