How to Install Kali Linux on VirtualBox

Introduction

Kali Linux is a Debian-based Linux distribution featuring over six hundred preinstalled penetration testing programs. Installing Kali as a virtual machine on a type 2 hypervisor such as VirtualBox provides the isolation and rollback capabilities necessary for advanced security testing.

This step-by-step tutorial shows you how to install Kali Linux on VirtualBox.

How to install Kali Linux on VirtualBox.

Prerequisites

  • VirtualBox installed (this tutorial uses VirtualBox 7).
  • 2 GB of RAM or more available for VM creation.
  • 25 GB of free disk space.

Note: Learn more about Kali Linux and compare it to other distros in Kali Linux vs. Ubuntu.

Preparing to Install Kali Linux on VirtualBox

To create and prepare a virtual machine for Kali Linux, you must load an ISO file and configure virtual hardware, such as memory, CPU cores, and hard disks. Follow the steps below to complete these actions.

Step 1: Download Kali Linux ISO Image

Kali Linux offers ISO images for 32-bit, 64-bit, and ARM64 architectures. To download an ISO file:

1. Visit the installer section of the Kali Linux official website.

2. Select the system architecture of the host OS and download the ISO file by clicking the button in the bottom-left corner of the installer card.

Downloading the Kali Linux ISO from the installer section of the official website.

Step 2: Create Kali Linux VirtualBox Instance

Create a new virtual machine and configure it to run Kali Linux. Proceed with the steps below to correctly set up a Kali Linux VM in VirtualBox:

1. Launch VirtualBox Manager and click the New icon.

The location of the New button in VirtualBox.

2. Specify a name for the VM and provide the path to the ISO image. Select Next.

Naming the VM and providing the path to the ISO file.

3. Select the amount of memory and the number of virtual CPUs to allocate to the VM. The minimum recommended values for Kali Linux are 2 GB of RAM and 1 CPU. Select Next when you finish setting up the VM hardware.

Allocating hardware resources to the Kali Linux VM.

4. Create a virtual hard disk for the new VM. The recommended hard disk size is at least 25 GB. Alternatively, you can use an existing virtual hard disk file or decide not to add one. Click Next to proceed to the next step.

Creating a virtual hard disk for the VM.

5. Review the new VM setup on the Summary page. Select Finish to create the virtual machine.

The Summary page showing the chosen VM configuration.

The VM appears on the list in VirtualBox Manager.

Step 3: Configure Virtual Machine Settings and Start VM

Before starting the VM and beginning the installation process, follow the steps below to perform additional adjustments on the VM:

1. Select the Kali Linux VM and click the Settings icon.

Accessing advanced VM settings in VirtualBox Manager.

2. Select the Advanced tab in the General section and change the Shared Clipboard and Drag'n'Drop settings to Bidirectional. This feature allows the host and the guest machine to exchange files.

Allowing clipboard communication between the host and the VM.

Warning: Connecting the host and VM clipboards breaks VM isolation. Use this option with caution.

3. Select Network from the menu on the left side. Change the Attached to field to Bridged Adapter. Select OK at the bottom of the window to return to the main window.

Attaching the network adapter to bridged adapter.

4. Click Start to begin installing Kali Linux.

Starting the virtual machine.

How to Install Kali Linux on VirtualBox

Kali Linux uses the Debian installer to set up the operating system. The sections below provide a detailed walkthrough of the installer and offer advice on configuring Kali Linux.

Step 1: Perform Initial Configuration

When the new VM is started, the Kali Linux installer menu appears. Start the installation procedure by following the steps below:

1. Select the Graphical install option.

The Graphical install option in the Kali Linux installer menu.

2. Choose the system's default language, which will also be used during installation.

3. Find and select your country from the list, or choose other.

4. Decide which keyboard mapping to use.

Step 2: Configure Host, User, and Time Zone

The following installer steps set up the hostname and domain of the system and configure the user:

1. In the Configure the network section, enter a system hostname.

Specifying a hostname.

2. Type a domain name that the OS will use to identify the VM within a network. Specifying a domain name is not necessary if the VM is not part of an extensive local network.

Specifying a domain name.

3. Create a user account by providing the user's full name and username.

4. Create a strong password for the user account.

Setting up a password.

5. Select the correct time zone from the available options.

Step 3: Create Hard Disk Partitions

Proceed with the following steps to create a bootable partition on the virtual hard disk:

1. Select how to partition the hard disk. The default option is Guided - use entire disk.

Choosing guided partitioning for the disk.

2. Select the disk you want to use for partitioning. The only available option is the disk created during the VM creation.

3. Select the partitioning scheme. The default option is All files in one partition.

4. The wizard provides an overview of the configured partitions. Ensure that the Finish partitioning and write changes to disk option is selected.

5. Confirm the choice by selecting Yes on the next screen.

Confirming disk partitioning.

The wizard starts installing Kali.

Step 4: Customize Kali Linux Installation

After installing the system's core, Kali enables users to customize the OS further. Choose the components to install by executing the following steps:

1. Select the desktop environment and the tools you want, or click Continue to proceed with the default options.

Choosing a desktop environment and tool collections.

2. Select whether you want to use a network mirror.

3. If you use an HTTP proxy, enter the necessary information. Otherwise, leave the field blank.

4. Install the GRUB bootloader on the hard disk. Select Yes and Continue.

5. Select a bootloader device to ensure the newly installed system is bootable.

Installing the GRUB bootloader.

When Kali finishes installing, the Installation is complete message appears.

6. Click Continue to reboot your VM. After rebooting, the Kali login screen appears.

7. Enter the username and password created in the previous steps.

The Kali Linux desktop appears on the screen.

Kali desktop.

Running Kali Linux Pre-Built VM on VirtualBox

A quick way to run a Kali Linux VM is by using a pre-built VirtualBox image. The section below explains how to obtain and start a pre-built Kali Linux image on VirtualBox.

1. Visit the Pre-built VMs page on the official Kali Linux website.

2. Select the desired architecture and click the download button in the bottom left corner of the VirtualBox card.

Downloading a pre-built image for VirtualBox.

3. Wait for the 7z file to download, then unpack it to a directory of your choice.

4. Open VirtualBox Manager and select the Add button in the top menu.

The location of the Add button in VirtualBox Manager.

5. Locate the virtual machine file you downloaded and unpacked. Double-click the file to open it.

Locating the downloaded and unpacked virtual machine file.

A Kali Linux VM instance appears in the menu on the left side of the screen.

6. Select the instance and click the Start button in the top menu.

Starting a VM created using a pre-built image.

Wait for the system to boot up.

7. On the login screen, use username kali and password kali to log in.

Note: You can create a new user within Kali Linux.

The Kali Linux desktop appears.

Conclusion

This guide showed you how to install Kali Linux in VirtualBox. It covered the procedures for installing Kali using the official ISO and running the OS from a pre-built VirtualBox image.

If you are starting with penetration testing, read our article on penetration testing types and techniques.

Was this article helpful?
YesNo
Marko Aleksic
Marko Aleksić is a Technical Writer at phoenixNAP. His innate curiosity regarding all things IT, combined with over a decade long background in writing, teaching and working in IT-related fields, led him to technical writing, where he has an opportunity to employ his skills and make technology less daunting to everyone.
Next you should read
CentOS 8 Released: New Features, Changes, & How to Download
October 2, 2019

CentOS is widely popular among developers and system administrators as it offers full control over its highly ...
Read more
How to Install VirtualBox on CentOS 7
September 27, 2019

This guide explains how to install VirtualBox 6.0 on CentOS 7 directly from official Oracle repositories. Get ...
Read more
How to Install VirtualBox on Ubuntu
March 13, 2024

VirtualBox is a powerful tool for running a virtual operating system on your computer. In this tutorial learn ...
Read more
Containers vs Virtual Machines (VMs): What's the Difference?
January 25, 2024

Both virtual machines and containers are used to created isolated virtual environments for developing and ...
Read more