Hello Everyone, welcome to my Blog, in today's Article, I'd write on How To Install Kali Linux with Gnome Desktop Interface On Android, read this Article till the end and use all commands as instructed, and you should have no problem at all with this installation, and it is also important that you watch the video Tutorial at the end of this Article for a practical guide on how to do this.
Prerequisites:
Procedures:
Step A - Download And Installation Of Termux
- To install Termux, you have to download the F-droid Application, then Install Termux From F-droid. Click this link to download F-droid
- After installing F-droid Launch The application and Search for "Termux" Terminal Emulator With Packages, install Termux through F-droid and once the installation is complete Launch Termux.
Step B - Upgrade Termux repository And install Necessary Dependencies
Now that termux is installed, give storage permission to it only if it has not been given before, do that with the command below;
termux-setup-storage
After storage permission has been given, update the repository and install Necessary Dependencies with the short command;
apt update && apt upgrade -y ; pkg install wget proot-distro
Step C: installation of Kali Linux And setup
Now that proot-distro is installed, the next thing we do is edit Kali Linux installation Script, do that with the command;
nano $PREFIX/etc/proot-distro/kali.sh
Copy and paste the command below in the script that comes up;
# This is a default distribution plug-in.
# Do not modify this file as your changes will be overwritten on next update.
# If you want customize installation, please make a copy.
DISTRO_NAME="Kali Linux (nethunter)"
TARBALL_URL['aarch64']="https://kali.download/nethunter-images/current/rootfs/kalifs-arm64-minimal.tar.xz"
TARBALL_SHA256['aarch64']="7e17a35e1528a5efc12bf1bbad00a764d38a5724e2b08a226849c594a3b3f029"
TARBALL_URL['arm']="https://kali.download/nethunter-images/current/rootfs/kalifs-armhf-minimal.tar.xz"
TARBALL_SHA256['arm']="62f07cd260cd31e9a84c25a331f3db0278d9ccdeb648522b69382946acdd8581"
TARBALL_URL['i686']="https://kali.download/nethunter-images/current/rootfs/kalifs-i386-minimal.tar.xz"
TARBALL_SHA256['i686']="e83cd8f57d6128efd64e88b191a1653ff315fffd78c05d536d2b6f63b2e6d49d"
TARBALL_URL['x86_64']="https://kali.download/nethunter-images/current/rootfs/kalifs-amd64-minimal.tar.xz"
TARBALL_SHA256['x86_64']="096290b7229ab81f1ac3b35324a7109dc19f1e2f5bf6aab1ff8254ebc95463ea"
"Save the script with Ctrl+o and exit with Ctrl+x"
Now Install And login to Kali with the command;
proot-distro install kali ; proot-distro login kali
The script above will download and install Kali Linux CLI On Your Android device
Step D: installation Of Gnome GUI
Now that you're logged in to your Kali root terminal, use the command scripts below to update your terminal and install Gnome, with it's Dependencies On Kali Linux;
apt update ; apt install gnome-session-flashback gnome-terminal dbus-x11 neofetch firefox-esr -y
The commands above should install Gnome and it's Dependencies On Your Phone.
Step E : Creating A connection Server And logging in To The GUI
On your Kali Terminal create a .vnc directory and edit a xstartup file inside it, do that with the command below.
mkdir .vnc ; nano .vnc/xstartup
Copy and paste the script below in the xstartup file;
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
gnome-panel &
metacity &
gnome-flashback &
"Save the script with Ctrl+o and exit with Ctrl+x"
Give the script an execution permission with the command below;
chmod +x .vnc/xstartup
Now we create a shortcut command to start the Gnome desktop everytime we want to use it, do that with the script below.
echo "DISPLAY=:1 dbus-launch .vnc/xstartup" >> /usr/local/bin/startserver ; chmod +x /usr/local/bin/startserver
Now that that has been done, open a new session to termux (swipe from left to right) and install Xserver, which we will be using to connect everytime we want to. Do that with the commands below;
pkg install x11-repo -y ; pkg install tigervnc xorg-xhost -y ; vncserver -geometry 1600x700 -listen tcp :1 ; DISPLAY=:1 xhost +
Now switch back to your Kali Linux Terminal and connect to the new server we just created with the command :
startserver
Now open your Vnc Application and connect to localhost:1 and your new Gnome-Desktop should be displayed.
Conclusion
By reading through this Article, and using the commands and described above you should have Kali Linux with Gnome installed on your Android Device.
Notes:
It is important to always close every connection you made, when you're done using the GUI, always close connections with the command;
vncserver -kill :1
How to login Again After the first attempt?
Login again by switching a new terminal to termux and enter the command ;
vncserver -geometry 1600x700 -listen tcp :1 ; DISPLAY=:1 xhost +
And switch back to your Kali Terminal and type the command;
startserver