GO KALI FREE
BeginnerLinux

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.

#Kali Linux#VirtualBox#virtual machine#installation#VM 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:

  • Choose language, location, and keyboard layout
  • Configure network — hostname: "kali", domain can be blank
  • Set root password — choose a strong password you will remember
  • Partition disks — select **Guided - use entire disk** for simplicity
  • Choose disk and select **All files in one partition** for beginners
  • Confirm partitioning and write changes to disk
  • Software selection — leave defaults (Kali desktop environment and standard tools)
  • Install GRUB boot loader — select Yes and choose the virtual disk
  • 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

  • kali-linux-beginner-guide
  • ethical-hacking-fundamentals
  • linux-commands-explained
  • nmap-beginner-tutorial
  • network-scanning-nmap-beginners
  • 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.

    Knowledge Check

  • What is the minimum recommended RAM for a Kali Linux VM?
  • What are Guest Additions and why are they important?
  • What networking mode should you use to scan devices on your physical network?
  • Why should you take snapshots during installation and setup?
  • What command updates all packages in Kali Linux?
  • Frequently Asked Questions

    How much RAM do I need for a Kali Linux VM?

    Allocate at least 4GB of RAM for comfortable use, with 8GB recommended if your host has 16GB or more. Never allocate more than half your host's RAM to prevent system slowdowns. Kali with modern tools needs 4GB minimum — running with 2GB causes freezing and crashes.

    What are VirtualBox Guest Additions?

    Guest Additions are drivers and utilities installed inside the VM that improve integration with your host system. They provide shared clipboard (copy-paste between host and guest), drag-and-drop, seamless mouse integration, better video performance, and shared folder access.

    Which networking mode should I use for scanning?

    Use Bridged mode to give Kali its own IP on your physical network for scanning local devices. For safe isolated practice, use Host-Only mode where Kali communicates only with your host. Internal Network mode lets multiple VMs communicate with each other in an isolated lab.

    Why should I take snapshots of my Kali VM?

    Snapshots save the current state of your VM so you can instantly roll back if something goes wrong. Take a snapshot after a clean installation and before major configuration changes. One misconfigured firewall rule can lock you out — snapshots let you recover without reinstalling.

    How do I install VirtualBox Guest Additions on Kali?

    From the VirtualBox menu, select Devices > Insert Guest Additions CD image. Inside Kali, mount the CD with sudo mount /dev/cdrom /mnt, then run sudo ./VBoxLinuxAdditions.run from /mnt and reboot. The shared clipboard setting is found under Settings > General > Advanced.

    Can I use Kali Linux in VirtualBox on a Mac?

    Yes. VirtualBox runs on macOS (Intel and Apple Silicon via Rosetta). However, for Apple Silicon Macs, consider UTM or Parallels as they provide better ARM compatibility. Ensure virtualization is enabled in your firmware settings and allocate sufficient resources.

    How do I share files between my host and Kali VM?

    Create a shared folder in VirtualBox Settings > Shared Folders, enable Auto-mount and Make Permanent, then add your user to the vboxsf group with sudo usermod -aG vboxsf $USER. After logging out and back in, the folder will be accessible inside Kali.

    What is the default login for Kali Linux?

    During recent installations, Kali creates a non-root user with the credentials you set during installation. Older versions used root/toor. If you cannot log in, try the username and password you configured in the installer's user setup step.

    Should I use NAT or Bridged networking?

    NAT is the default and works for internet access — the VM shares your host's IP. Use Bridged mode when you need Kali to appear as a separate device on your physical network, such as when scanning other devices. Start with NAT for installation and switch modes as needed.

    How do I create a penetration testing lab in VirtualBox?

    Set up three VMs: Kali (attacker), Metasploitable 2 (vulnerable Linux target), and a Windows VM. Connect them via an Internal Network named 'labnet' so they can communicate with each other but are isolated from your physical network. Practice scanning, enumeration, and exploitation.