Kali Linux Easy Installation on Any Android Smartphone

Kali Linux Easy Installation on Any Android Smartphone

In some condition, in the way of pentest, a client may ask us to do a proper hacking attack in his own field. In that kind of case walking on a office or corporate environment with a laptop in hand may look suspicious, we need something more handy. Some small devices like cell phones or Raspberry Pi and using it to perform some cool attacks on their network.

In this tutorial we learn how we can install Kali Linux in Android smartphone without root and not using PC emulator.

There are many ways to install Kali Linux in android smartphone. If we have rooted android then we can install Kali NetHunter in supported devices, but in the case of non-rooted user there are only few ways are available. We can use PC emulator to install Kali Linux in non-rooted phone, but that process is very slow and PC emulator uses much resources of a phone. In this tutorial we learn an easy process, in this process we learn to install Kali Linux and other Linux distributions in mobile phone and smoothly run them.

Let’s start,
We need some apps to install Kali Linux in our mobile phone. Those are

  1. Termux
  2. VNC viewer
  3. AnLinux

This apps are available in play store we need to install all these apps.

kali linux on android

Then first we open AnLinux app and it will open it’s dashboard. Like following picture:

kali linux on android

Then we need to choose the Linux distro we want to install. We can install multiple distro without conflict, but here we only install Kali Linux. So we tap on choose and select Kali and click on “OK”.

kali linux on android

Then we click on copy. The commands are copied on our clipboard. Then we click on lunch button, lunch button will start Termux app.

Now long press and paste copied commands in Termux and press “Enter“.

kali linux on android

Then it will install required packages and one script will download and execute automatically, it will take time depending on our internet speed.

After finishing this step we need to run Kali Linux bash script by using following command:

./start-kali.sh

Now we can see the Kali Linux terminal root@localhost as following screenshot.

kali linux on android

Now we check the Linux distribution by using following command :

cat /etc/issue
kali linux on android

We can see the distro is Kali Linux Rolling.
To check the version of Kali Linux we run following command:

cat /etc/os-release
kali linux on android

Now we can see the version of our Kali Linux in the above screenshot.

In this Kali Linux system we can run any Kali Linux command, but in this distribution we did not get any pre-installed tool, we need to install our tools manually.

Here we update and upgrade our Kali Linux in our Android smart phone. To do that we apply following command:

apt-get update && apt-get upgrade

The screenshot is following:

kali linux on android

This process will take some time. After updating we can install any tool. In this tutorial we install nano text editor as example.

apt-get install nano

Yeh, now we are all done. Kali Linux is in our android smartphone. But it is in command-line interface (CLI). Some of us will prefer Graphical User Interface (GUI). GUI setting up Kali Linux in Android smartphone is very easy.. We need to install a desktop environment. To install and configure desktop environment we need to go go again in AnLinux application and click in the menu as shown in following screenshot.

kali linux on android

Then we need to choose our desktop environment. Then we choose for which Linux distribution we are using. Here we choose Kali Linux.
Then we got list of desktop environments, we choose xface4, this is recommended. Then we need to click on copy to copy those commands to install and configure Kali Linux’s xface4 desktop environment.

kali linux on android

Then we open the Kali Linux’s CLI in Termux and paste the copied command in clipboard. Here remember one thing we did not pasting the commands in Termux , we are pasting it in Kali Linux , and that Kali Linux is installed under Termux. Then xface4 desktop environment and VNC server will downloaded and configured automatically.

This will download and configure automatically.

kali linux on android

This will download 200 MB of data and almost 700 MB of disk space in mobile. This process also take some time depending on our phones performance and internet speed.

We need to configure between this process, it will prompt for keyboard layout etc, and we need to set the password for VNC server and choose n for no in the in the view-only password field.

After this we can access Kali Linux’s Graphical User Interface via VNC viewer application, because this will automatically start VNC server.

We need to open VNC viewer application and we click on the “+” sign to add a new connection.

Here in this field we type the address and display number in our case that is localhost:1 as following:

Then we click on next and type a name for our new computer, choose anything and click on Done.

Then we click on connect. Then we click “OK” in unencrypted connection bar. Next we need to type the password as we set before, then click on done.

Yap it’s really done. The Kali Linux GUI will appear in front of us.

But this can’t comes with any pre-installed tools, we can add required tools manually. For an example we can install metasploit framework by using following command:

apt-get install metasploit-framework

The screenshot is following:

kali linux on android

Yes we have successfully installed Kali Linux in our non-rooted Android smartphone.

But how to open it again?
We just need to open our Termux and type following command:

./start-kali.sh

Then the CLI version of Kali Linux will open. Then we start the VNC server by applying following command :

vnc server-start

Then we open VNC viewer app and connect with our previous connected computer, and we got the GUI of Kali Linux again atfer typing the password of VNC server.

Sharing is caring.
So please don’t forget to share this post.

We can also install Kali Linux on cloud and network follow this guide.
For more follow us on Twitter and Medium.

KP AKA Koushik Pal is a Security researcher and specialist focused on educating about Linux for cybersecurity and URL‑masking vulnerabilities. Creator of MaskPhish, a well‑known open‑source bash-based URL‑masking tool. Linux enthusiasts Active speaker, trainer, and advocate for secure web practices.

60 comments

comments user
Unknown

Had many issues after this tutorial just before had to rm udisks2 then dpkg –reconfigure for things to work, afterwards i was able to setup the vncserver, when trying to connect with vncviewer am getting connection closed unexpectedly, tried apt-get update && apt-get upgrade but everything seems to be updated with no errors, any ideas what might be the problem? knowing that am prompt to fill the password and right after am getting the problem mentioned earlier.

comments user
Kali Linux

You might be have some error in desktop installation. You can try following commands:

sudo apt install udisks2
sudo rm /var/lib/dpkg/info/udisks2.postinst
sudo dpkg –configure udisks2
sudo apt install xfce4

comments user
Ryan

Can i connect to other phone which kali is installed with vnc viewer ? If yes how .

comments user
Kali Linux

Thanks for your comment Ryan..I don't think it's possible in Kali hosted on termux.

comments user
Ryan

Hi again .
How to get the web browser ? I can't open it .

comments user
Anonymous

I tried to install vnc but after downloading i get this error

/usr/local/bin/vncserver-start: line 4: vncserver: command not found

comments user
Kali Linux

Hey Ryan, here we are using non rooted device.. Then firefox might not work try install chromium by using
apt install chromium
then run it using chromium command.

comments user
Kali Linux

Thanks for your comment…This error usually occur when vncserver does not installed successfully… uninstall it and then install it again..

comments user
Ryan

1st my default web browser doesn't work . It said fail to execute default web browser.
2nd it wants to install chromium-bsu and after download how can i open it ?

comments user
Kali Linux

apply following command one by one

apt install chromium
chromium

comments user
Krishna

Actually when i tried mate terminal is showed a green desktop with no menu or taskbar. Please help me with it

comments user
Kali Linux

Hi Krishna,Thanks for your comment. We did not got you clear. Did you trying to auto-hide things ?

Press alt+f2 and type following (try hacker's keyboard for alt button..this keyboard is available in play store):

mate-terminal

Then the terminal will come, then type following:

mate-panel –reset

comments user
Nasir Bangulzai

Hello dear plz ask me how to hack wifi password on Android mobile phone in kali linux????

comments user
Kali Linux

Thanks Nasir for your comment. This is possible when you are in Kali Nethunter with supported devices. There is another way we can use WIBR+ or some other apps to brute-force WiFi passwords, but it works on only easy passwords.

comments user
kali linux logout

by mistake i pressed logout
How can i start

comments user
Kali Linux

close those apps. and open termux again and type following command
./start-kali.sh

comments user
Unknown

Which keyboard layout we select . When I am selecting 1 ,when we entering password keyboard was not working ,plz reply me

comments user
Kali Linux

try other keyboards. during the tutorial we have used gboard. You also can use hacker's keyboard.

comments user
Organicranking

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Download prince of persia iso ppsspp

comments user
Any buddy Can do (ABCD)

Sir,
When I open vnc viewver and I put detail in the vnc
Vnc viewer ask me (the port on which the computer is listenings for a connection could not b contacted)
What should I do

comments user
Any buddy Can do (ABCD)

Sir,
When I open vnc viewver and I put detail in the vnc
Vnc viewer ask me (the port on which the computer is listenings for a connection could not b contacted)
What should I do

comments user
Any buddy Can do (ABCD)

How to find localhost

comments user
Kali Linux

when the VNC server strars it will show the localhost:1 or localhost:2 where our VNC server is running. Usually it shows localhost:1 we just need to add it on VNC viewer application as shown in above article please read it carefully.

comments user
Kali Linux

dpkg a été interrompu, vous devez exécuter manuellement 'dpkg –configure -a' pour corriger le problème.

Suivez simplement ce qu'il dit, exécutez: dpkg –configure -a pour le corriger et réexécutez la commande.

S'il n'est pas résolu, essayez de tout effacer pour un nouveau départ.

comments user
Unknown

very very helpful this blogs for me.

comments user
Kali Linux

Thank you for this comment. This type of comments always inspired us to perform better.

comments user
kevin

In the event that the moment apps will perform well, it is probably going to get a great deal of progress gaming apps with large APK size.itools crack 2020 activation key

comments user
Akki

Hii….can I get some more commands to install other tools…othert metasploit??

comments user
Kali Linux

yes, all commands will be same as we install tools in Kali Linux PC version.

comments user
Anonymous

facing the same problem even after following above steps

comments user
Kali Linux

You still didn't find the localhost?

comments user
Anonymous

yes

comments user
Anonymous

first thank u,and can i use the same commands from the real kali linux?plz reply me

comments user
Kali Linux

Yes you can use real Kali Linux commands like nmap, msfconsole, wireshark etc.

comments user
Anonymous

i've installed kali linux using termux and i'm using using gui through vnc. Is there a way to use kali linux by installing it on android (via termux, offcourse) and instead of using vnc viewer on android to get gui, we could use vnc viewer on pc, say Windows 10, for gui on a local network or via internet? I mean, installing kali on android as usual via termux and then forwarding the gui component to another pc via vnc, instead of forwarding on the same android phone?

comments user
Kali Linux

Yes we can do this local network. In this case we need to use the local IP of Kali in android in our PC's VNC viewer. It is possible but it is not worthy when we already own a Windows PC. There is lots of ways to installing Kali Linux on Windows system, that might be more powerful from an Android device.

comments user
Anonymous

Can u please explain how to do it in detail? I just want to give it a try for learning purpose.

comments user
Anonymous

Pls explain the process for the same.

comments user
Kali Linux

did you ever used raspberry pi. We use raspberry pi computer headless (without display) and display it on our PC or Mobile via ssh connection. Search this topics on Google or Youtube you will get it.

comments user
Naser

Any hack any thing

comments user
Sandeep Singh

dear sir,
my self sandeep singh
i did all setup and CLI mode work fantasticly but after step gui vnc can't connet with server what can i do for this error

comments user
Kali Linux

Hi, Sandeep
We will help you in this matter can you please explain what kind of error you're getting?

comments user
L E G E N D S

Android operating system has been designed primarily for touchscreen mobile devices such as smartphones and tablet computers. Developed Initially by Android, Inc., backed financially by Google (later bought by Google in 2005), Android was unveiled in 2007 along with the founding of the Open Handset Alliance (a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices) Android is the buzz word in technology today with a market share of 42% across various devices worldwide. Mod Apk Download

comments user
Rahul

E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

Above error coming on every command

comments user
Kali Linux

Some services is already running. You can try restarting. If not work try this

comments user
Anonymous

Thanks for your hardworking man, honestly i am newbie in kali linux but in your tutorial i 've fast to understand and learned a lot. thanks man

comments user
Kali Linux

It's our pleasure.

comments user
kavindu yeshan

After installation how to install tools / application for it please explain

(Set tool, firefox browser…..)

comments user
Kali Linux

Like we did in full Kali. If you want to install Firefox then you need to run following command:
sudo apt-get install firefox-esr

comments user
ALLofit

Can I be able to install it and run on android version 10 in realme device and if yes then are the application like metasploit will run as it run on pc

comments user
darkRai

Yes, you can run Metasploit on this. I use a realme android 10 snapdragon device and it works good. I use metasploit all the time for payload creation and meterpreter seasons, I also able to search for exploits and auxiliaries on msfconsole, only one problem is we can't get the database support with mobile devices metasploit.

But why this type of installation ? I mean this Kali installation is good, but there is official Kali nethunter for non-rooted phones. You should chack this out!

comments user
Unknown Own

sir vnc server connect nhi ho rha

comments user
Kali Linux

Hey, this is a old method. You can try official kali nethunter-rootless.

comments user
jopamungkas

Get error when run VNC server,

comments user
Kali Linux

Can you please explain the error, then only we can help you. Thanks.

comments user
Spyzie

The instruction was successful. Ensure to have a smooth working internet connections.. Although I didn't use the vncviewer, rather I used a similar app available in f droid, as my connection base.. Nethunter kex

comments user
Spyzie

The installation was successful and completed. For a smooth installation, ensure to have a working internet connection. At least 4G network and you're good . Although I couldn't install the vncviewer properly, instead I installed another connection base. Nethunter kex

comments user
Anonymous

How fix black screen

comments user
Anonymous

Thanks for your comment but please ask us cybersecurity related questions. We are not expert on repairing devices.

comments user
Blake

Hello! I could have sworn I’ve been to this blog before but after reading through some of the post I realized it’s
new to me. Nonetheless, I’m definitely glad I found it and I’ll be book-marking and checking
back frequently!

my web blog; Tangkasdia

Post Comment