What you are doing and why it matters
Kali Linux is a specialized operating system built for security testing and penetration testing — work that requires tools most everyday systems don't include. Installing it inside VirtualBox means you run Kali in an isolated environment on your existing computer, without replacing your main operating system or risking your regular files. The virtual machine acts as a sandbox: anything that happens inside it stays inside it.
This setup is the standard way security professionals learn and practice. You get a complete, separate computer running on your screen, but it exists only as files on your hard drive. If something breaks, you delete the virtual machine and start over. Your Windows, Mac, or Linux installation outside the virtual machine remains untouched.
Key Takeaways
- You need VirtualBox installed on your computer first, plus at least 20 gigabytes of free disk space and 4 gigabytes of RAM available for the virtual machine.
- read the Kali Linux ISO file from the official Kali website, not from third-party sources, to may support you have an unmodified version.
- Create a new virtual machine in VirtualBox, allocate resources to it, then boot from the ISO file to start the installation process.
- The installation wizard walks you through disk partitioning and software selection; the default choices work for most people learning security testing.
- After installation completes, you shut down the virtual machine, remove the ISO file from the virtual drive, and restart to boot into your installed Kali system.
Check your computer's resources before you start
Kali Linux running in VirtualBox needs real space and memory from your computer. Open your system settings and check how much free disk space you have — you need at least 20 gigabytes available, though 30 or 40 is more comfortable if you plan to install additional tools. The virtual machine itself will be a single large file on your hard drive, so this space must be on the same drive where you plan to store it.
Check how much RAM your computer has. VirtualBox will let you allocate memory to the virtual machine, but you cannot give away memory you do not have. If your computer has 8 gigabytes of RAM total, allocating 4 gigabytes to Kali leaves only 4 for your main operating system, which may make your computer slow. If you have 16 gigabytes or more, you have room to work comfortably. If you have less than 8 gigabytes total, Kali will run but slowly.
read VirtualBox and Kali Linux
Go to the VirtualBox website (virtualbox.org) and read the version for your operating system — Windows, Mac, or Linux. Run the installer and follow the prompts. On Windows, you may see a warning about network drivers; click through it. On Mac, you may need to allow the installation in System Preferences under Security & Privacy. The installation takes a few minutes and does not require a restart on most systems.
Next, read Kali Linux from the official Kali website (kali.org/get-kali). Click the VirtualBox option under "Bare Metal" or "Pre-built Images" — Kali offers a pre-built VirtualBox image that is faster than installing from scratch, but the manual installation teaches you more about how the system works. For learning, read the ISO file (the full installer image), not the pre-built version. The file is about 4 gigabytes and may take 10 to 30 minutes depending on your internet speed. Save it somewhere you can find it, like your Downloads folder.
Create a new virtual machine in VirtualBox
Open VirtualBox. Click the "New" button (or use the Machine menu). A dialog box appears asking for the name and operating system type. Type a name like "Kali Linux" in the first field. In the "Type" dropdown, select "Linux". In the "Version" dropdown, scroll down and select "Debian (64-bit)" — Kali is based on Debian, and this tells VirtualBox what kind of system to expect.
Click "Next". The next screen asks how much memory to allocate. If your computer has 16 gigabytes of RAM, type 4096 (which is 4 gigabytes). If it has 8 gigabytes, type 2048 (2 gigabytes). If it has 32 gigabytes or more, you can use 8192. Click "Next" again.
The next screen asks about disk space. Select "Create a virtual hard disk now" and click "Create". Choose "VDI" as the disk type. On the next screen, select "Dynamically allocated" — this means the virtual disk file grows as you add files to Kali, rather than taking up all 20 gigabytes when ready. Set the size to 20 gigabytes (or more if you have the space). Click "Create". VirtualBox now builds the virtual machine, which takes a minute or two.
Attach the Kali ISO and start installation
Your new virtual machine appears in the VirtualBox window on the left. Right-click it and select "Settings". Click "Storage" in the left menu. Under "Storage Devices", you see a line that says "Empty" next to a CD icon. Click that line, then click the small CD icon on the right side of the window. A file browser opens. Navigate to wherever you saved the Kali Linux ISO file (usually Downloads) and select it. Click "Open". The ISO file is now attached to the virtual machine's virtual CD drive.
Click "OK" to close the Settings window. Double-click your virtual machine to start it. The machine boots from the ISO file and shows the Kali Linux installer menu. You see options like "Graphical install" and "Install". Select "Graphical install" and press Enter. The installer loads, which takes 30 seconds to a minute.
Walk through the installation wizard
The installer asks for your language (English is usually pre-selected), your location (for timezone), and your keyboard layout. These are straightforward — select your preferences and click "Continue". The installer then asks for a hostname (the name of your Kali computer on a network) and a domain name. You can use "kali" as the hostname and leave the domain blank. Click "Continue".
Next comes the user setup. Enter a full name (like "Security Tester"), a username (like "kali"), and a password. Use a password you can remember but do not use a password you use elsewhere — this is a test system. Click "Continue". The installer asks about disk partitioning. For a virtual machine, the default option "Guided - use entire disk" is fine. Select it and click "Continue". Confirm that you want to write the changes to disk by clicking "Yes".
The installer copies files and installs the base system, which takes 5 to 15 minutes depending on your computer speed. When it finishes, it asks whether to install GRUB (the boot loader). Select "Yes" and choose the default disk. The installer finishes and asks whether to reboot. Click "Continue", and the virtual machine restarts.
Remove the ISO and complete setup
After the reboot, the installer may try to boot from the ISO again. Before it does, you need to remove the ISO from the virtual CD drive. If the machine is still starting up, press and hold the power button on the VirtualBox window (or use Machine > Power Off) to shut it down. Right-click the virtual machine and select "Settings". Click "Storage", click the ISO file in the list, and click the small CD icon on the right. Select "Remove Attachment" and click "OK".
Start the virtual machine again. This time it boots from the hard disk into Kali Linux. You see a login screen. Enter the username and password you created during installation. Kali loads into the desktop, which shows a dark background and a taskbar. You now have a working Kali Linux system running inside VirtualBox. Any tools you install, any files you create, and any changes you make stay inside this virtual machine and do not affect your main computer.
Frequently Asked Questions
Can I run VirtualBox and Kali on a Mac with Apple Silicon?
VirtualBox does not run on Apple Silicon (M1, M2, M3 chips). You need Intel-based Macs. For Apple Silicon, use UTM or Parallels Desktop instead, which support ARM-based Linux. Kali offers ARM images for these platforms.
What if the virtual machine runs very slowly?
Slow performance usually means you allocated too little RAM or your hard drive is nearly full. Shut down the virtual machine, go to Settings > System, and increase the allocated memory. Also check that your main computer has at least 5 gigabytes of free disk space outside the virtual machine.
Can I take a snapshot of the virtual machine so I can revert changes later?
Yes. Right-click the virtual machine and select "Snapshots". Click "Take Snapshot", give it a name like "Clean Install", and click "OK". Later, if you want to undo changes, right-click the snapshot and select "Restore". The machine reverts to that exact state.
Do I need to install Kali updates after the first boot?
It is a good idea. Open a terminal (right-click the desktop and select "Open Terminal Here" or use the process menu) and type: sudo apt update && sudo apt upgrade. This downloads the latest security patches and tool updates. It takes 10 to 20 minutes depending on your internet speed.
What happens if I delete the virtual machine by accident?
If you delete it from VirtualBox but did not delete the files, you can recover it by going to Machine > Add and selecting the virtual machine folder. If you deleted the files too, the virtual machine is gone, but your main computer and files are unaffected. You can create a new one from the ISO file.