Kali Linux in VirtualBox: Complete Setup Guide
Step-by-step guide to installing Kali Linux in VirtualBox including VM configuration, guest additions, networking modes, and post-installation setup.
Why Run Kali Linux in VirtualBox?
Running Kali Linux in VirtualBox is the safest and most flexible way to learn penetration testing. Virtual machines (VMs) isolate Kali from your host operating system, preventing accidental damage to your main environment. You can take snapshots to roll back mistakes, run multiple VMs simultaneously to simulate networks, and use different networking modes to control how Kali interacts with other systems.
Prerequisites
Before starting, ensure you have a computer with at least 8GB of RAM (16GB recommended), 50GB of free disk space, a 64-bit processor with virtualization support (Intel VT-x or AMD-V) enabled in BIOS, and VirtualBox installed from virtualbox.org. The latest Kali Linux ISO image from kali.org/downloads is also needed.
Step 1: Download Required Files
# Kali Linux ISO (direct download)
curl -O https://cdimage.kali.org/kali-2026.1/kali-linux-2026.1-installer-amd64.iso
# Verify the download with SHA256 checksum
curl -O https://cdimage.kali.org/kali-2026.1/SHA256SUMS
sha256sum kali-linux-2026.1-installer-amd64.iso
# Compare output with the hash in SHA256SUMS
Step 2: Create a New Virtual Machine
Open VirtualBox and click New. Name your VM "Kali Linux" — the Type and Version fields auto-detect to Linux and Debian 64-bit. Configure these settings:
Name: Kali Linux
Type: Linux
Version: Debian (64-bit)
Memory: 4096 MB (minimum)
Processors: 2 CPU cores
Disk Size: 60 GB (dynamically allocated)
Memory Considerations
Allocate at least 4GB of RAM for Kali. If your host has 16GB or more, give Kali 8GB for better performance running multiple tools simultaneously. Never allocate more than half your host's RAM to avoid system slowdowns.
Processor Configuration
Under System > Processor, allocate 2 cores minimum. Enable PAE/NX and KVM Paravirtualization for better performance. Check that hardware virtualization (VT-x/AMD-V) is enabled in the host BIOS.
Step 3: Configure Storage
Under Storage, select the empty optical drive and choose Choose a disk file. Browse to your downloaded Kali ISO. This attaches the installer image so the VM boots from it.
Step 4: Configure Networking
VirtualBox offers several networking modes for VMs:
| Mode | Description | Use Case |
|------|-------------|----------|
| NAT | VM shares host IP, can access internet but not the local network | Default, internet access |
| Bridged | VM gets its own IP on the physical network | Practice scanning local devices |
| Host-Only | VM can only communicate with host | Safe isolated practice |
| Internal | VM can only communicate with other VMs on same network | Multi-VM lab networks |
| NAT Network | Multiple VMs share a NAT network | Lab environments needing internet |
For initial installation, leave it on NAT. You can switch modes later.
Step 5: Install Kali Linux
Start the VM. It boots from the ISO and shows the Kali boot menu. Select Graphical Install and follow these steps:
The installation takes 10-20 minutes depending on your system.
Step 6: Post-Installation Setup
Update the System
After installation, log in and open a terminal:
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
Install VirtualBox Guest Additions
Guest Additions provide better integration including shared clipboard, drag-and-drop, seamless mouse integration, and better video performance.
From the VirtualBox menu, select Devices > Insert Guest Additions CD image. Then in Kali:
sudo mount /dev/cdrom /mnt
cd /mnt
sudo ./VBoxLinuxAdditions.run
sudo reboot
Configure Shared Clipboard
With the VM shut down, go to Settings > General > Advanced and set Shared Clipboard to Bidirectional. This lets you copy-paste between host and guest.
Set Up Shared Folders
Create a folder on your host that you want to share. In VirtualBox, go to Settings > Shared Folders, add the folder path, check Auto-mount and Make Permanent. Inside Kali, add your user to the vboxsf group:
sudo usermod -aG vboxsf $USER
# Log out and back in for changes to take effect
Step 7: Take a Snapshot
After setup is complete, take a snapshot from Machine > Take Snapshot. This gives you a clean state to revert to if you break something during practice. Name it "Clean Install" and add a description.
Step 8: Install Essential Tools
Some useful tools to add:
# Additional tools not included by default
sudo apt install -y flameshot terminator htop
# Python tools
sudo apt install -y python3-pip
pip3 install --user mitmproxy
# VS Code (optional)
curl -fsSL https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64
sudo dpkg -i code_*.deb
Networking Mode Examples
Set up Bridged Mode
# From VirtualBox settings, change network adapter to Bridged
# Kali will get an IP via DHCP from your physical network
ip addr show
# Look for eth0 or enp0s3 with an IP like 192.168.x.x
Create an Internal Lab Network
Create a second network adapter in VirtualBox set to Internal Network named "labnet". Add a target VM (like Metasploitable) to the same internal network:
# On Kali, assign an IP to the internal interface
sudo ip addr add 10.0.1.100/24 dev eth1
sudo ip link set eth1 up
# Verify connectivity
ping 10.0.1.10 # Target VM's IP on internal network
Real-World Examples
Penetration Testing Lab: Create three VMs — Kali (attacker), Metasploitable 2 (target Linux), and Windows 7/10 (target Windows). Connect them via an internal network and practice scanning, enumeration, and exploitation.
Capture the Flag Practice: Many CTF platforms provide VPN configurations. Import the VPN into Kali and practice against remote targets in a controlled environment.
Web Application Testing: Install OWASP Broken Web Applications or DVWA in a separate VM and use Kali's web testing tools (Burp Suite, ZAP, Nikto) against them.
Common Mistakes
Insufficient RAM — Kali with modern tools needs 4GB minimum. Running with 2GB causes freezing and crashes.
Skipping Guest Additions — Without Guest Additions, you lose copy-paste, drag-and-drop, and mouse integration features.
Not taking snapshots — Always snapshot before major changes. One misconfigured firewall rule can lock you out.
Wrong architecture — Download the amd64 version for modern systems. The i386 version for 32-bit systems is obsolete.
Best Practices
Keep Kali updated with sudo apt update && sudo apt full-upgrade. Take snapshots before major configuration changes. Use snapshot descriptions to track what changed. Allocate enough resources — 4GB RAM, 2 CPUs, 60GB disk. Use host-only or internal networks for practice. Keep the host machine updated and secure. Use strong passwords for Kali VMs even in lab environments.
Related Tools
Vagrant — Automate VM creation and provisioning with configuration files
Metasploitable 2 — Deliberately vulnerable Linux VM for practice
DVWA — Damn Vulnerable Web Application for web security training
VirtualBox Snapshots — Save and restore VM states
VBoxManage — Command-line interface for VirtualBox management
Related Articles
Summary
Installing Kali Linux in VirtualBox provides a safe, flexible environment for learning penetration testing. The process involves downloading the ISO, creating a VM with adequate resources, installing Kali, configuring Guest Additions for better integration, and setting up networking modes for different practice scenarios. Snapshots provide rollback capability, making experimentation safe. Virtualization is the recommended approach for beginners and professionals alike.