How to re-purpose your old Android phone by running Linux on it | JuniorDev
What is the first thing that comes to your mind when you hear the words,
“ A Tiny and affordable computer that you can use for fun experiments”?
The first thing that came to my mind was Rasberry PI. I was about to order one…, but that’s when I realized that the old phone which I was using as a “media consumption device” (a fancy name for Youtube player), is in fact more powerful than the Rasberry PI…eureka!!
An Old smartphone is tiny and affordable ( affordable because I already own one ) computer, which is exactly what I’m looking for. Now all that’s left is to add the facility to perform fun experiments on it.
Note: For those of who you are wondering “Isn’t android already Linux?”. Android is built on top of Linux kernel, what we are going to do today is run GNU/Linux distro such as Ubuntu to run on android.
How to install Ubuntu Linux in Android ?
You will not require root for this method.
- Install Termux app from the play store. You can learn more about it from here.
- Launch Termux, you will see the terminal window.
- ( Optional, but highly recommended ) Install open-ssh server so that you can connect to your Laptop/Desktop, this will make it easier to type commands. Conversely, you can also use your mobile device as a remote terminal for your Desktop/Laptop.
$ apt update && apt upgrade
$ apt install openssh -y# ssh server is now installed, now it's time to set password
$ passwd# It's time to run the server
$ sshd
ssh server is now running on Termux, check the IP address of the phone using the command ifconfig
. Now you can connect to your android device using the command ssh [IP_ADDRESS] -p 8022
and type the password.
4. Now let’s install Ubuntu, ( Git repo for reference )
$ apt install proot wget git -y
$ git clone https://github.com/MFDGaming/ubuntu-in-termux.git
$ cd ubuntu-in-termux
$ chmod +x ubuntu.sh
$ ./ubuntu.sh -y
$ ./startubuntu.sh
Where to go from here ?
Here’s a list of some experiments that I’ve come up with
- Run a Web server — Install Nginx server and use android phone as a web server.
- Run an Ad blocker for local network — Install PI-hole or Ad-Guard Home and use it to block ads on all devices connected to local network.
- Educational tool-box — Use it as a device for learning Linux command line and programming.
- Hacking…. — Install Kali linux and other hacking tools and use it to learn hacking ( obviously only use it for education ).
Possibilities are limitless, have fun experimenting (^_^)!