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.

Comments

59 responses to “Kali Linux Easy Installation on Any Android Smartphone”

  1. Unknown Avatar

    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.

  2. Kali Linux Avatar

    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

  3. Ryan Avatar

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

  4. Kali Linux Avatar

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

  5. Ryan Avatar

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

  6. Anonymous Avatar
    Anonymous

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

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

  7. Kali Linux Avatar

    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.

  8. Kali Linux Avatar

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

  9. Ryan Avatar

    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 ?

  10. Kali Linux Avatar

    apply following command one by one

    apt install chromium
    chromium

  11. Krishna Avatar

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

  12. Kali Linux Avatar

    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

  13. Nasir Bangulzai Avatar

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

  14. Kali Linux Avatar

    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.

  15. kali linux logout Avatar

    by mistake i pressed logout
    How can i start

  16. Kali Linux Avatar

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

  17. Unknown Avatar

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

  18. Kali Linux Avatar

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

  19. Organicranking Avatar

    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

  20. Any buddy Can do (ABCD) Avatar

    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

  21. Any buddy Can do (ABCD) Avatar

    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

  22. Kali Linux Avatar

    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.

  23. Kali Linux Avatar

    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.

  24. Unknown Avatar

    very very helpful this blogs for me.

  25. Kali Linux Avatar

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

  26. kevin Avatar

    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

  27. Akki Avatar

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

  28. Kali Linux Avatar

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

  29. Anonymous Avatar
    Anonymous

    facing the same problem even after following above steps

  30. Kali Linux Avatar

    You still didn't find the localhost?

  31. Anonymous Avatar
    Anonymous

    yes

  32. Anonymous Avatar
    Anonymous

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

  33. Kali Linux Avatar

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

  34. Anonymous Avatar
    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?

  35. Kali Linux Avatar

    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.

  36. Anonymous Avatar
    Anonymous

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

  37. Anonymous Avatar
    Anonymous

    Pls explain the process for the same.

  38. Kali Linux Avatar

    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.

  39. Naser Avatar

    Any hack any thing

  40. Sandeep Singh Avatar

    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

  41. Kali Linux Avatar

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

  42. L E G E N D S Avatar

    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

  43. Rahul Avatar

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

    Above error coming on every command

  44. Kali Linux Avatar

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

  45. Anonymous Avatar
    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

  46. Kali Linux Avatar

    It's our pleasure.

  47. kavindu yeshan Avatar

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

    (Set tool, firefox browser…..)

  48. Kali Linux Avatar

    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

  49. ALLofit Avatar

    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

  50. darkRai Avatar

    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!

  51. Unknown Own Avatar

    sir vnc server connect nhi ho rha

  52. Kali Linux Avatar

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

  53. jopamungkas Avatar

    Get error when run VNC server,

  54. Kali Linux Avatar

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

  55. Spyzie Avatar

    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

  56. Spyzie Avatar

    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

  57. Anonymous Avatar
    Anonymous

    How fix black screen

  58. Anonymous Avatar
    Anonymous

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

Leave a Reply to darkRai Cancel reply

Your email address will not be published. Required fields are marked *