Hacker News new | past | comments | ask | show | jobs | submit login
Run full Linux distros or specific applications on top of Android (github.com)
244 points by flokii 9 days ago | hide | past | web | favorite | 103 comments





Another related app is Termux. It can't run full Linux distro but it is much more lightweight and it has a pretty active community at /r/termux.

Termux wiki: https://wiki.termux.com/wiki/Main_Page Termux repo: https://github.com/termux/termux-app Subreddit: https://www.reddit.com/r/termux/


It works surprisingly well, and you can even share storage with the local Android system through termux-setup-storage.

I've been using this for years and it's the primary reason I really enjoy Android. Another comment mentioned iSH for iPhone, but the comparison between iSH and Termux is no contest - Termux on my 6-year-old Motorola Photon Q runs much better than iSH on my 6S. Plus the Photon has a full keyboard!

edit: Not only that, I attempted to run UserLAnd before, and it does not do well on my old phones with slow, small storage. UserLAnd is fun for playing around, but Termux is, for me, where the real action happens. It's my most-used Android app.


I love termux.

The virtual keyboard integration is neat:

* Volume keys do ctrl and alt

* You can type into an intermediate text area to use the usual glide typing and spell checking.

Stuff that caught me out:

The root apps repository needs to be manually enabled. `pkg install root-repo`

Swiping from the left edge lets you manage multiple sessions.

My only problem is not being able to fully use an external SD card.


I'm also interested if you can use a sdcard fully with termux without root. I think it's not possible.

As far as I know you can only use a specific path like described here: https://github.com/termux/termux-app/issues/954#issuecomment...

But a specific path is not a big deal once you get accustomed to it.. the external sdcard is anyway mostly a FAT serial number path so going a few levels deeper is not a big deal.

btw: Just finished a rsync transfer to sdcard with Termux today ;)


Yeah termux is amazing but it has some discoverability issues. It took me ages to discover that long-pressing the keyboard button pulls up the helper bar. I don't know that I ever did find docs for how to use some of the Android interop features (widget, share to termux, etc.).

What problems do you have with external SD cards ? I use Termux and don't keep any data in-device, always in encrypted SD cards via device reader or attached via USB OTG. I haven't had any issues.

Edit : My devices are rooted.


In termux you can use proot and run other linux distributions in a container. Here is a script that automatically instals debian on termux:

https://github.com/sp4rkie/debian-on-termux


You are right. I had simply forgotten about proot.

There is even gcc, fortran, scipy and julia repo for termux. See here:

https://github.com/its-pointless/gcc_termux


And Rust. It allows a great pocket programming environment.

Also nodejs if you are into that kind of stuff. I use it to spin up simple local webservers.

You can even use nodejs' autocannon to benchmark your Rust webserver. That works too.

https://github.com/mcollina/autocannon


I just tried installing golang and its available

and picolisp

I have Termux installed but haven't really explored it much yet.

Q: Does anyone use a somewhat recent smartphone, Termux, and a bluetooth keyboard? How well does it work for ad-hoc systems administration over SSH, or command-line tasks like text processing using awk/sed/vim? My beloved LG V20 phone is still pretty much perfect for me and I don't want to give it up any time soon!


I do on a Pixel 3. Sometimes I'll SSH into my desktop, sometimes I'll work on it directly, both using tmux and vim. I love everything about this setup except the screen size.

I use an original Google pixel and a cheap $20 keyboard and have done some basic scripting etc on it.

Main problem is tmux doesn't work well on it. Otherwise vim is pretty great, for example. It's actually even pretty usable without the Bluetooth keyboard thanks to the volume keys being a fn layer and ctrl


emacs works pretty well. even the touch scroll gestures are translated into scolling in emacs. and changing the buffer by touch also works. so you can use emacs eshell and a keyboard and it is perfect.

Emacs does work pretty well in Termux, but on Ubuntu Touch you can run full X11/GTK Emacs, which is nice. (I suppose you could do the same thing via Termux with an X11 session.)

These GNU tools are really optimized so they will work well on even the cheapest Android phone. If you are comfortable with the small screen it should work.

use this setup daily Without a Bluetooth keyboard. Buy any modern android from blackberry (before they go out of business).

the keyboards lack esc, tab etc. but since they have a ctlr key yoiu can work around most of that. If you can still find, the best keyboard layout and performance is the priv model. avoid the Key2LE.


i use hackers keyboard because it has all the needed keys like control and alt and it works very nicely together with emacs. or you can startup jupyter notebook and use firefox as front end.

works well for me with a nexus 5x and foldable bt keyboard. also if you have a google chromecast you can turn any hdmi monitor/tv into your display. you can zoom in and out by 'pinching' in termux and make the text suitable for any display

I love Termux, it has gotten me out of a tight situation more than once. I lets me ssh into my machines while in the pub or someplace where I'm not bringing my laptop.

ConnectBot[0] is pretty great for this too.

Especially when combined with Hacker's Keyboard[1].

[0] https://play.google.com/store/apps/details?id=org.connectbot

[1] https://play.google.com/store/apps/details?id=org.pocketwork...


Maybe UserLAnd was/is relying on ConnectBot?

Just installed it and it looks quite polished in terms of UI - the wiki is great too and I was able to setup two way ssh between my phone (Nexus 6P) and pc (Ubuntu 18.10) with access to all my files/photos etc. I was able to scp from my PC to phone which is awesome for one-off needs (I use syncthing for more general syncing).

I love Termux too. I used it on my Chromebook while I waited for Crostini to land for my hardware.

It's on my phone though I don't really do much besides to play around. It's pretty awesome if you have a bluetooth keyboard.


Termux is also great on Chromebooks. I use it a lot, it reminds me of Cygwin, i.e. not really Linux but 90% of what most Linux users would use routinely.

Chromebooks with recent(ish) kernels now support honest-to-goodness (virtualized) Linux[1]. It doesn't even need to be a high-end Chromebook - Linux runs well on a 2GB Samsung Chromebook 3 which was going for $100 over the holidays.

1. https://support.google.com/chromebook/answer/9145439?hl=en


Just installed it and it's great - thanks for the heads-up.

This runs on proot, which basically ptraces all processes under it and intercepts any syscalls that need privileges or deal with paths, and emulates them.

It works pretty well until you start to run many processes, and then proot starts to be a bottleneck. It's not multithreaded, so every syscall ends up going through a single loop. Any multithreaded code that makes a lot of syscalls will be reduced to being effectively singlethreaded.


I wonder how far we are from a real usable phone that docks into being a real usable PC. I suppose that's more of a hardware than software program. I'm aware of Samsung's DEX and similar, but I would guess the performance isn't great given the limited memory, etc, on a phone.

Android Nougat has an experimental "Freeform Window Mode" that I've been playing with. I can connect my LG V30 to a USB-C dock and have a windowed desktop-style environment with a mechanical keyboard, Bluetooth mouse, monitor, etc. Most of my phone's apps are comfortable running like this. Chrome actually displays the desktop versions of sites.

This Thursday, I signed up for coder.com (featured here on HN) and was able to write some Go code using VS Code in the browser. It was a pretty solid experience.

Performance was fine. I had my email and a podcast player going in the background and, honestly, I could probably do a lot of my day-to-day work with this and an EC2 box for running sites.

But it was glitchy, because Android hasn't really invested in this use case. The Taskbar home screen replacement would close the start menu as soon as it opened 90% of the time. There was a black space at the bottom of the screen which would change height almost randomly. Large windows conflicted with the notification bar and I'd end up opening my notifications when I wanted a new tag in Chrome. Right clicking maps to the back arrow in Chrome for some reason.

But the point is, between modern phone hardware and the cloud, we're not far from a performance perspective. We just have to decide that's where we want to go and commit to it.


It must be noted, however "LG formerly supported DisplayPort on their LG G series and LG V series phones, but dropped support in the G6, G7, V35, V40 phones" so while you can connect the V30 to an external monitor, not the later ones.

That's a shame. It seems like the V30 and V30+ were great phones and then the series really went downhill.

https://maruos.com

You're looking for MaruOS. I've been following development for a while and it had come a long way. While it might not be this project in particular, I feel it's the future of computing.


Does anyone out there use this as their primary operating system? Curious to hear how it is working - does it live up to the vision?

I guess 2 days of silence answers this question:)

That was the promise of Continuum on Windows Phone: https://www.microsoft.com/en-gb/windows/continuum

I really hope that is somehow Microsoft’s gameplan. Otherwise how on earth did they justify abandoning mobile phones. I mean some of their stuff was amazing (zune), and usually I am not a fan.

> Otherwise how on earth did they justify abandoning mobile phones.

No one was buying Windows Phones, and no one was making apps for Windows Phones, and this had gone on for many years, and not for lack of trying on Microsoft's part.

How could they not abandon mobile? What options were left to them?


Buy a bunch of third-party apps (like Sunrise and SwiftKey) and slowly but surely integrate them into your own products (like Bing and Outlook) to gather more data?

I'm entirely used to one of them (SwiftKey) and I've tried several others as well. They've all offered amazing user experience, but I'm just not comfortable using Microsoft's Launcher for example.


Which is what Microsoft is doing. So if we're considering this part of their mobile strategy (which is fair), Microsoft hasn't actually abandoned mobile at all.

.NET Core and Xamarin, it seems.

There are a small number of phones supporting DisplayPort alternate mode so they can be docked to monitors and keyboards. And the performance is not at all bad any more, check https://browser.geekbench.com/android_devices/839 vs https://browser.geekbench.com/processors/2294 or https://browser.geekbench.com/processors/763 Basically, the fastest Android now caught up with Haswell desktop chips which is a pretty impressive feat. While RAM is not plentiful, top phones are now 8GB which is not bad at all. The real problem is more in storage, compare https://www.samsung.com/semiconductor/insights/tech-trends/e... to the SN520 -- I picked the SN520 because it's available in a 2230 physical format so the physical advantage is smaller but of course still existent, anyways: https://www.sandisk.com/content/dam/sandisk-main/en_us/asset... the sequential speed is five times faster, IOPS closer to ten. (I also picked the SN520 because I am using a 2242 version of it now.)

Ah, so closer than I thought. Maybe two more cycles of new models would be enough for the HW/SW to get there.

Flagships from two years ago had 4GB RAM. New flagships come with 6 to 10GB, and 128GB or more storage. GPUs already handle 1440P and larger displays.

What you need is a standard dock that can break out HDMI, USB ports for input and I/O, and a gigabit NIC. As it turns out, people make those for Macbooks right now.


Dunno about nic but I bought a usb c to c, a, and HDMI converter dongle thing to replace the stupid Nintendo switch dock, and happily discovered my galaxy s9 was outputting display and intaking USB through the thing.

That's one of the main goals of https://ubports.com/ True 'convergence'.

Work in progress though.


s10+ has up to 12 gb of ram. More than plenty of laptops. The videos of dex in action on that are awesome. Foldable phones that give a tablet sized display when on the go will be a piece of the puzzle, because a bunch of peripherals in tow doesn't solve anything.

I think we are there for performance, now it's a question of whether anyone gets the software right enough to make it practical. That includes the possibility of making a restorable image of everything on the phone so you can be up and running in an hour if you lose or break it. I have not used dex, so maybe they are already basically there.


Unfortunately the RAM battle has already been lost thanks to electron, etc. A laptop with less than 16GB for development just doesn't make any sense.

I did use DeX for some time and it's definitely good for regular office work. I didn't have a chance to use Linux on Galaxy.

The term is "Convergence", fyi.

I never understood why there isn’t something like this for iOS. A package of the top 100 or so most popular precompiled tools wouldn’t be against the App Store rules AFAIK.

Going the emulation root like iSH seems nuts to me.

Running Vim, mutt, ffmpeg, imagemagic, httpd, etc, at full speed would be sweet.

Things like [1] [2] seem either dead or not getting much traction.

[1] https://github.com/louisdh/openterm

[2] https://github.com/ColdGrub1384/LibTerm/blob/master/README.m...


What would you do with it if you can't add more software yourself? (which Apple expressly forbids). Try to customize your vim macros? Nope. Want to change your ~/.bash_profile? Also against the rules.

As far as the rules, quoting Federico Viticci[1]:

"For a long time, Apple's App Store review guidelines prohibited apps from downloading executable code from the Internet. The company's original stance resulted in IDEs that couldn't sync scripts and programs across multiple devices – a serious limitation for the emergent movement of programmers embracing the iPad Pro as a portable workstation.

Fortunately, Apple started relaxing their rules earlier this year, allowing "apps designed to teach, develop, or test executable code" to download and run code."

As an example of what's possible, in Pythonista 3[2] on my iPad Pro I installed StaSH[3] (bash-like shell implementation), youtube-dl using pip, and then wrote a simple script[4] to let me save YouTube videos with a long-press on a link -> Share -> Run Pythonista 3 Script...

1: https://www.macstories.net/linked/pythonista-3-2-syncs-scrip...

2: https://omz-software.com/pythonista/

3: https://github.com/ywangd/stash

4: https://gist.github.com/solarfl4re/0a3647788f8ec2f375f2da3db...


Amazing, I may steal the idea.

Editing bash_profile would be against the rules? Where is the line between software and configuration?

There are apps that let you run your own code. I think the restriction is on apps that allow you to download and execute third party code.

If you can write code, you can also copy and paste code from the internet.

I’m also not sure it would be forbidden, but it’s an interesting question

> I never understood why there isn’t something like this for iOS.

Android is natively Linux, so launching a chroot isn’t really all that hard.

On iOS things are very different and you’ll need to fake the whole stack. (Also Apple policies blah blah)


Is it? I thought iOS was BSD/Darwin like MacOS is, deep under the covers.

Maybe you don't need to fake a full stack to run a Unix-like environment.

But to run a proper, Linux-environment, a mainstream distro, you can't rely on what iOS natively provides. At least not with some rather decent intermediate layers.


That’s not it. We have all those tools on MacOS which share much of the same underpinnings with iOS

"route".

Related: under development for iOS, iSH - a usermode Alpine Linux https://github.com/tbodt/ish

Wow...that's a pretty crazy approach. Userland x86 emulation on an arm device, and a ton of ASM code and a sort of JIT. Guess options are limited in a walled garden.

Edit: Found an HN discussion about it: https://news.ycombinator.com/item?id=18421016


The assembly and pseudo-JIT are there for performance, IIRC. iSH should work fine without them.

Yes, not being critical at all. Just amazed at the dancing bear :)

x86 is indeed a weird choice for an "emulated" architecture - I'm pretty sure that RISC-V would behave a lot better (due to being a legacy-free design, if nothing else), and it does have support for running Linux.

I just went down a rabbit hole on the subreddit for the iSH community, and it looks like the creator went with x86 because it's the only architecture they knew at the time.

Way more interested in the other way around. Having to carry a second phone just for things like instant payments or city bikes app sucks.

I would love it too- I would like to carry an old bb with just contacts and emails synced. I'm not an App guy.

Somewhat related: Run arch on any distro: https://github.com/fsquillace/junest

I want a "phone" with data only that runs Linux and has docking support. The average techie could piece one together now with a pi, screen, and 4g module. It can't be that hard to build one in a phone form factor. It is all open source so you could whip up correctly shaped boards in weeks. The hardest part to me is the enclosure/case to screen finish.


Neat! I would pick one up right now if it weren't for the keyboard layout. I would shoot myself with the up arrow between comma and dot. Would have loved to see a 60% option, which is de-facto standard for semi-minimal mechanical keyboards. I feel there's a certain overlap between users of 60% keyboards and the target audience for this device.

You're exaggerating the impact of that layout decision. I use many keyboards (including ortholinear) and this is never really a problem.

You can always remap the dot key to be only be triggered when pressed with super or fn key (and that can also work with shift).


That's a really interesting little device! Thank you for sharing the link, it was a good review.

Purism’s phone will be this.

Last time I used UserLand I couldn't install something major (maybe typescript from npm, it's been a while) because there was some file path limit (maybe 143 bytes, again, it's been a while) that a bunch of the package's files violated. Has this been addressed with new versions?

Did you submit an issue, or do you expect developers to be able to read your mind?

Fair enough. I had a few minutes of spare cycles and I tried it out. It failed on the first thing I tried (installing Typescript), so I dropped it and didn't look back.

A bit of a tangent, but does anyone know what happened to Microsoft's x86-on-ARM emulator? I thought it was going to be the next big thing for mobile but there seems to be little trace of it?

It’s shipping with all Windows-on-ARM laptops, and probably used pretty heavily on those machines. It’s the only way to run Chrome and pretty much all Win32 apps.

Oh I see, thanks. Do you know if there's any way to get it on other systems that don't come with it? I was so looking forward to getting Windows on my phone someday...

I don't have an Android phone and I don't miss one. In rare cases I might want to do the opposite what the author does: Run an Android app on my computer (Linux). Sounds weird that that is still not standard. I know there has been more than one attempt to implement it. But AFAIK none of them really successful. Would be glad to get corrected.

Have not used termux, just installed and don't understand what is is. It just goes into a linux env directly without login that is running 3.18 kernel and I can install some packages on top of that, what is it?

mainly used juicessh in the past, use connectbot occasionally, both are excellent, but I'm confused what I can use with Termux


If I understand correctly, termux is a terminal emulator first, with some additional packages installed.

Android is running linux kernel, so in theory, if you have like sh executable compiled for android you would be able to run it inside of a terminal emulator on android.

The additional packages are compiled with android ndk. There is a repository used to build and configure the basic set of packages [1].

[1] https://github.com/termux/termux-packages/tree/master/packag...


just played with termux, looks neat, basically it is a local linux running on your cellphone.

if I can miracast the screen to a tv or pc monitor(if the phone provides a hdmi-out), along with a bluetooth keyboard, then I have a portable little computer that I can use anywhere?? that is fantastic.


talking about miracast, we now need a chromecast or firetv dongle to relay that, hope the TV and monitors will support all kinds of casting one day.

for now, can termux add chromecast?


You can mirror your screen to your Chromecast through the Google Home app

At your phone's resolution, which is a mild bummer (an not, as far as I'm aware, things like chromecasting youtube work)

For Samsung users there's Linux on Dex

Notice that only S9 had DeX over USB-C earlier, not using a DeX-hub. This is now gone with the recent upgrade to Android 9 on at least S8. Tested it out as recently as yesterday!

Just tried this and great it runs PowerShell Core and .NET Core where Termux seems to struggle with.

Since I have a handful of PowerShell modules I regularly use, this will be useful.


This is easier to use than Termux or any of the others. Looks nice.

VNC into chrooted linux.

...which requires a remote Linux machine to VNC into.

Awful name.

It's like calling your app “An Executable.” The name means a concept in the same problem domain. ‘A program in userland’ is already a thing.


Seems pretty good. Android runs on the Linux kernel, but is missing the GNU/Linux userland. This app gives you that.



Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: