How to Install Kali Linux, Metasploitable and Configure a NAT Network in VirtualBox

,

·

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:

  1. Import the virtual machine into VirtualBox
  2. Start Kali Linux
  3. Ensure it runs correctly before continuing

Step 3: Install Metasploitable

Download Metasploitable:
https://sourceforge.net/projects/metasploitable/files/Metasploitable2

Steps:

  1. Extract the downloaded file
  2. Create a new virtual machine in VirtualBox
  3. Attach the Metasploitable disk
  4. Start the machine

Step 4: Create a NAT Network

To allow communication between machines, create a NAT network.

Steps:

  1. Open VirtualBox
  2. Go to Network settings
  3. Create a new NAT Network
  4. 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:

  1. Open Settings → Network
  2. Select “NAT Network”
  3. Choose the network you created

Start both machines and check their IP addresses.


Testing the Connection

From Kali Linux:

  • Use commands like ping to 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.