Skip to content

Instantly share code, notes, and snippets.

@HimDek
Last active December 12, 2025 07:55
Show Gist options
  • Select an option

  • Save HimDek/49a3cd23e9a931eb8920423a0fb3668a to your computer and use it in GitHub Desktop.

Select an option

Save HimDek/49a3cd23e9a931eb8920423a0fb3668a to your computer and use it in GitHub Desktop.
This Guide will help you install Kali Linux in Android, that too with a GUI Desktop Environment within Android. It uses Termux to run Kali Linux in Android with XFCE4 Desktop Environment and a Tight VNC Server, which we connect to using a VNC Viewer app in Android.

How to install Kali Linux GUI Desktop in Android using Termux:

This Guide will help you install Kali Linux in Android, that too with a GUI Desktop Environment within Android. It uses Termux to run Kali Linux in Android with XFCE4 Desktop Environment and a Tight VNC Server, which we connect to using a VNC Viewer app in Android.

Just Follow these steps to install Kali Linux with XFCE4 Desktop GUI in Android using Termux:

  • Download and install Termux in Android. (Play Store release is no more updated, so is not recommended.)

  • Open Termux and run the following commands:

    apt update && apt install python python2 openssh -y
    pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Kali/kali.sh && bash kali.sh
    ./start-kali.sh
    
  • After completion of the above steps, you will be in Kali Linux Shell. Run the following commands in the Kali Shell:

    wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/DesktopEnvironment/Apt/Xfce4/de-apt-xfce4.sh && bash de-apt-xfce4.sh
    vncserver
    
  • When it asks, Create and confirm a new password and remember it. You will need it to login in later steps.

  • After setting the password, run the following command:

    vncserver -kill :1
    rm -f ~/.vnc/xstartup
    echo -e '#!/bin/bash\nxrdb \$HOME/.Xresources\nstartxfce4 &' > ~/.vnc/xstartup
    sudo chmod +x ~/.vnc/xstartup
    vncserver
    
  • Let Termux run in background by pressing HOME button in Android.

  • Install VNC Viewer in Android and open it.

  • In VNC Viewer, press the + button in the lower right corner.

    • Under Address type localhost:5901.
    • Under Name type any name that you want to show in the app.
    • Press Create. An Entry by the name you entered will appear.
  • Press the entry you just created in VNC Viewer.

  • Type in the password that you created in a previous step (Turn on the Remember password slider if preffered) and press continue in the upper right corner.

  • You will soon be in your Kali Linux XFCE4 Desktop Environment.

How to stop the session:

Once you have done working(hacking) using Kali-Linux, follow these steps to stop the session:

  • Swipe down from the top of the VNC Viewer app and tap the cross (X) icon.
  • Tap Disconnect when it asks you about being sure to disconect.
  • Now close the VNC Viewer app.
  • Then open Termux that was running in background.
  • To kill the VNC Server in Kali and exit from Kali, run the following commands:
    vncserver -kill:1
    exit
    
  • To exit from Termux, type exit and press Enter.

How to start a new session:

To start a new session if the installation part is already done, follow the following steps:

  • Open Termux and run the command, vncviewer.
  • Let Termux run in background by pressing HOME button in Android.
  • Open VNC Viewer and press the entry that you created during installation.
  • Type in the password created during installation (Turn on the Remember password slider if preferred) and press continue in the upper right corner.
  • You will soon be in your Kali Linux XFCE4 Desktop Environment.
  • Click here to see how to stop the session.
@Artmoby7674
Copy link

I get a 404 not found with raw.githubusercontent.com

@Rahul142536
Copy link

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

@wanhear
Copy link

wanhear commented May 17, 2025

I need help I installed Kali on my laptop... in terminal i pressed sudo apt install and it wants my password... but the white bar doesn't move. I need help

Password is usually hidden in Linux.

@hola-s
Copy link

hola-s commented Oct 12, 2025

⅕.The url in kali linux is error
Ex: apt update
Tôi đề xuất bạn sửa url bằng lệnh này
echo "deb [trusted=yes] http://http.kali.org/kali kali-rolling main non-free contrib" > /etc/apt/sources.list

@hola-s
Copy link

hola-s commented Oct 12, 2025

⅖.Next
Command "su" is error
Fix: echo 'sudo -i' > /usr/local/bin/su
chmod +x /usr/local/bin/su

@hola-s
Copy link

hola-s commented Oct 12, 2025

⅗.Setup vnc:
1.apt install xfce4 xfce4-goodies tigervnc-standalone-server -y

2.mkdir -p ~/.vnc
echo "startxfce4 &" > ~/.vnc/xstartup
chmod +x ~/.vnc/xstartup

3.vncpasswd
Setup the password

4.vncserver :1

@hola-s
Copy link

hola-s commented Oct 12, 2025

⅘.stop vnc using vncserver -kill :1

@hola-s
Copy link

hola-s commented Oct 12, 2025

if you get this error
1000020033

@hola-s
Copy link

hola-s commented Oct 12, 2025

⅚.using command:
1.apt update
apt install dbus-x11 -y

2.export $(dbus-launch)

  1. edit using nano "nano ~/.vnc/xstartup"
    Delete all and paste commad:#!/bin/sh
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    export XKL_XMODMAP_DISABLE=1
    dbus-launch startxfce4 &

4.save and chmod +x ~/.vnc/xstartup
vncserver -kill :1
vncserver :1

@hola-s
Copy link

hola-s commented Oct 12, 2025

1000020034

@hola-s
Copy link

hola-s commented Oct 12, 2025

Start kali linux using ./start-kali.sh

@Maxrion2
Copy link

Maxrion2 commented Oct 12, 2025 via email

@haramali45
Copy link

When setting up Kali Linux with a full XFCE desktop in Termux, users often look for lightweight tools that make complex tasks easier—especially when working on mobile devices. Just like a VNC viewer simplifies remote desktop access, there are online resources that simplify everyday calculations as well. For instance, if you're handling work-related documentation or planning finances, using a final settlement calculation uae tool can help you quickly estimate end-of-service benefits without switching between multiple apps or manual formulas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment