Kali Linux

How to Install Kali Linux on Android in Termux without Root

How to Install Kali Linux on Android in Termux without Root

Have you ever imagined running an operating system on your Android phone? Well, that is possible in case you want to use Kali Linux on your phone. Kali Linux is a robust operating system people use for ethical hacking and can become your travel companion if you manage to install it on your phone.

Installing Kali Linux on an Android phone is risky if you root your device because it can void your phone warranty and can damage the operating system. However, with Termux, you can do that easily without root. Termux is an emulator application for an Android phone that doesn’t interfere with your operating system. It is lightweight that helps you install the Kali Linux operating system on Android.

In this guide, you will learn:

Prerequisites for Installing Kali Linux on Android in Termux without Root

To install Kali Linux on Android in Termux without Root, you will require:

  • Termux Emulator
  • LADB Connect
  • VNC Client (Optional if you want to access Kali Linux Desktop)

How to Install Kali Linux on Android in Termux Without Root

You can install Kali Linux in Termux without root by using the following steps:

Step 1: Install Termux on Android

First, you have to install Termux emulator on your Android phone and there are multiple ways to install the emulator on Android. Either you can install the Fdroid application on Android and install Termux through it, or you can simply download the following apk file on your Android and install it.

The apk file for Termux can be downloaded directly from the GitHub website.

Step 2: Open Termux on Android

After installing Termux on Android, you can launch it from the Application menu launcher.

Step 3: Allow Termux to Access Android Storage

You should allow Termux to access your Android phone storage, this can be done by running the following command:

termux-setup-storage

When you execute the above command, an onscreen prompt will appear, simply use the Allow button to give Termux the authority to access your Android storage:

Step 4: Update Packages for Termux

Now, you must update the packages for Termux by running the following command:

pkg update && pkg upgrade -y

Step 5: Install wget Command Line Utility

You should also install wget command line utility using the below-given command, since you will need it later on:

pkg install wget

Step 6: Download the Kali Linux Script

Now, download the Kali Linux script from the GitHub website on Termux using the following command:

wget https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-project/raw/master/nethunter-rootless/install-nethunter-termux

Step 7: Allow Permission to Execute the Script

The script your downloaded require execute permission, which you can do using the following steps:

chmod +x install-nethunter-termux

Step 8: Run the Kali Linux Script

After giving execute permission, you can run the Kali Linux script using the following command:

./install-nethunter-termux

During the installation, you will be asked for some approvals whether to stick with the current packages, you can simply reply with the default option N. Further, the setup process may ask for approval whether to delete the downloaded rootfs file, reply with y to keep the file.

Step 8: Select Kali Linux Version

During the execution of the script, you will be provided with three Kali Linux versions, and you have to choose one to begin the installation.

Nethunter ARM64 (full): It contains a complete Kali Linux distribution for 64-Bit AMD architecture. It is ideal for users who want to utilize full functionality of the Kali Linux system on Android.

Nethunter ARM64 (minimal): It includes smaller sections of ethical hacking tools, ideal for resource-constrained users.

Nethunter ARM64 (nano): It is pretty lightweight and includes limited tools, mainly forced on tasks like wireless attacks.

Here, I am going with installing the full version of Kali Linux with all packages and applications installed, this can be done by entering the number associated with the version.

Once you are done with these options, the process will complete the installation of Kali Linux on your Android phone.

Step 9: Run Kali Linux on Termux

To run Kali Linux on Termux, you can simply use the nethunter command:

nethunter

This will enter into the Kali Linux system, and you can confirm the version by running the following command:

cat /etc/os-release

How to Access Kali Linux Desktop on Android with Termux

To access Kali Linux desktop on Android with Termux, use the following steps:

Step 1: Install Kex VNC Client on Android

First, you must require installing a Kex VNC client on your Android, either you can install bVNC Pro or go with installing NetHunter Keyx. Both applications will allow you to access Kali Linux desktop with kex command.

Note: Here, I have installed bVNC Pro on Android.

Step 2: Create a Kali Linux Session

Now, on Termux, enter the kex command to create Kali Linux session:

kex

Initially, you have to set a password for Kali Linux session and once it is done, the NetHunter Kex will create a server session for your Kali Linux system:

Step 3: Start Kali Linux Session

After, you have created the Kali Linux session on Termux, you can start it from the following command:

kex start

Now, open your preferred NetHunter Kex VNC Client on Android and set the:

  • Connection type as Basic VNC
  • Connection Name according to your choice
  • VNC Server as local host
  • VNC username leave it as empty
  • VNC Password you set previously
  • Port Number as 5901

Once done, save your information using the Save button, then tap on the created session to access Kali Linux desktop on Android:

How to Keep Kali Linux Session Running on Android with Termux

Your Kali Linux session may close after a few seconds, which is frustrating. To keep your Kali Linux session up and running for longer time with Termux, you can use the following steps:

Step 1: Install LADB Connect on Android

First, you must install an application called LADB Connect on Android from the Play Store.

Step 2: Enable Developer Mode on Android

Then enable the Developer mode on Android, in most Android phones, you can find this option in the About section. In some Android phones, you can go to My Phone and then tap on the Build number 7 times for enabling the Developer mode. Then go to System option to see the Developer options.

If you still can’t find the option, check the manual guide based on your phone model to enable developer mode on your Android phone.

Step 3: Run LADB Connect on Android

After enabling the Developer mode, run LADB Connect on your Android phone:

There, you have to enable Connection options like Floating Window, USB debugging, and Wi-Fi Debugging. The first two options can be enabled directly, while after enabling the Wi-Fi debugging, you have to enter the settings to check for the pairing code and port number associated with that code. You can find your pair code and port number inside the Pair device with pairing code option. This information needs to be entered to pair the device with the LDB Connect.

After entering the information, select the “Connect” button to establish connection of Android phone with LADB Connect:

Once the connection is established, run the below-given command in the LADB shell to complete the process:

/system/bin/device_config put activity_manager max_phantom_processes 2147483647

Step 4: Run the Kali Linux Session

Once you are done with the above steps, you can start the Kali Linux session again by using keyx start command. This will enable the Kali Linux session to run for a longer time without sudden stoppage.

How to Fix Repository Update Problem in Kali Linux

By default, you will not be able to run apt commands on Kali Linux terminal, and if you do it, you will encounter the Temporary failure resolving.. Error.

You can fix this error and start updating and installing applications with the apt command using the below-given steps:

Step 1: First enter the Kali Linux terminal as a root user by running the following command:

sudo -i

Step 2: After that, remove the resolv.conf file in the /etc directory from the following command:

rm -rf /etc/resolv.conf

Step 3: Then add the server information inside the resolv.conf file from the below-given command:

echo "nameserver 8.8.8.8" > /etc/resolv.conf

Step 4: Then save the resolv.conf file using CTRL+X, then add Y for approving the changes and press Enter for closing the file.

Once you are done with the steps, you will then be able to update the Kali Linux repository and install applications on your system.

Conclusion

Installing Kali Linux on Android with root can damage your operating system. But, with Termux, you can install it effortlessly without root. This blog has provided a step-by-step guide to install Kali Linux on Android in Termux without root. After that, you will also find a guide on how to access the Kali Linux desktop on VNC client. Apart from that, you will learn how to keep the Kali Linux session up and running on VNC client and the method to fix the repository issue. It will help you install the applications and seamlessly use the operating system on your Android phone.

Similar Posts