Boot the Kali-Linux OS
you can download the kali linux pi image from Here, and documentation : https://www.kali.org/docs/arm/raspberry-pi-5/
Using Pi Imager flash the SD card with OS, config settings like SSH (must).and config WiFi network and give a hostname
SSH into Kali-Pi
login to your wifi admin pannel, mine is most prolly you can access that via https://192.168.1.1 (DYOR). then go to connected devices/ wireless devices and get the pi IP. cuz u cant use hostname for now. then ssh into the device
ssh 0xNeoByte@192.168.1.6
then enter the password and continue.
Enable mDNS to use hostname
it is much easier if we can use hostname to log into kali as ip changes everytime it connect to wifi. so we can install avahi for that.
sudo apt update
sudo apt install avahi-daemon avahi-utils
# enable and start avahi-daemon
sudo systemctl enable avahi-daemon
sudo systemctl start avahi-daemon
verify is avahi running by :
sudo systemctl status avahi-daemon
install VNC server and setup (headless setup)
- install the VNC server, Kali comes preinstalled with tightvncserver as the default VNC server. If it’s not installed, install it:
sudo apt update
sudo apt-get install tightvncserver
- Set the VNC Password
vncpasswd
- You will be prompted to enter and confirm a password.
- This password will be used to connect to the VNC server.
- press
n
for view only
- start the vnc server
vncserver :1
## Stop for more configuration
vncserver -kill :1
- Make VNC Server start at boot
sudo nano /etc/systemd/system/vncserver.service
[Unit]
Description=Start VNC Server at Display :1
After=network.target
[Service]
Type=forking
User=0xneobyte
Group=0xneobyte
WorkingDirectory=/home/0xneobyte
ExecStart=/usr/bin/vncserver :1
ExecStop=/usr/bin/vncserver -kill :1
Restart=on-failure
[Install]
WantedBy=multi-user.target
#Reload systemd and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable vncserver.service
# Start the service now to test it, u may get an error while starting but reboot and then try again. (it's because vnc server was already running i guess)
sudo systemctl start vncserver.service
# Check the status to ensure it’s running:
sudo systemctl status vncserver.service
sudo reboot
# Status should look like this :
┌──(0xneobyte㉿0xNeoShell)-[~]
└─$ sudo systemctl status vncserver.service
[sudo] password for 0xneobyte:
● vncserver.service - Start VNC Server at Display :1
Loaded: loaded (/etc/systemd/system/vncserver.service; enabled; preset: di>
Active: active (running) since Fri 2025-01-17 21:32:26 +0530; 6min ago
Invocation: 23acf85543d44e49906e6d72a6a99166
Process: 619 ExecStart=/usr/bin/vncserver :1 -geometry 1710x1112 (code=exit>
Tasks: 158 (limit: 9451)
CPU: 11.107s
CGroup: /system.slice/vncserver.service
├─ 643 Xtightvnc :1 -desktop X -auth /home/0xneobyte/.Xauthority ->
├─ 651 /bin/sh /home/0xneobyte/.vnc/xstartup
├─ 655 xfce4-session
├─ 668 dbus-launch --autolaunch d7d3a8a0be78432e83363f5611813b29 ->
├─ 669 /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --p>
├─ 707 /usr/bin/dbus-launch --exit-with-session --sh-syntax
├─ 708 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print->
├─ 722 /usr/bin/ssh-agent x-session-manager
├─ 737 /usr/libexec/at-spi-bus-launcher
├─ 743 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-s>
├─ 755 /usr/libexec/at-spi2-registryd --use-gnome-session
├─ 765 /usr/bin/gpg-agent --sh --daemon
├─ 766 xfwm4
├─ 771 /usr/libexec/gvfsd
├─ 777 /usr/libexec/gvfsd-fuse /home/0xneobyte/.gvfs -f
├─ 792 xfsettingsd
lines 1-24
Specify the Resolution When Starting VNC
TightVNC allows you to specify the resolution when starting the server. Use the -geometry option to set your desired resolution.
vncserver :1 -geometry 1920x1080
Update the Systemd Service for a Fixed Resolution
sudo nano /etc/systemd/system/vncserver.service
# Modify the ExecStart line to include the -geometry option
ExecStart=/usr/bin/vncserver :1 -geometry 1920x1080
# save and exit
# Reload the systemd daemon and restart the VNC service
sudo systemctl daemon-reload
sudo systemctl restart vncserver.service
Update Kali-Pi
sudo apt update
sudo apt full-upgrade
# After upgrading, it’s good to clean up any packages that are no longer needed:
sudo apt autoremove
# If you want to free up some space, you can clean the local cache of downloaded package files:
sudo apt clean
# After a full system upgrade, it’s a good idea to reboot the machine to ensure that any kernel updates or critical changes take effect:
sudo reboot
Enable Clipboard Sharing between Kali-Pi and VNC Viewer machine
- Install autocutsel on Kali Pi
sudo apt update
sudo apt install autocutsel
- Edit the vncerver.service to enable clipboard sharing when booting up automatically
sudo nano /etc/systemd/system/vncserver.service
---
[Unit]
Description=Start VNC Server at Display :1
After=network.target
[Service]
Type=forking
User=0xneobyte
Group=0xneobyte
WorkingDirectory=/home/0xneobyte
ExecStart=/usr/bin/vncserver :1 -geometry 1710x1112
ExecStartPost=/usr/bin/autocutsel -fork # Add this Line >>>
ExecStop=/usr/bin/vncserver -kill :1
Restart=on-failure
[Install]
WantedBy=multi-user.target
---
# Save and restart the pi
sudo reboot