Portable Kali Linux lab on Raspberry Pi with touchscreen

21 April 2025 8 minutes Author: Cyber Witcher

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.

Building a portable Kali box with a Raspberry Pi and a touchscreen

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.

This is a toolkit, not a magic hacker’s box

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.

Disclaimer

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.

Installing Kali Linux on Raspberry Pi

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.

Step 1. Download the Kali Linux image

First, download the Kali Linux ARM image for Raspberry Pi from the official Kali Linux website. Make sure you select the Raspberry Pi version.

Step 2. Reboot Kali Linux to the MicroSD card

To install Kali Linux on a microSD card (32GB or larger recommended), use balenaEtcher or Raspberry Pi Imager:

  1. Insert the microSD card into your computer.

  2. Open balenaEtcher.

  3. Select the Kali Linux image file.

  4. Select the microSD card as the target.

  5. Click “Flash” and wait for the process to complete.

Figure 1. Example of Kali firmware using Raspberry Pi Imager

After that, insert the microSD card into the Raspberry Pi.

After that, insert the microSD card into the Raspberry Pi. First login using an external display

Since the touchscreen requires additional driver installation, we will start with the external display Micro HDMI.

Step 1. Boot the Raspberry Pi

  • 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.

Step 2: Default login credentials

Standard credentials for Kali Linux:

  • Username: kali

  • Password: kali

Figure 2. Login screen

After logging in, you will be greeted by the Kali Linux desktop.

System updates and upgrades

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

Installing Touch Screen Drivers and Enabling LCD Output

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.

Step 1. Install the touchscreen drivers

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.

Additional screen configurations

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

Configuring Security Configurations

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.

Enable automatic login

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

Figure 3. Enable automatic login on Raspberry Pi

Enable SSH access for root

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>

Powering a Portable Kali Linux Box

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.

Effectively Controlling Your Raspberry Pi: Touchscreen vs. External Options

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.

Using the built-in virtual keyboard for touch input

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.

Figure 4. Built-in floating keyboard

Practical use cases

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.

Conclusion

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.

Other related articles
Found an error?
If you find an error, take a screenshot and send it to the bot.