6 ms·
I thought it was about installing Docker on Android, but it's about installing postmarketOS on a phone. Then yes, you have a regular Linux (although based on mu
by jraph 2y ago
I thought it was about installing Docker on Android, but it's about installing postmarketOS on a phone. Then yes, you have a regular Linux (although based on musl, instead of usual glibc) on which you can install Docker.
If you are going to setup a server on a phone, it might indeed be a good idea to avoid Android, mainly because of how aggressive the OOM killer can be with background apps.
On Android, killing a background app is not so much of an issue (caveat: [1]), they are designed for this. But you don't want your service or even your ssh deamon to be killed by Android.
Now, I don't know how running the phone 24/24 7/7 plugged in is going to last in the long run, especially concerning the battery. Has someone tried this?
[edit: see below comments, the post actually advises removing the battery]
[1] https://dontkillmyapp.com/ https://dontkillmyapp.com/
- excalibur 2y agoThis post links to a previous post from the same author concerning removing the battery and running the device without one: https://crackoverflow.com/docs/system_administration/containerization/turn_android_phone_to_batteryless_home_server/ https://crackoverflow.com/docs/system_administration/contain...
- jraph 2y agoAh, nice. I had skimmed the article and didn't read the intro. This is pretty cool. I could be interested in using my PinePhone like this. Its battery is removable and the phone can be started without it, but the Wi-Fi / Bluetooth module won't run without it. I had the idea of faking the battery like this, but I don't have the skills to handle hardware like this.
- chainingsolid 2y agoYou could just plug the phone into a small usb-c hub and plug some usb wifi dongel or ethernet cord into it. Not sure if that would solve your use case.
- jraph 2y agoYep, it could work, and I happen to have such a hub (it came with the PinePhone). I think the PinePhone is able to receive power AND do USB OTG at the same time, to be confirmed. To be completely honest, what I had in mind was to use it as a Bluetooth receiver to play music using my dumb speakers. I don't have a Bluetooth receiver and at this point if I have to buy something I might be better off buying some off the shelf device to do this. So the status quo is to just plug a laptop the times I want to play music in this room because I don't care that much about it.
- matthewaveryusa 2y agoI've heard that it's a terrible idea with the battery still in. Curious why this is a non-issue for a UPS -- is it the scale, type of battery (lithium ion vs lifepo4), quality, charge cycle, a bit of all of the above?
- selectodude 2y agoIt’s not a non-issue. UPS batteries have a rather short lifespan.
- HPsquared 2y agoThat's surprising. My laptop battery is like 10 years old and still fine. Light usage and mild storage conditions. Surely UPS batteries are similar.
- pmontra 2y agoMy UPS manual says 3 years. They have a different chemistry than phone batteries. On the other side, they should be quite similar to car batteries which could live much longer that 3 years, but they spend most of their time waiting in a parking slot and then a few starts per day or less. An UPS doesn't work like that.
- bityard 2y agoA good UPS will perform regular load tests to gauge battery performance/degradation. They switch over to battery power around once a week and measure voltage before, during, and after. So even if the power goes out, they are still being exercised _somewhat_.
- password4321 2y agoCan you link to one of these on Amazon or your preferred vendor which you recommend for home office use?
- DCKing 2y ago> Then yes, you have a regular Linux (although based on musl, instead of usual glibc) on which you can install Docker. The OnePlus 6/6T are also supported by Mobian [0], which is just regular glibc-and-systemd based Debian, and so a pretty familiar Linux server experience. > it might indeed be a good idea to avoid Android It's a good idea to avoid Android because of kernel security as well. Old Android devices always use out of date Linux kernels even when using custom ROMs, and when running (containerized) network services you really depend on the security of your Linux kernel to keep those things properly isolated. Both PostmarketOS and Mobian do bring current mainline Linux support to these devices, so you can be quite a bit more confident in your kernel that way. It's a shame PostmarketOS and Mobian don't really support many newer devices well. Last I checked the OnePlus 6(T) were still the highest performance devices that had okay support. The Snapdragon 845 - a 2018 flagship SoC - in the Oneplus 6/6T made them real high performance device to repurpose for a long time. In 2024 though it's now beaten in performance by the Raspberry Pi 5 or RK3588 based Armbian based devices. Those SBCs of course already have much better I/O and more straightforward ways to get a supported Linux running on them (and don't require disconnecting the battery with custom soldering). So you need to be really committed to reusing your old hardware to go down this route. [0]: https://wiki.debian.org/Mobian/Devices https://wiki.debian.org/Mobian/Devices
- palata 2y ago> It's a good idea to avoid Android because of kernel security as well. Well it's "just" a matter of updating the kernel, right? Those linux projects like PostmarketOS do a lot of mainlining, which benefits custom Android ROMs. I agree that if the goal is to use the device as an RPi, then it's better to avoid Android. But I wouldn't say that Android is less secure than Linux in general (on the contrary, Android has an interesting security model).
- nurumaik 2y agoHad very old android phone (redmi go) with sim running 24/7 to forward sms OTPs for a month or two Sms forwarder app + tailscale on phone, python script on server that forwarded incoming sms to telegram bot (probably could use webhook to avoid this step though). Worked perfectly with 100% uptime
- anybody8824 2y agoWith the upcoming Android 16 Terminal VM powered by the Android Virtualisation Framework (AVF), it should also be possible to run Docker in an Aarch64 Debian VM similar to WSL2 or ChromeOS crostini. However, this may still be constrained by OEMs restricting access to AVF or by battery enhancements that make it virtually unusable.
- kokada 2y agoThis is one of the things that may make me serious consider another Android tablet (especially one with a nice keyboard+touchpad accessory connected via e.g.: Pogo pins). It would definitely be a game changer, and a high-end Android device could completely replace my current hybrid Chromebook.
- KeplerBoy 2y agoIsn't google merging chromeOS and android anyways?
- Brain_Man 2y agoHow close would this be to native performance? Will it use any hardware features to reduce the emulation overhead if both the host and the guest use the same architecture?
- ForHackernews 2y agoI guess the idea is that you'd do this with an old phone and already-dying battery. It's like having a small raspberry pi style server + builtin UPS.
- rkagerer 2y agohow aggressive the OOM killer can be with background apps This drives me nuts.
- Tade0 2y ago10 years ago I worked at a company which had a fleet of phones to test mobile browser games we were making and the batteries were in noticeably worse shape after a few months of near constant use. Nowadays in most phones you can limit charging to e.g. 80%, which is much lighter on the battery. Additionally, the battery works as a heat sink (or heat store really considering it's just a solid slab of dense material) so expect more throttling when it's not there.
- nine_k 2y agoIf you have an old phone that would otherwise go to garbage, likely its battery is not in a great shape anyway, and server-like loads are mostly incompatible with being battery-powered. I suppose it's going to be permanently attached to a USB power source. Thanks for the heads-up about the thermal inertia of the battery! Maybe a stationary phone in the server role could use a glue-on passive radiator.
- close04 2y agoThe problem isn’t the performance of the battery but the safety. A dead battery for this always-connected use case is probably a non-issue. A swollen battery that could explode or catch fire is definitely an issue. You could take it out but many phones won’t work without a battery so you need to find a way to trick them into thinking one is installed.
- grishka 2y agoYou have to play by Android rules. If you start your daemons from an app that runs a foreground service, I believe this protection would spread to the app's child processes too. Or if you root your phone, you can bypass the activity manager entirely.
- dang 2y agoOk, we changed the title in the hope of making that clearer.
- Suppafly 2y ago>I thought it was about installing Docker on Android, but it's about installing postmarketOS on a phone. That makes the whole thing a lot less interesting. Install linux on a small computer and do linux stuff with it probably wouldn't get clicks.
- jraph 2y agoIt could be about reusing hardware that would otherwise sleep forever in a drawer. This would be commendable.
- deleted 2y ago[deleted]
- greentea23 2y agoYou can run these commands to turn that kill behavior off: setprop persist.sys.fflag.override.settings_enable_monitor_phantom_procs false /system/bin/settings put global settings_enable_monitor_phantom_procs false Termux as an example supports several services that run forever. Works great, sshd and crond don't get killed for example. https://wiki.termux.com/wiki/Termux-services https://wiki.termux.com/wiki/Termux-services Battery wise you can use this app to keep it in a healthy range and temperature indefinitely: https://github.com/VR-25/acc https://github.com/VR-25/acc
- Oxodao 2y agoFor having a sshd server on my phone I do really like this magisk module https://gitlab.com/d4rcm4rc/MagiskSSH https://gitlab.com/d4rcm4rc/MagiskSSH This let me ssh into the real android instead of inside termux, which might be preferable depending on the use case
- squarefoot 2y ago> (although based on musl, instead of usual glibc) For those who never used musl and Alpine Linux (which PostmarketOS is based on), the list of supported architectures and software ported over is quite large; here's a list: https://pkgs.alpinelinux.org/packages https://pkgs.alpinelinux.org/packages Alpine is my distro of choice for very small systems and VMs once I make sure there are no compatibility issues with what I need to install/build, which can happen sometimes but is really rare. The amount of saved resources (CPU, storage) is significant, making it ideal for VMs.
- znpy 2y agothe main issue i see is musl: they have an history of not acknowledging bugs and disregarding standards last big issue i remember is they not implementing fallback-on-tcp when getting large dns record replies, so some dns record resolution would fail. the standard clearly says to switch to tcp under certain conditions, but they did not. the bug was reproduced and reported, they refused to acknowledge it and kept the issue for a lot of people for a long time (at least one year iirc). they eventually relented and and implemented the correct behaviour. call glibc what you want, but at least they don't have such dumb issues and that attitude.
- 3abiton 2y agoYou can always install incus and glibc. Went with musl for voidlinux, and for using certain appimage, I needed to have glibc. It was seemless to install incus, a debian image, and you have unlimited deb packages at your disposal.
- NewJazz 2y agoIs it just that one example? And the situation now is they "relented"? call glibc what you want, but at least they don't have such dumb issues and that attitude. I... Don't know what to say. You really can't think of one decision that the glibc maintainers have made that caused a lot of pain for users? Pretty sure the musl author has/had a blog post full of them. You don't write c library for no reason at all.
- sofixa 2y ago
- j45 2y agoRemoving the battery is ok