Setting up a local lab is one of the best ways to learn ethical hacking safely. In this guide, you will learn how to install VirtualBox, set up Kali Linux and Metasploitable, and connect them using a NAT network.
This setup allows you to practice penetration testing in an isolated environment without affecting your main system.
Video Tutorial
What You Will Set Up
In this tutorial, you will:
- Install VirtualBox
- Import Kali Linux virtual machine
- Install Metasploitable
- Create a NAT network
- Connect both machines
Step 1: Install VirtualBox
Download and install VirtualBox from the official website:
https://www.virtualbox.org/wiki/Downloads
Follow the installation steps and keep the default settings unless you have specific requirements.
Step 2: Install Kali Linux
Download Kali Linux (VirtualBox image recommended):
https://www.kali.org/get-kali/#kali-virtual-machines
Steps:
- Import the virtual machine into VirtualBox
- Start Kali Linux
- Ensure it runs correctly before continuing
Step 3: Install Metasploitable
Download Metasploitable:
https://sourceforge.net/projects/metasploitable/files/Metasploitable2
Steps:
- Extract the downloaded file
- Create a new virtual machine in VirtualBox
- Attach the Metasploitable disk
- Start the machine
Step 4: Create a NAT Network
To allow communication between machines, create a NAT network.
Steps:
- Open VirtualBox
- Go to Network settings
- Create a new NAT Network
- Assign an IP range
This network will be used to connect both Kali Linux and Metasploitable.
Step 5: Connect Kali and Metasploitable
For both virtual machines:
- Open Settings → Network
- Select “NAT Network”
- Choose the network you created
Start both machines and check their IP addresses.
Testing the Connection
From Kali Linux:
- Use commands like
pingto test connectivity - Verify that both machines are on the same network
If configured correctly, Kali should be able to communicate with Metasploitable.
Why This Setup Is Important
This lab setup allows you to:
- Practice penetration testing safely
- Learn exploitation techniques
- Test tools without risk
- Build real-world skills
Final Notes
A properly configured lab is essential for learning cybersecurity. Once everything is connected, you can start experimenting with tools and techniques in a controlled environment.
Related Content
Watch the full video above for the complete walkthrough.
You can find more Kali Linux and ethical hacking tutorials on the channel.



