Hacker News new | ask | show | jobs
by LeratoAustini 304 days ago
TL;DR - Termux + Termux-X11 + proot-distro + BT keyboard + BT mouse

Termux is as great terminal, AFAIK it can be run on any modern (not even that modern) Android. With that alone you can get most common Linux terminal packages, run vim (including LSPs), tmux, ranger, compile C/C++, Python, Go, Rust...

Termux-X11 lets you run X11/GUI apps. It has settings to properly capture mouse (trackball in my case) and keyboard, preventing annoyances by disabling Android default keys (eg allowing Alt-tab to switch tabs in your Linux desktop rather than switching between Android tasks).

Termux proot-distro lets you install loads of Linux distros. I've daily driven Ubuntu in the past, currently using Debian Bookworm on my Tab S8 Ultra, which although a flagship is a couple of generations old now. I run the same setup on a Tab S4, which is a 7 year old device now. It's slow for some GUI stuff but works well for a lot of things, most stuff in the terminal is great.

The above is without root. With root, I've recently changed over to chroot as I wanted to try it.

You can get GPU acceleration, I'm currently using turnip, there are also virgl drivers, it can take some trial and error depending on which GPU your device has (I don't know much about GPU stuff so if any of those sentences had errors that's why, but it's perfectly googlable).

As I just rebuilt my system a few days ago, here's what I've done since then:

  - Installed Debian Bookworm
  - Installed Chromium and Firefox, both with GPU acceleration via a custom command eg: `Exec=env MESA_LOADER_DRIVER_OVERRIDE=zink /usr/bin/chromium %U` in a .desktop file
  - Compiled yazi (Rust terminal file manager) with rustup and `cargo install`ed another couple of apps
  - Been working on a Hugo site, after installing go and dart-sass
  - Compiled dwm with standard gcc stuff (dwm is my preferred environment but XFCE etc are around too)
  - Worked on some PSDs in Photopea (Krita, Gimp, Inkscape also all work perfectly)
  - Installed my preferred vim setup with nvim-coc, so all the LSPs etc
Node works perfectly. Python works perfectly. As above, C/C++, go all work perfectly (ARM64/AARCH64 of course).

What I'm trying to say is, it's strange for me to see so many in this thread wondering about if it's possible to do Linux stuff on Android. I thought Termux was pretty well known (?). I think the first time I installed a full Linux distro on Android was about 10 years ago via LinuxDeploy. I've been daily driving a setup similar to the above for maybe 5 years, on 3 or 4 different devices. I get that this is geeky and a bit niche but I'm surprised to see so many comments on HN without this stuff being mentioned.

I have a Macbook which I use begrudgingly when I have to (Apple lock-in reasons such as needing to compile Flutter stuff for iOS/Mac on Apple hardware --- btw Flutter works well on my Android Debian compiled for ARM64 Linux, meaning I can do most Flutter dev work here and just move over to the other hardware when I want to compile/test other architectures). I have an AMD ProxMox machine for when I need a bit more grunt or have something that requires Windows. Despite these other machines, if I can do it on the Android tablet I always prefer it (love the OLED display and low power usage), meaning 70-80% (guessing) of my work gets done there.

Docker can't/won't work, something to do with proot/chroot and cgroups I think. In my limited experience (Flutter), cross-compiling to different architectures hasn't worked. The OOM killer in Android can be annoying so you want a device with plenty of RAM, but there are ways to mitigate it, and in practice it doesn't bother me (rare and relatively inconsequential in my usage patterns) otherwise I wouldn't work this way.

I get that people in here today are mainly talking about phones, and I'm using tablets. But this all works on phones (I used to do it on my Note 3 up until I lost it a few months ago, that's over 10 years old). You just need a device which outputs video over USB-C, not uncommon nowadays.

I have had to faff a bit to get stuff working. Some people will hate this and just want instant. Horses for courses, I'm happy.

I haven't tried the new Linux stuff on Android 15 as I don't have a Pixel. I get the feeling it won't have much if anything to offer over my current setup and might be slower. But hopefully it will become standard in future. I don't like Dex on Samsung as it forces its own UI sensibilities on you (eg last time I tried it windows had huge ugly titlebars, which I personally don't like, hence dwm preference).

I've probably spilled most of the beans in this novel of a comment, but have written about this stuff before, here https://mm-dev.rocks/posts/android-as-a-dev-environment/intr...