Lesson 02 of 5
How to Build an Ethical Hacking Home Lab (VirtualBox, Kali Linux, Metasploitable 2)
4 min read
Set up a free, safe practice lab on your own laptop with VirtualBox, Kali Linux and a deliberately vulnerable VM.
A home lab is a small, private network on your own computer where you can practise legally and safely. Everything runs inside virtual machines, so nothing you do touches anyone else's system. It costs ₹0.
What you need
- A laptop or PC with 8 GB RAM (16 GB is much more comfortable) and about 60 GB of free disk space
- Virtualisation turned on in your BIOS/UEFI (called Intel VT-x or AMD-V / SVM)
- VirtualBox – free virtualisation software from virtualbox.org
- Kali Linux – your attacker machine, from kali.org
- Metasploitable 2 – a deliberately vulnerable Linux VM made for practice
Step 1: Install VirtualBox
Download VirtualBox for your operating system from virtualbox.org and install it with the default options. On Windows, allow it to install its network drivers when asked.
Step 2: Import Kali Linux
Kali provides ready-made VirtualBox images, which is the easiest way to start:
- Go to kali.org → Get Kali → Virtual Machines and download the VirtualBox image
- Extract the .7z file (7-Zip on Windows)
- In VirtualBox, click Add and open the .vbox file
- Give it at least 2 CPUs and 4 GB RAM in Settings
- Start it and log in with the default credentials shown on the Kali download page, then change the password straight away
passwd
sudo apt update && sudo apt full-upgrade -y
Step 3: Add Metasploitable 2
Download Metasploitable 2 (a .zip with a .vmdk disk). In VirtualBox create a new VM, choose Linux / Ubuntu (32-bit), give it 512 MB–1 GB RAM, and select Use an existing virtual hard disk file pointing to the .vmdk.
Important: Metasploitable is full of security holes on purpose. Never connect it to the internet or your home network. Only use a host-only network as shown below.
Step 4: Create a private host-only network
- In VirtualBox open File → Tools → Network Manager → Host-only Networks and create one. It usually uses 192.168.56.0/24.
- Metasploitable 2: Settings → Network → Adapter 1 → Host-only Adapter
- Kali: Adapter 1 → NAT (for internet and updates), Adapter 2 → Host-only Adapter
Step 5: Test the lab
Start both VMs. Check the IP addresses:
ip a # on Kali
ifconfig # on Metasploitable 2
Then, from Kali, check that you can reach the target:
ping -c 3 192.168.56.101
nmap -sV 192.168.56.101
If Nmap lists lots of open services, your lab works. (Your target's IP may be different, so use the one you found.)
Step 6: Take snapshots
Before you practise, take a snapshot of both VMs (Machine → Take Snapshot). If anything breaks, you can roll back in seconds.
What to add later
- DVWA and OWASP Juice Shop for web app practice
- A Windows evaluation VM to learn Windows security and Active Directory
- TryHackMe and Hack The Box for ready-made machines when your laptop can't run more VMs
Simple words mein (Hinglish)
Home lab aapke laptop par ek private network hai jahan legally practice kar sakte ho, aur ye bilkul free hai. VirtualBox install karo, Kali Linux (attacker) aur Metasploitable 2 (target) import karo, aur dono ko host-only network par rakho. Metasploitable ko kabhi bhi internet se connect mat karna. Kali se ping aur nmap chala ke check karo, aur shuru karne se pehle snapshot zaroor lo.
FAQ
How much RAM do I need for a hacking lab? 8 GB works for Kali plus one small target. 16 GB lets you run several VMs comfortably.
VirtualBox or VMware? Both work. VirtualBox is free and open source, which makes it a great choice for beginners.
Why use a host-only network? It keeps vulnerable VMs completely cut off from the internet and your real home network.
Can I build a lab without a powerful laptop? Yes. Use TryHackMe or Hack The Box, which run the machines in the cloud.
Practice task
- Build the lab and take snapshots of both VMs
- Find both IP addresses and ping the target from Kali
- Run nmap -sV against Metasploitable 2 and save the output to a file
Next lesson: the 5 phases of ethical hacking.