How To Install Kali In Virtualbox

8 min read

Running a penetration testing distribution inside a virtual machine remains the safest and most flexible way to practice cybersecurity skills without risking a host operating system. For beginners and seasoned professionals alike, learning how to install Kali in VirtualBox provides a portable, isolated lab environment that can be snapshotted, cloned, or deleted in seconds. This guide walks through the entire process—from downloading the correct image to hardening the guest tools—ensuring a stable, high-performance setup ready for capture-the-flag exercises, vulnerability assessments, or certification studies Small thing, real impact..

Prerequisites and System Requirements

Before launching the installer, verify that the host machine meets the baseline hardware requirements. Virtualization demands sufficient resources allocated to the guest while leaving the host responsive And that's really what it comes down to..

  • Processor: A 64-bit CPU with hardware virtualization extensions (Intel VT-x or AMD-V) enabled in BIOS/UEFI.
  • Memory: Minimum 4 GB RAM for the host; allocate at least 2 GB (preferably 4 GB) to the virtual machine.
  • Storage: At least 25 GB of free disk space for a standard installation; 50 GB if planning to store large wordlists or container images.
  • Software: Latest version of VirtualBox (7.x or newer) and the VirtualBox Extension Pack for USB 3.0 and disk encryption support.
  • Network: Stable internet connection for package updates during the first boot.

Download the official Kali Linux VirtualBox 64-bit image from the Offensive Security downloads page. Here's the thing — choose the "Installer" image if building a custom disk layout, or the "VirtualBox" pre-built OVA/OVA image for the fastest deployment. Verify the SHA256 checksum to ensure file integrity before proceeding.

Quick note before moving on.

Method 1: Importing the Pre-Built VirtualBox Image (Fastest)

For users who want a working environment in under five minutes, the pre-configured OVA appliance is the optimal route Worth keeping that in mind..

  1. Open VirtualBox and select File > Import Appliance (or press Ctrl + I).
  2. Browse to the downloaded .ova file and click Next.
  3. Review the appliance settings. Increase the RAM to 4096 MB (4 GB) and CPU cores to 2 or more if the host allows.
  4. Ensure Reinitialize the MAC address of all network cards is checked to avoid network conflicts.
  5. Click Finish. VirtualBox will import the disk image and register the machine.
  6. Start the VM. The default credentials are kali / kali. Change the password immediately using the passwd command in a terminal.

This method includes Guest Additions pre-installed, enabling shared clipboard, drag-and-drop, and dynamic screen resizing out of the box.

Method 2: Manual Installation from ISO (Maximum Control)

A manual install allows custom disk encryption, LVM configuration, and minimal package selection—ideal for learning Linux internals or meeting specific compliance baselines.

Step 1: Create the Virtual Machine

  1. Click New in VirtualBox Manager.
  2. Name: Kali Linux Rolling (Type: Linux, Version: Debian 64-bit).
  3. Memory: Allocate 4096 MB (4 GB). Enable Enable EFI (special OSes only) only if the host uses UEFI; otherwise, leave disabled for BIOS compatibility.
  4. Hard Disk: Create a Virtual Hard Disk Now → VDI (VirtualBox Disk Image) → Dynamically Allocated (grows as used) or Fixed Size (better I/O performance). Set size to 40 GB minimum.
  5. Click Create.

Step 2: Configure VM Settings Before First Boot

Select the new VM and open Settings:

  • System > Processor: Assign 2–4 CPUs. Check Enable PAE/NX.
  • Display > Screen: Increase Video Memory to 128 MB. Enable 3D Acceleration (may cause issues on some Linux hosts; disable if graphical glitches appear).
  • Storage: Click the Empty optical drive under Controller: IDE. Click the disk icon on the right → Choose a Disk File → Select the downloaded Kali ISO.
  • Network: Adapter 1 attached to NAT (default, provides internet). For host-only labs, add Adapter 2 attached to Host-only Adapter (vboxnet0).
  • USB: Enable USB Controller and select USB 3.0 (xHCI) Controller (requires Extension Pack).

Step 3: Run the Graphical Installer

  1. Start the VM. Select Graphical Install from the GRUB menu.
  2. Language, Location, Keyboard: Select preferences. US English and American English keyboard are standard for most tooling.
  3. Network Configuration: Hostname kali (or custom). Domain name can be left blank.
  4. User Setup: Create a non-root user (e.g., analyst). Set a strong password. Do not enable "Log in automatically."
  5. Partition Disks: Choose Guided - use entire disk and set up encrypted LVM for full-disk encryption (recommended for portable labs). Confirm writing changes to disk. Enter a strong LUKS passphrase.
  6. Package Manager: Use a network mirror. Leave HTTP proxy blank unless in a corporate environment.
  7. Software Selection: Check Desktop environment (GNOME default), Kali Linux default tools, and SSH server. Uncheck "Web server" or "Print server" to save space.
  8. Install GRUB: Install to the master boot record (/dev/sda).
  9. Reboot, remove the ISO from the virtual optical drive when prompted, and log in with the created user.

Post-Installation Hardening and Optimization

A fresh install requires several steps to transform it into a professional penetration testing workstation Most people skip this — try not to. That alone is useful..

Install VirtualBox Guest Additions (Manual Install Only)

If installed via ISO, Guest Additions are missing. They provide seamless mouse integration, shared folders, and proper video drivers.

  1. Update the package cache and install kernel headers:
    sudo apt update && sudo apt install -y linux-headers-$(uname -r) build-essential dkms
    
  2. In the VM window menu: Devices > Insert Guest Additions CD Image.
  3. Open a terminal in the mounted CD directory (usually /media/cdrom or /media/kali/VBox_GAs_*).
  4. Run the installer:
    sudo ./VBoxLinuxAdditions.run
    
  5. Reboot the VM. Verify operation with lsmod | grep vboxguest.

System Update and Tool Refresh

Kali is a rolling distribution; the ISO may be weeks or months old. Run a full upgrade immediately:

sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo reboot

This ensures the latest kernel, exploit frameworks (Metasploit, Nmap, Burp Suite), and wireless drivers are present.

Enable Root Access (Optional)

Modern Kali defaults to a non-root user with sudo. Some legacy tools or scripts expect a root shell. To enable the root account:

sudo passwd root
# Enter new root password twice

To allow root graphical login (GNOME), edit /etc/pam.Consider this: d/gdm-password and comment out auth required pam_succeed_if. so user !Day to day, = root quiet_success. **Use root sparingly Not complicated — just consistent..

Configure Shared Folders for File Transfer

  1. Host: Settings > Shared Folders > Add → Select a host folder → Check **

Auto-mount and Make Permanent.

  1. Guest: Add your user to the vboxsf group to access the mount point (/media/sf_<folder_name>):
    sudo usermod -aG vboxsf $USER
    
    Log out and back in (or reboot) for group changes to take effect.

Harden SSH for Remote Access

If you enabled the SSH server during install, secure it immediately before exposing the VM to any network And it works..

  1. Backup the original config: sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
  2. Edit /etc/ssh/sshd_config with the following critical changes:
    Port 2222                        # Obscurity: move off default port
    PermitRootLogin no               # Critical: prevent root login
    PasswordAuthentication no        # Enforce key-based auth only
    PubkeyAuthentication yes
    MaxAuthTries 3
    AllowUsers analyst               # Restrict to specific non-root user
    ClientAliveInterval 300
    ClientAliveCountMax 2
    
  3. Generate an Ed25519 key pair on your host machine (if absent):
    ssh-keygen -t ed25519 -C "kali-lab-access"
    
  4. Copy the public key to the Kali VM:
    ssh-copy-id -p 2222 analyst@
    
  5. Restart and verify: sudo systemctl restart ssh && sudo systemctl status ssh
  6. Test login from host: ssh -p 2222 analyst@<VM_IP>. You should log in without a password prompt.

Configure Host Firewall (UFW)

Kali ships with ufw (Uncomplicated Firewall) disabled. Enable a default-deny ingress policy That's the part that actually makes a difference..

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 2222/tcp comment 'SSH Hardened Port'
# Optional: Allow specific lab subnet for tool traffic (e.g., Metasploit reverse shells)
# sudo ufw allow from 192.168.56.0/24 comment 'Host-Only Lab Network'
sudo ufw enable
sudo ufw status verbose

Install Essential Tooling & Modern CLI Utilities

The default metapackage covers heavy frameworks, but daily workflow benefits from modern replacements and development toolchains Worth knowing..

# Modern CLI replacements (bat, fd, ripgrep, eza, fzf, zoxide, delta)
sudo apt install -y bat fd-find ripgrep eza fzf zoxide git-delta

# Development / Scripting runtimes
sudo apt install -y python3-pip python3-venv golang-go nodejs npm rustc cargo

# Containerization (critical for modern tooling like Nuclei, Katana, or isolated environments)
sudo apt install -y docker.io docker-compose
sudo usermod -aG docker $USER
# Log out/in required for docker group

# Terminal Multiplexer & Shell
sudo apt install -y tmux zsh
chsh -s $(which zsh)  # Set Zsh as default shell (log out/in)

Shell Environment: Oh My Zsh & Configuration

A configured Zsh environment drastically improves command-line efficiency Most people skip this — try not to..

  1. Install Oh My Zsh (unattended):
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
    
  2. Install Powerlevel10k theme (fast, informative prompt):
    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc
    
  3. Add useful plugins (syntax highlighting, autosuggestions, completions):
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    git clone https
New Additions

What's New Around Here

Close to Home

Readers Loved These Too

Thank you for reading about How To Install Kali In Virtualbox. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home