
Want to have a powerful security testing tool always at hand? In this step-by-step guide, we’ll show you how to turn a Raspberry Pi 4 with a 3.5-inch touchscreen into a portable Kali Linux lab. You’ll learn how to install Kali Linux, configure the touchscreen, enable root access, SSH, autologin, and a virtual keyboard.
Disclaimer: The author of this blog does not condone or encourage any form of illegal hacking, cyberattacks, or unethical behavior. Please use this knowledge responsibly, respect privacy laws, and always follow ethical hacking principles.
This guide will walk you through the complete setup process for a Raspberry Pi with a 3.5-inch touchscreen running Kali Linux. This compact yet powerful setup is a great solution for mobile penetration testing and cybersecurity research. It covers everything from burning the Kali Linux image to a microSD card, booting the system for the first time using an external display, installing touchscreen drivers and configuring its settings, to setting up a portable power supply.
Special attention is paid to the security configuration: enabling root access, setting an administrator password, and setting up an SSH connection as the root user. This solution allows you to create a cost-effective and portable mobile penetration testing lab that runs on a power bank or even a smartphone. This makes it versatile for use in a variety of environments.
Although the material is focused on the Raspberry Pi 4 with a 3.5-inch display, the general methodology is also suitable for other Raspberry Pi models and various types of touchscreens. Such a mobile platform is in many ways reminiscent of the Pi-Tail project, which was already mentioned in the previous article about the creation of a headless portable hacking laboratory.
One of the biggest misconceptions about penetration testing rigs—especially those running Kali Linux—is that they are some kind of “magic hacking machine” that can automatically crack systems with the click of a button. This is far from the truth.
What we are building here is a toolkit, not an automated hacking device. Just as a professional mechanic carries a set of wrenches, screwdrivers, and diagnostic tools, a penetration tester needs a collection of security tools, scripts, and utilities to assess and protect networks. The real skill lies in understanding how these tools work and when to use them.
This blog is intended for educational and ethical purposes only. The information provided is intended to help cybersecurity professionals, ethical hackers, and tech enthusiasts understand how to set up and use Kali Linux on a Raspberry Pi for legitimate security testing and research.
Unauthorized access to networks, systems, or devices without explicit permission is illegal and can result in serious legal consequences. Always ensure that you have the proper authorization before conducting any penetration testing or security assessments.
Kali Linux is a penetration testing-focused operating system that comes with a large collection of security testing tools. To install it on a Raspberry Pi 4, follow these steps.
First, download the Kali Linux ARM image for Raspberry Pi from the official Kali Linux website. Make sure you select the Raspberry Pi version.
To install Kali Linux on a microSD card (32GB or larger recommended), use balenaEtcher or Raspberry Pi Imager:
Insert the microSD card into your computer.
Open balenaEtcher.
Select the Kali Linux image file.
Select the microSD card as the target.
Click “Flash” and wait for the process to complete.
After that, insert the microSD card into the Raspberry Pi.
Since the touchscreen requires additional driver installation, we will start with the external display Micro HDMI.
Connect the micro HDMI cable to the external monitor.
Connect the USB keyboard and mouse.
Insert the microSD card and turn on the Raspberry Pi.
Standard credentials for Kali Linux:
Username: kali
Password: kali
After logging in, you will be greeted by the Kali Linux desktop.
Keeping your system up to date is crucial for security and performance. Before we install the touchscreen drivers, we need to make sure that you have the latest updates installed.
Run the following command to refresh the package lists and update the installed packages:
sudo apt update && sudo apt full-upgrade -y
This command:
Gets the latest package lists ( apt update )
Upgrades all installed packages ( apt full-upgrade -y )
Once the update is complete, reboot the system to apply the changes:
sudo reboot
To use the 3.5″ touchscreen, we need to install the appropriate drivers. A useful tool for this is LCD-show-kali, which is available on GitHub.
1. You need to clone the LCD-show-kali repository. It is best to use the version from lcdwiki to avoid possible errors during installation. Such failures have occurred when using the repository https://github.com/waveshare/LCD-show:
git clone https://github.com/lcdwiki/LCD-show-kali.git
2. Go to the directory:
cd LCD-show-kali
3. Run the installation script:
chmod +x LCD35-show sudo ./LCD35-show
The system will reboot and the Kali Linux interface should appear on the display.
If you need to rotate the screen or adjust the resolution, edit the /boot/config.txt file:
sudo nano /boot/config.txt
Add one of the following lines depending on your needs:
Rotate 90 degrees: display_rotate=1
Rotate 180 degrees: display_rotate=2
Rotate 270 degrees: display_rotate=3
Save the file and reload:
sudo reboot
Enable the Root Account and Set a Password
By default, Kali Linux disables root login. To enable it and set a root password, run:
sudo passwd root
You will be prompted to enter a new root password. For detailed instructions, refer to this guide.
To avoid having to enter credentials every time you boot, set up automatic login. This is useful if you want to connect to the box via SSH using another device, such as a smartphone launcher:
sudo raspi-config
З Boot Options
-> Desktop / CLI
->Desktop Autologin
If you want to remotely access your Kali Linux setup via SSH as root. This step is optional as you can still access the box using your kali credentials.
1. Edit the SSH daemon configuration:
sudo nano /etc/ssh/sshd_config
2. Find and change the following line from no to yes:
PermitRootLogin yes
3. Restart the SSH service:
sudo systemctl restart ssh
Now you can remotely access your Kali box using:
ssh root@<your_pi_ip_address>
To make this setup portable, we need a reliable power source.
Option 1: External battery
Use a 5V/3A power supply (like for smartphones).
Option 2: Power via smartphone
Many modern Android phones support USB-C reverse charging.
Connect your phone to the Raspberry Pi adapter via OTG.
It is possible to control a Raspberry Pi with a touchscreen using an on-screen keyboard, but it takes up valuable screen space, making navigation and typing less efficient. For more convenient use, especially when working on the go, using a small Bluetooth keyboard can greatly improve usability while keeping the setup lightweight and portable. Additionally, for remote access and full control, users can connect to the Raspberry Pi via SSH for command-line management or use VNC for a graphical interface, both of which can be done directly from a smartphone or laptop. These options provide greater flexibility, ensuring that your portable Kali Linux system can operate effectively in any environment.
For users who rely solely on the touchscreen, a practical way to type without a physical keyboard is to use Onboard, a multi-functional virtual keyboard. It can be easily installed using:
sudo apt install onboard
Onboard is highly customizable, offering features like auto-showing when a text field is selected, making text entry more convenient. It is also scalable and movable, allowing users to place it anywhere on the screen for better accessibility. Additionally, its adjustable transparency ensures that it doesn’t cover critical elements, which is especially useful on a small touchscreen display.
Raspberry Pi running Kali Linux serves as a powerful and portable cybersecurity toolkit that allows you to conduct network reconnaissance, test WiFi security using external adapters, analyze Bluetooth using custom keys, test RFID/NFC with Proxmark3, MITM attacks with Bettercap, assess web application vulnerabilities, and more. This setup is lightweight, cost-effective, and versatile, making it ideal for ethical hackers and security professionals who need a mobile penetration testing lab.
By following this guide, you have created a fully functional portable penetration testing system using Raspberry Pi and Kali Linux. This setup allows you to conduct on-the-go cybersecurity assessments, network testing, and ethical hacking.
With a touchscreen interface, root access, SSH support, and portable power, you now have a mobile ethical hacking toolkit that fits in your pocket.