How to Install and run Kali Linux on any Android Smartphone
Have you ever asked can you install any linux distro on you’re phone.?
Yes, Android may be based on Linux, but it’s not based on the type of Linux system you may have used on your PC. You can’t run Android apps on typical Linux distributions and you can’t run the Linux programs you’re familiar with Kali Linux on Android.
Linux makes up the core part of Android, but Google hasn’t added all the typical software and libraries you’d find on a Linux distribution like Ubuntu. This makes all the difference. In a nutshell, Linux makes up the core part on Android. Android is a derived part of linux which makes sense with proper guide yes, we can install linux on android smartphones.
Why You Can’t Run Desktop Linux Software on Android
Because Android doesn’t include a graphical X server or all the standard GNU libraries, you can’t simply run Linux applications on Android. You have to run applications written specifically for Android.
Why You Can’t Run Android Software on Desktop Linux
Linux doesn’t include the Dalvik virtual machine, so it can’t run Android apps. The Dalvik virtual machine and all of Android’s other software can’t simply be dropped onto a desktop Linux machine — you’d have to do more work to make Android apps output to a window on a standard desktop through Xorg.
So what are we waiting for lets begin and start installing a Linux based Distro on the Android phone.
In this tutorial, i’m going to use Debian based Kali Linux operating system. The procedure is almost same for Ubuntu too.
Why Kali Linux?
Kali Linux is preinstalled with over 300 penetration-testing programs, including Armitage , nmap (a port scanner), Wireshark (a packet analyzer), John the Ripper (a password cracker), Aircrack-ng (a software suite for penetration-testing wireless LANs), Burp suite and OWASP ZAP (both web application security scanners).
The developers of Kali Linux aim to make Kali Linux available for ARM devices, We can install and run Kali Linux the hackers favorite os after being replaced by backtrack on our Android devices.
How are we going to run Linux on Android?
Easy, There are a number of free and non-free apps and scripts for Android that allow you to run a Debian Chroot on an Android device.
we have an option of running Linux inside Chroot or outside the Chroot.
Chroot?, A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children”
The scripts start by mounting the Kali Linux image file within the android file system and then mounts the sdcard and if you have it internal memory within the Kali Linux file system.
Chroot is then used to change the root directory to that of the mounted Kali Linux and a bash shell is then opened to allow you to control Kali Linux this is kind of like ‘booting’ the OS.
Things to be done before starting to Install and run any Linux Distubution on Android
- Root the device, ofcorse you need a rooted android device.Rooting is a process that allows you to attain root access to the Android operating system code (the equivalent term for Apple devices id jailbreaking). It gives you privileges to modify the software code on the device or install other software that the manufacturer wouldn’t normally allow you to.
- Make sure you’re device is running Android 2.1 above.
- Check if you’re device supports loop device most of the device does.
- Recommended At least 5 GB free space on internal or external storage.
- A fast Wireless connection (Optional if downloaded the Linux image manually). I would recommend downloading it manually. which does not give out any errors.
- Patience, Yes lot of Patience it took me a week to figure out everything and successfully install Kali Linux on Android. But chances are you can run it without any struggle as you’re reading this article.
Tools and Application you will be required to successfully Install and run Kali Linux and Debug. Just in case something goes wrong.
- SuperSu. is the Superuser access management tool of the future 😉 SuperSU allows for advanced management of Superuser access rights for all the apps on your device that need root. SuperSU has been built from the ground up to counter a number of problems with other Superuser access management tools.
- BusyBox. BusyBox is software that provides several stripped-down Unix tools in a single executable file. It runs in a variety of POSIX environments such as Linux, Android, and FreeBSD
- Terminal Emulator.The terminal (also known as shell and console) is an application in which you can execute commands directly
- JuiceSSH. The JuiceSSH is a ssh client used to connect to the Kali Linux by command line interface.
- VNC Viewer Android VNC Viewer, free download. Android VNC Viewer Connect to your PC remotely via your Android device. Android VNC Viewer is a nice, free app
- Linux Deploy. This application is open source software for quick and easy installation of the operating system (OS) GNU/Linux on your Android device. The application creates a disk image on a flash card, mounts it and installs an OS distribution
- Last, The actual Kali Linux Image of size 2.0 GB Compressed (4.5 GB Uncompressed) with all Security tools installed. You can choose the Light OS if you don’t need security tools pre-installed. Download the File kalilinux.FULL.ext4.20131031.zip
- And Linux complete Installer just in case if Linux Deploy doesn’t work.
Make sure all the six Application and Kali Linux img file has been downloaded. Open SuperSu app and Grant root Permission to BusyBox, Terminal Emulator, and Linux Deploy.
Step by Step Guide to Install Linux on Android.
- Download kalilinux.FULL.ext4.20131031.zip and extract it to the Desktop using you’re favorite compression tool. Inside this zip file there will be two files name Kali_Linux.img and Kali_linux.img.md5 copy the Kali_Linux.img file to the Android Device.
- Create a empty folder in the sdcard or internal storage directory and name the folder Kali put the img file inside the Kali directory. and note down the path where the image file is located you will need it later.
- Navigate to Settings on you’re device and to Developer options and enable USB debugging.
- Open BusyBox App, make sure you had given the root permission for the all the application downloaded in SuperSu. Terminal Emulator and Linux deploy also need root permission.
- Unless you don’t give the root permission for the BusyBox the Application does not open. Once you’re assigned root permission to the App. BusyBox will start Reading and replace android Symlink click on Install to Replace symlink with BusyBox Application.
Next, Click on the Install button. Wait until the BusyBox completes its installation and replaces all system symlink with BusyBox links.
- Now we are done installing BusyBox. Close the Application but do not Unistall the App it will be useful. Now BusyBox had successfully replaced all the symlinks. Open Linux deploy Application and grant it root permission in the SuperSu.
- Click on the Properties button Bottom Left. which looks identical to the Download button. Next will be promted with series of options regarding the type of Installation you need the important would be the Distribution, Architecture,Distrubution suite and Installation path i would recommend leaving others in default.
- Choose the Distribution which in case is we are installing Kali LInux and Architecture which is armhf most of the android is Armhf Architecture devices.
- Choose the Image path and set the Image path to the Location where you have moved the Kali_Linux.img File on the Android device. In this case I had moved it in Sdcard/kali/linux/linux.img. Error in the Path does not display any errors please be careful and set the path properly where is img file is present.
- Installation type are of different types directory,file,partition. Chosing partition could make another ext4 partition in you’re existing fat32 partition. Choosing directory could create all linux directory on a android directory so i would recommend Installation type as File. so that it creates only one file which we could delete it if not necessary.
- Distribution suite are of two types sana which was released last year feb. and then rolling which gets update daily day to day basis. rolling is good with lastest softwares and kali tools updates and hence no bug.
- As the Image boots up we need to access the machine and as we did not undergo installation procedure linux deploy app simply makes it easier for us to access machine using ssh and vnc server only if we had enabled it.Don’t forget to enable SSH and VNC.Enable mount points to mount android file system on linux.
- That’s it in the configuration step now get back. you have two options if you have already downloaded the img file and given the path of the image correct then just click configure and you’re linux should boot up.
- if you don’t have the img file which you did not download it before click on install to download the image file which would take more than 10 minutes depending on the wifi speed. (which in case for me was buggy ssh could not start up and i could not get vnc connection that is why i recommend you to download the image file first)
- Wait till you get the message Deployed.
- Next just simply click on Start to boot Kali Linux. once all the loop device mounts up and ssh and vnc starts without any error. Next step would be simply connect to the Linux System by using VNC viewer or JuiceSSH. I had use JuiceSSH and VNC Viewer for android.
- Open Vnc viewer in the Address form type localhost or 127.0.0.1 or the Ip address displayed on the linux deploy. which is 127.0.0.1::5900 type the password aaa2a710 you will get the Graphical User Interface of the Linux system.
- To access Linux through terminal use JuiceSSH username is android and password is aaa2a710. type sudo -i to get root on the linux system. Now we don’t need to get our laptop to hack anyone we can just do it using our Android phone make sure you’re carrier provides port forwarding.
- Enjoy Hacking and using Kali Linux on android smartphone. Nobody gets to know that you’re trying to hack someone just using you’re android phone. 😀
Conclusion :All the Android devices are not same each device has different options and file systems it took me a week to setup and run Linux on android without any issues I also used bootscript which is from Linux Complete Installer to help figure out the errors Which helped Understand that was facing the mount problem. Possible errors you might end up with
- Cannot execute script because of the permission.
- Cannot find the loop device. Loop Device missing.
- Cannot create loop device.
- Cannot attach img to the loop device.
- Cannot mount loop device.
Every problem has a solution. This were the errors I had overcome while installing the linux by downloading and running it manually. Hope you don’t find any of this errors. Feel free to comment below. Ask me if you need the Updated script of bootscript to find out the errors.