What you're doing and what you need

Installing Kali Linux on VirtualBox means running Kali as a guest operating system inside a virtual machine on your existing computer. You're not replacing your main system — you're creating an isolated sandbox where Kali runs alongside Windows, macOS, or Linux. This is the safest way to learn Kali's penetration testing tools without risking your primary machine.

Before you start, you need three things: VirtualBox installed on your computer, a Kali Linux image file (called an ISO), and at least 20 GB of free disk space. The entire process takes 30 to 45 minutes from download to first boot. Your computer should have at least 4 GB of RAM available to give to the virtual machine, though 8 GB is more comfortable.

Key Takeaways

  • Download VirtualBox from virtualbox.org and Kali Linux from kali.org, then install VirtualBox on your main computer first.
  • Create a new virtual machine in VirtualBox, allocate at least 20 GB of disk space and 2 GB of RAM, then point it to the Kali ISO file you downloaded.
  • Boot the virtual machine and follow Kali's installer to completion, choosing guided partitioning and letting it use the entire virtual disk.
  • After installation finishes, remove the ISO from the virtual drive and restart — Kali will then boot from the virtual hard disk.
  • Update Kali immediately after first boot by running sudo apt update and sudo apt upgrade in the terminal.

Download VirtualBox and Kali Linux

Go to virtualbox.org and download the VirtualBox installer for your operating system. If you use Windows, download the Windows installer. If you use macOS, choose the macOS version. If you already run Linux, download the Linux version. Install VirtualBox on your main computer using the standard installer — accept the defaults unless you have a specific reason to change them.

Next, go to kali.org/get-kali and download the VirtualBox image. Look for the section labeled "Bare Metal and Virtualization" and click the VirtualBox link. This downloads a pre-built Kali image that is faster than installing from scratch. The file is large (around 3 GB) and may take 10 to 20 minutes depending on your internet speed. Save it somewhere you can find it, like your Downloads folder.

Create a new virtual machine

Open VirtualBox. Click the blue "New" button in the top left. A dialog box opens asking for a machine name. Type "Kali Linux" or any name you want. VirtualBox should automatically detect that you're creating a Linux machine — if it does not, click the dropdown under "Type" and select "Linux", then select "Debian (64-bit)" under "Version".

On the next screen, allocate memory (RAM). The dialog suggests a default amount. Change it to at least 2048 MB (2 GB) if you have 8 GB or more of total RAM on your computer. If your computer has only 4 GB total, use 1024 MB. Click "Next".

The next screen asks about the hard disk. Select "Create a virtual hard disk now" and click "Create". On the following screen, choose "VDI (VirtualBox Disk Image)" as the disk type. Then choose "Dynamically allocated" — this means the virtual disk only uses space as Kali needs it, rather than reserving 20 GB immediately. Click "Next".

Set the disk size to 20 GB. This is the minimum for a comfortable Kali installation with room for tools and updates. Click "Create". VirtualBox now shows your new machine in the left panel.

Attach the Kali ISO and start installation

Right-click the Kali Linux machine you just created and select "Settings". Click "Storage" in the left menu. Under "Controller: IDE", you see an empty CD icon. Click that CD icon, then click the small CD icon on the right side of the dialog. A file browser opens. Navigate to the Kali ISO file you downloaded and select it. Click "Open", then click "OK" to close Settings.

Double-click the Kali Linux machine to start it. The virtual machine boots from the ISO file. After a few seconds, you see the Kali boot menu with options like "Graphical Install" and "Install". Click "Graphical Install" — this is the easiest path for first-time users.

The installer walks you through language, location, and keyboard settings. Accept the defaults unless you need different settings. When asked for a hostname, type anything you want — "kali" is fine. When asked for a domain name, leave it blank and click "Continue".

Partition the disk and complete installation

The installer asks how you want to partition the disk. Select "Guided - use entire disk" and click "Continue". On the next screen, select the virtual disk (it shows as something like "VBOX HARDDISK"). Click "Continue". When asked whether to put everything in one partition or split it, select "All files in one partition" — this is simpler for a virtual machine. Click "Continue".

Review the partition summary. It shows the virtual disk will be wiped and formatted. This is expected and correct. Click "Continue". The installer now formats the disk and copies files. This takes 5 to 10 minutes. Do not interrupt or close the window.

When asked about a package manager, accept the default (usually a nearby mirror). The installer downloads and installs packages — this takes another 5 to 10 minutes. When asked whether to install GRUB (the boot loader), select "Yes" and choose the virtual disk as the location. Click "Continue".

The installer finishes and shows a message that installation is complete. Click "Continue". The machine reboots.

Remove the ISO and boot into Kali

After the reboot, the machine tries to boot from the ISO again. You need to remove it so Kali boots from the virtual hard disk instead. Right-click the Kali machine and select "Settings". Click "Storage". Under "Controller: IDE", click the ISO file (it shows the Kali filename). On the right side, click the small CD icon with an X. This removes the ISO. Click "OK".

Double-click the Kali machine again. It now boots from the virtual hard disk. After 30 to 60 seconds, you see the Kali login screen. The default username is "root" and the default password is "kali". Type these and press Enter. You are now inside Kali Linux.

Update Kali after first boot

Open a terminal by right-clicking the desktop and selecting "Open Terminal Here", or by clicking the terminal icon if one is visible on the desktop. Type the following command and press Enter:

sudo apt update

This downloads a list of available packages. When it finishes, type:

sudo apt upgrade

This installs security updates and patches. You may be asked to confirm — type "y" and press Enter. This process takes 5 to 15 minutes depending on how many updates are available. When it finishes, your Kali installation is current and ready to use.

Frequently Asked Questions

Can I use the pre-built VirtualBox image instead of installing from scratch?

Yes. Kali offers a ready-made VirtualBox image on kali.org/get-kali that you can import directly into VirtualBox without running the installer. In VirtualBox, go to File > Import Appliance, select the downloaded image file, and follow the prompts. This is faster than the manual installation method described above.

What if the virtual machine runs slowly?

Increase the RAM and CPU cores allocated to the machine. Right-click the Kali machine, select Settings, and increase the memory under System. Under Processor, increase the CPU cores if your computer has multiple cores available. Restart the machine for changes to take effect. You can also enable 3D acceleration under Display, though this requires additional setup.

How do I copy files between my main computer and the Kali virtual machine?

In VirtualBox, go to Devices > Shared Folders and add a folder from your main computer. Inside Kali, the folder appears in /media/sf_[foldername]. You can then copy files back and forth. Alternatively, use a USB drive — plug it into your computer, then go to Devices > USB and select the drive to attach it to the virtual machine.

Do I need to pay for Kali Linux?

No. Kali Linux is free and open-source. VirtualBox is also free. You pay nothing to set up this environment.

Can I run Kali on a Mac with Apple Silicon?

VirtualBox does not support Apple Silicon Macs. You need to use UTM or Parallels Desktop instead. Kali provides ARM images for these platforms on kali.org/get-kali.