Step 1:Update the Headless Kali Pi
First, let’s load up Kali on our headless Raspberry Pi. Connect to it either via SSH or by accessing it directly. We always want to run the apt-get update command in a terminal window to ensure that all our dependencies are up-to-date and working properly. Make sure that the Pi and the device you are using to connect to the Pi are on the same wireless or wired network.
Step 2:Install the VNC Server Software on the Kali Pi
There are various versions of VNC, all with different purposes, but in this tutorial, we will be using TightVNC, as it’s well-supported and easy to install on the Raspberry Pi.
Open a command window on your headless Raspberry Pi and type apt-get install tightvncserver. This will download and install the software. When that is complete, type tightvncserver. This enables the TightVNC service, and it will require you to create a password to access from your computer. Go ahead and create one now.
Once you enter a password, it will ask you “Would you like to enter a view-only password (y/n)?” Press N, because a view-only password will only allow you to see what is displayed on the machine and not be allowed to control it. Also, TightVNC can only set up to an 8-character password.
Step 3:Configure TightVNC Server on the Kali Pi
Now, to be able to access our Kali Pi remotely, we need to run TightVNC on it at boot. On our headless Kali Pi, we will navigate to the directory by typing cd /etc/init.d. Next, we want to create a startup script, so you can use whatever text editor you prefer, but I like Vim. If using Vim, type vim ~/etc/init.d/vncboot to create the startup script. Next, we want to insert the script below into the blank document.
Step 4:Download & Install the VNC Client
Now we can use any VNC client we want, but we are going to use RealVNC’s “VNC Viewer” because it works on Linux, Android, and it’s one of few that also works on Windows and iOS. You can download whichever version you want from the RealVNC website. Once downloaded, install it like you would any other program. In this guide, I’ll be using Windows.
Step 5:Find the Kali Pi’s IP Address
After installing the client software, we want to go back into our headless Kali Pi. Again, connect either by SSHing into it or accessing it directly, then open a terminal and type ifconfig. Write down the Kali Pi’s local IP address; it should look something like “192.168.0.x.”
Step 6:Connect to the Kali Pi via Our Computer
Next, let’s jump back into our Windows machine and open up the VNC Viewer app. The following directions may be different if you are using it on another operating system.
In VNC Viewer, click the “File” option, and then click the “New Connection” tab. Now, let’s add the Kali Pi’s IP address to the VNC Server field. You can save this as any name that will help you remember this device in the Name field.
Finally, bam! If the connection was successful, you should see a screen like the one below.