Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code: Skills Get Started
FAQ’s Sections
Linux Operating Systems Virtual Servers

How to Install Kali Linux on VirtualBox: A Complete Step-by-Step Guide

Kali Linux is the industry-standard Linux distribution for penetration testing, ethical hacking, and cybersecurity research. Whether you're a seasoned security professional or just beginning your journey into offensive security, running Kali Linux inside VirtualBox is one of the smartest and safest ways to build a fully functional lab environment β€” no dual-booting required, no dedicated hardware needed.

In this comprehensive guide, you'll learn exactly how to download, configure, and install Kali Linux on VirtualBox, including how to optimize your virtual machine with Guest Additions for a smoother, more productive workflow.

Why Run Kali Linux in VirtualBox?

Before diving into the installation steps, it's worth understanding why a virtualized environment is often the preferred choice for security professionals:

  • Isolation: Your host operating system remains protected from potentially dangerous tools or exploits running inside the VM.
  • Snapshots: You can save the state of your VM at any point and roll back instantly if something goes wrong.
  • Portability: Virtual machines can be exported, shared, and deployed across different hardware.
  • Cost-effective: No need for a separate physical machine dedicated to security testing.

If you're looking to go beyond local virtualization and need a remotely accessible, always-on environment, consider a VPS Hosting solution β€” ideal for running persistent Kali Linux instances in the cloud.

Prerequisites

Before you begin, make sure you have the following:

  • A host machine running Windows, macOS, or Linux
  • At least 8GB of RAM (4GB minimum allocated to the VM)
  • At least 50GB of free disk space
  • A stable internet connection for downloading required files
  • VirtualBox installed (covered in Step 1)

Step 1: Download and Install VirtualBox

VirtualBox is a free, open-source hypervisor developed by Oracle that supports Windows, macOS, and Linux host systems.

  1. Visit the official VirtualBox Downloads page.
  2. Select the installer package that matches your host operating system (Windows, macOS, or Linux).
  3. Download and run the installer.
  4. Follow the on-screen prompts to complete the installation.
  5. Optionally, also download and install the VirtualBox Extension Pack from the same page β€” it adds support for USB 2.0/3.0, RDP, and disk encryption.

Once installed, launch VirtualBox to confirm it opens correctly before proceeding.

Step 2: Download the Kali Linux ISO

Next, you need to obtain the official Kali Linux ISO image.

  1. Navigate to the official Kali Linux Downloads page.
  2. Under Installer Images, choose the 64-bit version (recommended for most modern systems).
  3. You can download via direct HTTP or via the torrent link for faster speeds.
  4. Verify the integrity of the downloaded file using the provided SHA256 checksum β€” this is especially important in a security-focused environment.

> Security tip: Always verify ISO checksums before installation to ensure the image has not been tampered with.

Step 3: Create a New Virtual Machine in VirtualBox

With VirtualBox installed and your ISO downloaded, it's time to create the virtual machine.

  1. Open VirtualBox and click the New button in the toolbar.
  2. In the Name and Operating System dialog, configure the following:
  • Name: Kali Linux (or any name you prefer)
  • Type: Linux
  • Version: Debian (64-bit)
  1. Click Next.
  2. Memory (RAM): Allocate at least 2048 MB (2GB). For a comfortable experience running multiple tools simultaneously, 4096 MB (4GB) is strongly recommended.
  3. Click Next.
  4. Hard Disk: Select Create a virtual hard disk now and click Create.
  5. Choose VDI (VirtualBox Disk Image) as the hard disk file type and click Next.
  6. Select Dynamically allocated to save physical disk space, then click Next.
  7. Set the virtual disk size to at least 20GB β€” 40GB or more is recommended if you plan to install additional tools and store captured data.
  8. Click Create to finalize the virtual machine.

Step 4: Configure the Virtual Machine Settings

Before booting the VM for the first time, apply the following configuration tweaks to ensure a smooth installation.

System Settings

  1. Select your newly created VM in the VirtualBox sidebar and click Settings.
  2. Navigate to System > Motherboard.
  3. Ensure Enable EFI (special OSes only) is unchecked unless you specifically need UEFI boot mode.
  4. Under System > Processor, allocate 2 or more CPU cores if your host machine supports it β€” this significantly improves performance.

Storage Settings

  1. Go to Storage in the Settings menu.
  2. Under Controller: IDE, click the empty optical drive (disc icon).
  3. On the right side, click the disc icon next to Optical Drive and select Choose a disk file.
  4. Browse to and select the Kali Linux ISO you downloaded in Step 2.

Network Settings

  1. Navigate to Network > Adapter 1.
  2. Choose one of the following modes based on your needs:
  • NAT: The VM shares the host's internet connection. Best for isolated testing.
  • Bridged Adapter: The VM gets its own IP address on your local network. Best if you need the VM to communicate with other devices.

Display Settings

  1. Go to Display > Screen.
  2. Set Video Memory to 128 MB for better graphical performance.
  3. Enable 3D Acceleration if your host GPU supports it.

Click OK to save all settings.

Step 5: Install Kali Linux

Now you're ready to boot the virtual machine and run the Kali Linux installer.

  1. Select your VM in the VirtualBox sidebar and click Start.
  2. The VM will boot from the Kali Linux ISO. When the boot menu appears, select Graphical Install for the easiest installation experience.
  3. Follow the installation wizard through the following steps:

Language and Locale

  • Select your preferred language, country/region, and keyboard layout.

Network Configuration

  • Enter a hostname for your machine (e.g., kali-lab).
  • You can leave the domain name blank for a standalone setup.
  • If prompted for network configuration, you can skip it and configure networking after installation.

User Account Setup

  • Create a non-root user account with a strong password (Kali Linux 2020+ no longer uses root as the default login).
  • You will also be prompted to set a root password β€” choose something secure.

Disk Partitioning

  • Select Guided – Use Entire Disk for a straightforward setup.
  • Choose your virtual hard disk when prompted.
  • Select All files in one partition for simplicity.
  • Confirm the partition changes and write them to disk.

Software Installation

  • The installer will now copy and install all required packages. This may take 10–20 minutes depending on your host system's performance.

GRUB Bootloader

  • When prompted, install the GRUB bootloader to the primary drive (/dev/sda).
  1. Once the installation completes, click Continue to reboot the VM.
  2. After the reboot, remove the ISO from the virtual optical drive (Devices > Optical Drives > Remove disk from virtual drive) to prevent booting from the installer again.
  3. Log in with the credentials you created during installation.

VirtualBox Guest Additions is a package of drivers and utilities that dramatically improves the performance and usability of your Kali Linux VM. Installing it is one of the most important post-installation steps.

Benefits of Guest Additions:

  • Improved graphics: Higher screen resolutions and dynamic window resizing
  • Seamless mouse integration: No need to manually capture/release the mouse cursor
  • Shared clipboard: Copy and paste text between your host OS and Kali Linux
  • Shared folders: Easily transfer files between host and guest
  • Better performance: Optimized display and I/O drivers

Installation Steps:

1. Update your package list:

sudo apt update && sudo apt upgrade -y

2. Install required kernel headers and build tools:

sudo apt install -y linux-headers-$(uname -r) build-essential dkms

3. Insert the Guest Additions CD image:

In the VirtualBox menu bar, go to Devices > Insert Guest Additions CD image…

4. Mount the CD and run the installer:

sudo mkdir -p /media/cdrom
sudo mount /dev/cdrom /media/cdrom
sudo /media/cdrom/VBoxLinuxAdditions.run

5. Restart the VM to apply the changes:

sudo reboot

After rebooting, you should notice improved screen resolution, seamless mouse movement, and the ability to resize the VM window dynamically.

Step 7: Post-Installation Hardening and Tips

Now that Kali Linux is up and running inside VirtualBox, here are a few best practices to follow:

Keep Your System Updated

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

Run this regularly to ensure you have the latest security tools and patches.

Take a Snapshot

Before making any major changes or starting a new testing engagement, take a VirtualBox snapshot:

  • Go to Machine > Take Snapshot
  • Name it (e.g., "Clean Install") so you can roll back at any time

Configure Shared Folders

Set up a shared folder between your host and guest for easy file transfer:

  1. Go to Settings > Shared Folders
  2. Add a new folder, check Auto-mount and Make Permanent
  3. Inside Kali, access it at /media/sf_<foldername>

Explore the Pre-installed Toolset

Kali Linux comes pre-loaded with hundreds of security tools organized by category, including:

  • Nmap – network scanning
  • Metasploit Framework – exploitation
  • Burp Suite – web application testing
  • Wireshark – packet analysis
  • John the Ripper / Hashcat – password cracking

Taking Your Security Lab Further

A local VirtualBox setup is an excellent starting point, but it has limitations β€” your lab is tied to a single machine, and resource-intensive tasks can slow down your host system. For professionals who need more power, flexibility, or remote access, consider these alternatives:

  • VPS Hosting β€” Deploy a cloud-based Kali Linux instance accessible from anywhere, with dedicated resources and full root access.
  • Dedicated Servers β€” For enterprise-level security labs, red team operations, or training environments that require maximum performance and isolation.
  • GPU Hosting β€” Accelerate password cracking, hash analysis, and machine learning-based security tasks with GPU-powered infrastructure.

For teams running internal security tools, dashboards, or reporting platforms, Shared Web Hosting provides a cost-effective way to host supporting web applications alongside your lab environment.

Frequently Asked Questions

Can I run Kali Linux on VirtualBox without a powerful computer?

Yes, but performance will be limited. Allocate at least 2GB RAM and 2 CPU cores to the VM. For a better experience, 4GB RAM and 4 CPU cores are recommended.

Yes. Kali Linux itself is completely legal. However, using its tools to attack systems without explicit written permission is illegal. Always conduct penetration testing only on systems you own or have been authorized to test.

What's the difference between Kali Linux and Ubuntu?

While both are Debian-based, Kali Linux is purpose-built for offensive security and comes pre-loaded with hundreds of penetration testing tools. Ubuntu is a general-purpose distribution focused on usability and stability.

Should I use NAT or Bridged networking?

Use NAT for isolated testing where the VM only needs internet access. Use Bridged when you need the VM to appear as a separate device on your network β€” useful for testing network services or communicating with other VMs.

Can I install Kali Linux on a VPS instead of VirtualBox?

Absolutely. Many users prefer running Kali on a VPS Hosting plan for 24/7 availability, remote access, and better performance compared to a local VM.

Conclusion

Installing Kali Linux on VirtualBox is one of the most accessible ways to build a professional-grade cybersecurity lab. By following this guide, you've set up a fully functional Kali Linux environment, configured it for optimal performance with Guest Additions, and laid the groundwork for ethical hacking, penetration testing, and security research.

Whether you're preparing for certifications like OSCP or CEH, conducting authorized security assessments, or simply learning the craft of cybersecurity, a well-configured Kali Linux VM is an indispensable tool in your arsenal.

When your needs grow beyond what a local virtual machine can offer, AlexHost's VPS Hosting and Dedicated Servers provide the scalable, high-performance infrastructure to take your security operations to the next level.

Virtual Servers
Linux Security
Administration Backup Virtual Servers