Running a full Debian XFCE desktop on my phone
An article from Android Police popped up in my feeds a few days ago and I’ve been miffed about it since. The article titled Android 15 could include a desktop mode - but what for? felt like a direct attack on me and other people who love to use Samsung Dex and other similar floating window modes on Android devices. The last few days I’ve been using a full Debian Linux desktop install on my S10e to migrate some server virtual machines, write this post, and write a lot of notes.
The TL;DR version of the article is that laptops exist and phones should stick to being phones because the hardware isn’t good enough. Rather than disecting this article, I thought it would be a good moment to show what I’ve been doing recently on my Android phone in desktop mode.
Power usage
Where I live is currently under a substantial heat wave, so I’ve been monitoring our energy use to keep our bill down and reduce the amount of heat we are generating. Computers generate a lot of heat and we don’t have air conditioning. During this heat wave I’ve been using my phone at my desk since it only uses 5-10 watts (not including the monitor). This is in comparision to my desktop which uses about 100-watts under normal use.
I originally switched to a phone with Dex mode because I wanted an ultra low-powered and ultra-portable laptop I can carry with me to jobsites. Being able to use it at my desk is a nice additional benefit.
During this heat wave its been a fantastic way to keep my energy use down and generate essentially no heat while being able to do anything I would on my desktop.
Full Linux desktop
Here’s the real reason I am writing this post. When in Dex mode I can get most of my work done with no issues. Termux is a extraordinary terminal emulator on Android that I have configured with tmux (and my custom theming) and my ssh keys to hop around to my various homelab infrastructure. I also wrote recently about being able to work from anywhere with just a browser, which includes all of my office work as a small business owner.
However, some things are just easier from a full desktop.
Termux has the ability to run an entire Linux desktop in a proot environment. There is a fantastic repository that has a collection of scripts for installing Debian, Ubuntu, or a pure Termux XFCE desktop. Each install also includes hardware acceleration, which is tricky getting done using other methods.
As always, full verify running any scripts. I did the best I could verifying them, but I’m not a developer. Use at your own risk.
At the bottom of this post will be my notes on how to get a full desktop running using the scripts.
Server migration
One of the tasks I had this week was to move a small number of my homelab to a new mini PC. I was doing this so I could turn off my full home server during peak heat of the day since it lives in the garage and the ambient temperature is around 90F/32C.
All of the items I am moving are in virtual machines and since I am not using my desktop durin this heat either, I wanted a full desktop environment I can do this work from. Using the Debian script I setup a desktop and then pulled down my dotfiles from my self-hosted git to configure my environment. I also setup virt-manager so I have a graphical way of viewing, managing, and editing qemu virtual machines xml files.
I wanted the full desktop as its just easier to have a Linux terminal emulator, along with a desktop browser, and virt-manager. With this setup I copied the qcow2 files, ran virt-sparsify to shrink any unecessary space being used, and then moved them to a GMKTec NucBox G5 mini PC.
After getting this done, I closed the proot Debian desktop, fired up the Obsidian app in Dex-mode, and wrote up my notes.
Remote access a proot desktop
In the repo of scripts there are directions to setup xrdp and access the desktop remotely. I don’t have a direct use for it now, but thought it was pretty fucking rad. So, I decided to test it out.
I have a Redmi Note 7 laying around that is only being used for a portable gaming device at the moment. Using my S10e in Dex, plus the proot desktop, I set up the Note 7 with a Debian desktop and then accessed it from the S10e in a RDP app.
Here’s how I did it from all from Android in desktop mode:
- Installed Termux and Termux x11 apps on the Note 7.
- Installed LocalSend on both devices to make copy/pasting my notes easier.
- Opened Termux and followed the directions for installing Debian on the Note 7.
- Once installed on the Note 7, I setup
adbin theprootdesktop on my S10e and connected to the Note 7 remotely to disable phantom process killing. - Launched Debian on the Note 7 and ran the setup script for
xrdpfrom the scripts repo. - Opened aFreeRDP on the S10e and connected via IP address to the Note 7.
- Profit!
Thoughts
Using my phone as a full desktop replacement isn’t perfect. For example, managing files and mounting remote filesystems is a huge pain in the ass. Android has made it harder and harder for apps to access files for extra “security”. It also doesn’t do multiple monitors or workspaces.
But, it is more than capable for getting real work done when the situation arises.
In my opinion, people vastly over-estimate how much compute they need to get their daily work done and use an excessive amount of energy doing something a phone can handle. I know there are use cases for high end processors and GPUs, but the majority of people (even most office workers) only need a messaging app, email, and a web browser.
I’m also tired of people shitting on low powered devices since they can’t “game”. Allow me to be an old man for a moment. Measuring the effectiveness of a PC based on what games it can play is a terrible. I get it, people like to play games. But y’all need to back off the games. You also need to stop listening to influencers about what is enough compute for regular users. Reminder your favorite tech YouTuber makes money off of affiliate links and they make more money if the item you buy is more expensive.
If you have a Samung Dex-compatible device (or anything with the capability to send video out to a screen) try a proot desktop. Even if you don’t use it, have fun using your tech to its full possibilities. This is just one of the ways I use an Android desktop mode. I also use it to stream games from my Xbox to my desk, attach it to my living room TV with Kodi connected to my Jellyfin server, and play Minecraft Java Edition with my kids.
- - - - -
Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.
🙏 😎
Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.
Install notes
The setup requires two apps: Termux and Termux x11. The proot environment will be setup in Termux, while viewing the desktop will be done through Termux x11. The performance for Termux x11 is much better than other instances I’ve setup previously.
- Install Termux either through the direct download link or through F-Droid/Droid-ify.
- Termux’s x11 apk needs to be installed, choose the correct version for your device:
- Choose the distro you want to run and install with the script.
Ubuntu:
curl -sL https://raw.githubusercontent.com/01101010110/proot-distro-scripts/main/ubuntu-x11-app.sh -o ubuntu-x11-app.sh && chmod +x ubuntu-x11-app.sh && ./ubuntu-x11-app.sh
Debian:
curl -sL https://raw.githubusercontent.com/01101010110/proot-distro-scripts/main/debian-x11-app.sh -o debian-x11-app.sh && chmod +x debian-x11-app.sh && ./debian-x11-app.sh
Termux:
curl -sL https://raw.githubusercontent.com/01101010110/proot-distro-scripts/main/termux-x11-app.sh -o termux-x11-app.sh && chmod +x termux-x11-app.sh && ./termux-x11-app.sh
Browser
When installing Ubuntu it will default to installing snaps, which is not supported in proot as you can’t use FUSE filesystems (also means you can mount SMB, NFS, or install flatpaks).
When launching the proot distro with the flag --shared-tmp you can install Firefox in Termux and then have access to it in the proot environment. Or you can built from source/find and install from PPA.
But, if you are using Debian, just install firefox-esr and will work out of the box.
Launching
Took me a minute to figure this out and the issue was I run an alternate shell instead of bash.
After it is done installing it creates a bash alias in ~/.bashrc. Just type debian, ubuntu, or termux (from a bash prompt) depending which one you want to launch. The details of the alias are in ~/.bashrc in Termux.
Fixing backgroud close
Android, by default, will close Termux and the proot environment from running in the backgroud. See the notes on the Git repo on how to stop that from happening.
If you can plug your phone into a computer, simply run this command:
adb shell device_config put activity_manager max_phantom_processes 2147483647
- - - - -
Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.
🙏 😎
Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.