Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to host (run Linux distro) on non-rooted Android phone
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to host (run Linux distro) on non-rooted Android phone

romanzromanz Member
edited September 2020 in Tutorials

You probably have older phone in your drawer, or there is plenty of phones with cracked screens on craigslist or ebay with good CPU for close to nothing. Here is simple way to turn Android phone to Linux device without rooting.

Go to PlayStore and install "UserLAnd" app.

https://play.google.com/store/apps/details?id=tech.ula

Select your distro to install. You can choose full desktop environment (vnc) or just the server version (ssh). It takes some time to install.

For those that like to dig in source code: https://github.com/CypherpunkArmory/UserLAnd

Phone IP can be found under System -> About Phone. UserLAnd SSH uses the port 2022 by default. Once you get to the SSH session, you can do:

sudo su
apt-get update
apt-get upgrade
apt install nano apache2 php mariadb-server

then change ports in /etc/apache2/ports.conf, because the Linux runs on top of your Android in its userspace and has no access to privileged ports. Then restart apache

service apache2 restart

Problems

All these problems are related to reboot.

  1. on my setup, apache2 failed to start automatically, needed to be restarted manually

  2. phone does not start automatically when charger is connected. This can be changed by resetting the "off-mode-charge" flag to zero with fastboot tool.

Unfortunately my old Pixel1 was locked and did not allow me to change the flag. However, as long as the outage does not last longer than battery or phone does not crash, should not be big deal.

  1. Not sure how to start UserLAnd session automatically after reboot. The app seems to be somewhat running after reboot, but the session is not started.

Todo

After succesfull phpinfo(), host an actual non-trivial website

Setup wireguard tunnel to external VPS with static IP, that exposes the container to the world

Take a benchmark test and compare with actual real hosting VPS.

Thanked by 2dedipromo vimalware

Comments

  • Cool.
    I have tried it before using termux, ssh server and apache server work fine.
    I have the wireguard settings too, but it still doesn't work. Even though I have set NAT in my VPS.
    Ngrok not working too.

    Thanked by 1romanz
  • raindog308raindog308 Administrator, Veteran

    Looking forward to seeing offers.

    “Hosted on Samsung gear using premium micro-SD...”

  • yokowasisyokowasis Member
    edited September 2020

    I prefer andronix. If you just want to run lamp stack, you don't even need Linux distro. Termux can run just fine

    Thanked by 2romanz vpsGOD
  • One more vote for termux.
    You can start any service on startup, also you can set a cronjob for this.
    P.S.: If you can find old termux:api (0.31) you will have more control.

    And could you give information about the latest situation in the future?

    Thanked by 1romanz
  • as a warning, please try to run servers on phones with removable batteries...

  • SD cards are basically biggest bottleneck right now

  • @codelock said:
    SD cards are basically biggest bottleneck right now

    Some hosts that offer mass scale Raspberry 4 hosting use network storage instead of SDs due to high failure rates.

    In my opinion internal phone storage is sufficient for most applications. On my Google Pixel1 with Debian I measured:

    1) 110MB/s (dd if=/dev/zero of=/tmp/test1.img bs=100M count=1 oflag=dsync)
    2) 801MB/s (dd if=/tmp/test1.img of=/dev/null bs=8k)
    3) 286kB/s (dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync)

    on Ryzen 9 3900X VPS the values were

    1) 415MB/s
    2) 824MB/s
    3) 219kB/s

  • @romanz said:

    @codelock said:
    SD cards are basically biggest bottleneck right now

    Some hosts that offer mass scale Raspberry 4 hosting use network storage instead of SDs due to high failure rates.

    In my opinion internal phone storage is sufficient for most applications. On my Google Pixel1 with Debian I measured:

    1) 110MB/s (dd if=/dev/zero of=/tmp/test1.img bs=100M count=1 oflag=dsync)
    2) 801MB/s (dd if=/tmp/test1.img of=/dev/null bs=8k)
    3) 286kB/s (dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync)

    on Ryzen 9 3900X VPS the values were

    1) 415MB/s
    2) 824MB/s
    3) 219kB/s

    We were talking about old phones So they probably have very less storage for example I have a android 5 phone lying around which i don't connect to internet and use for 2fa and password storage it has 3 gb ram and generic arm quad core but only has like 3gb of free storage from its 8gb internal.
    Modern phones might not need sd card expansion probably that's the reason many stopped including a sd card slot but,old phones were always out of storage space.

    Can you remember the last time you wanted to install an app from playstore and it prompted you to uninstall a few apps to make room for new one ,? Smartphone storage had come really long way.

    Now my phone can hold about 50 1080 p H.265 full length movies and that is a really big thing.

  • New summer host can now offer 'remote android linux' VPS :p

  • Stop trying to cure my VPS addiction.

  • very cool, setup a old htc with tinyproxy & ad blocking hosts file, performance is pretty great surprisingly.

Sign In or Register to comment.