This page was already viewed 276times
This tutorial was made using a Samsung Galaxy S4 - ROM V4.2.2, but is possibly working with various other configurations.
There are few things you must be aware of before installing Ubuntu/Debian on youe Android Phone.
Ubuntu does not support earlier ARM CPUs like the ones used in the Motorola Cliq. Samsung Galaxy Fit (ARMv6), Samsung Galaxy Y, etc... The reason behind this is that your Android OS Kernel must support loop devices. Hopefully, most newer Android smartphones/tablets come with this support so we can mount our image as a loop device.
If not, you will either have to build your own kernel with support for loop devices or you can try an aftermarket ROM for your phone as most aftermarket ROMs come with support for it.
You need at least an ARMv7 CPU like the kind found in the Motorola Droid, Samsung Galaxy S,HTC EVO 3D, Sony Experia Play, etc. most newer phones (Hummingbird, Snapdragon, Tegra2, etc.).So you can Install Ubuntu if you have ARMv7 or newer Processor. If you have ARMV6 or any other moderate Processor don't be sad, because Debian supports the CPU on practically all Android devices, so if you prefer Debian, or you can't run Ubuntu, choose the Debian download link.
If you're not sure what CPU your device has, look up your device on http://pdadb.net/, click the link under CPU, and read the line for "Supported Instruction Set(s)".
Read this article to get to know how to root your smartphone.
This Android app will help you know to check if your device is rooted.
*The SuperSU application (for rooted smartphones)The SuperSU app or equivalent providing the 'su' tool.
*3GB of free spaceFor the good conduction of this tutorial it is necessary to prepare a 'root' folder for our debian distribution with (at least) 3 GB of free space. This free space can be stored on an internal memory or even external SD card.
Once this folder was created, be sure to remember the resulting path on your device as it will be required further. As an example, the "/storage/extSdCard/root" path will be used in this tutorial.
*A terminal emulatorIt is required to download and install an Android Terminal Emulator.
*The Busybox toolboxYou have to download (and install) the Busybox toolbox. After launching it for the first time, select "system/xbin" as the installation folder.
*Allow "unknown sources" on your deviceYou may found here more details about the procedure to allow "unknown sources".
Clic here to download the resource (Linux Debian 6.0 Squeeze).
*Prepare the resourceFirst of all, mount the SD card on your computer. then, extract the .tar.bz2 file you downloaded to your SD card. You should now have a folder named "linux" on the root of your card.
Finally, unmount the sdcard and replace it in your Android Smartphone. The following operations will be done via a terminal emulator directly from your android smartphone.
*Move the resource to the working foldermove the "linux/" folder from the downloaded archive file into the debian root folder mentioned at the begnning of this article (the "/storage/extSdCard/root/" folder).
You have to modify the $sdcard variable of the files install.sh, ssh.sh, vnc.sh and scripts/linux for matching with your root folder (my path is: /storage/extSdCard/root/linux/).
sdcard=$(readlink -f /storage/extSdCard/root)
sdcard=$(readlink -f /storage/extSdCard/root)
sdcard=$(readlink -f /storage/extSdCard/root)
sdcard=$(readlink -f /storage/extSdCard/root)
In other words, the first line of each of those files shall be: sdcard=$(readlink -f /storage/extSdCard/root)
The file install.sh (in this example at: /storage/extSdCard/root/linux/install.sh) shall be modified.
The existing instruction (more or less at lines 12-14):
sh $kit/scripts/fsrw
shall be replaced by this following new content:
busybox mount -o remount,rw /system*Patch of the scripts/linux file
The file scripts/linux (in this example at: /storage/extSdCard/root/linux/scripts/linux) shall be modified.
The existing instruction (more or less at line 40):
mount -t ext2 -o relatime $loop $mnt
shall be replaced by this following new content:
busybox mount -t ext2 -o relatime $loop $mnt
Launch the previously installed terminal emulator app and run the following commands:
user@android:#suroot@android:#sh ~/root/linux/install.sh
If no error occured, the installation of the resource is done!
3 possible ways of running and accessing this chrooted system is offered to us: the 'command-line', 'ssh' and 'vnc' ways.
Open the terminal emulator app and execute the following commands:
user@android:#suroot@android:#linux
If everything worked, you should notice that your prompt path has changed meaning that you are now under the chrooted system. As verifications, you may execute the following commands:
*SSH Accessroot@linux:#uname -aroot@linux:#pwdroot@linux:#idroot@linux:#ls /
Open the terminal emulator app and execute the following commands:
user@android:#suroot@android:#linux SSH
You should now be able to connect to to the system using your favorite SSH client application.
*VNC AccessOpen the terminal emulator app and execute the following commands:
user@android:#suroot@android:#linux vnc
The first time you run it, you will be prompted to create a VNC password. If you forgotted your password after multiple executions, you will have to redo Step 4: System installation.
Next, you may download a VNC client app on your device and connect to the debian system with the following informations:
If you are interested by going deeper in this subject, you may have a look of various existing and promising projects like Linux deploy, kali-NetHunter or Ubuntu on android project