💻 How to Set Up a Basic Ethical Hacking Lab Using Virtual Machines & Kali Linux
If you’re diving into cybersecurity or ethical hacking, setting up your own hacking lab is one of the smartest (and safest) ways to learn. It lets you experiment, test vulnerabilities, and practice attacks — all without breaking any laws or risking real systems.
Let’s walk through how to build your own ethical hacking lab using Kali Linux and virtual machines (VMs) — step by step.
🧠 Why Use a Virtual Lab?
Creating a lab environment ensures:
- ✅ You can learn hacking techniques legally
- ✅ There’s zero risk to your actual system
- ✅ You can simulate real-world attack scenarios
- ✅ You’ll get hands-on experience with tools like Metasploit, Nmap, Wireshark, and Burp Suite
🧰 What You’ll Need
- A Decent Computer
- Minimum: 8 GB RAM (16 GB recommended)
- At least 100 GB of free disk space
- 64-bit processor with virtualization support (enable VT in BIOS)
- Virtualization Software
- VirtualBox (Free)
- VMware Workstation Player (Free for personal use)
- Kali Linux ISO or Prebuilt VM
- Download from: https://www.kali.org/get-kali/
- Target VMs for Practice
- Metasploitable 2 – a vulnerable Linux VM for testing exploits
- Windows 10/11 (optional, for more advanced testing)
- DVWA (Damn Vulnerable Web App) – a web app you can attack
🧱 Step-by-Step Setup
🔹 Step 1: Install VirtualBox or VMware
Download and install the virtualization software of your choice. Most beginners start with VirtualBox because it’s open-source and lightweight.
🔹 Step 2: Download Kali Linux
You can either:
- Download the Kali Linux ISO and install it manually in VirtualBox
- Or download a pre-built Kali VM (faster setup)
👉 Pre-built VMs available at: https://www.kali.org/get-kali/#kali-virtual-machines
🔹 Step 3: Install Kali in VirtualBox
- Create a new VM
- Assign at least 2 CPUs, 4 GB RAM, and 20 GB storage
- Mount the ISO or select the Kali VM file
- Follow on-screen prompts to complete installation
🔹 Step 4: Add a Target Machine (Metasploitable)
- Download from: https://sourceforge.net/projects/metasploitable/
- Import into VirtualBox like Kali
- Important: Make sure both Kali and Metasploitable are on the same internal network or NAT network
🔹 Step 5: Test the Connection
In Kali, open a terminal and type:
ping [Metasploitable IP Address]
If you get replies, your lab is ready for testing!
🛠️ What You Can Practice in This Lab
- Scanning ports with Nmap
- Intercepting traffic with Wireshark
- Exploiting vulnerabilities with Metasploit
- Testing web apps with Burp Suite
- Practicing privilege escalation
🔒 Safety Tips
- NEVER scan or attack real networks without permission
- Keep your virtual lab isolated from your host machine
- Use snapshots to quickly roll back after testing
- Don’t connect vulnerable machines to the internet
🚀 Next Up:
In the following posts, I’ll walk you through:
- Setting up and using Metasploit Framework
- Scanning with Nmap and interpreting results
- Basic vulnerability assessment on Metasploitable


