Installing Kali Linux in VirtualBox

Patrick
6 min readSep 29, 2020

--

This blog will serve as a step-by-step guide on how to install Kali Linux in Virtualbox as a GuestVM. What this means is that you will be able to use Kali in an isolated environment, completely separate from your host machine.

Step 1 — Install VirtualBox

Download and install the VirtualBox package for your operating system of choice. I am using Windows so I will download the ‘Windows host’ package.

Step 2 — Download the Kali Linux ISO image

Offensive Security provides custom VMware and VirtualBox images that you can download and install. This method is very straightforward, however I prefer to download the ISO image from https://cdimage.kali.org. As you may know, Kali no longer has the default root user as of version 2020.1. This change was implemented as many users run Kali as their daily driver. Personally, I do not, and I find the extra step of having to escalate my privileges to root annoying, so I prefer to run the 2019.4 version. This is why I choose to download the ISO image rather than the custom VirtualBox image.

Navigate to https://cdimage.kali.org and click on the kali-2019.4 folder.

Download the kali-linux-2019.4-amd64.iso file.

Step 3 — Starting up VirtualBox and creating the VM

Click on ‘New’ then set the following parameters

  • Name: Kali_Linux
  • Machine Folder: D:\Kali (You can install in wherever you like)
  • Type: Linux
  • Version: Debian (64-bit)
  • Memory Size: 2048 (2gb) is recommended
  • Hard Disk: Create a virtual hard disk now

Then click ‘Create’ to continue on to ‘Create Virtual Hard Disk’

Here you will want to set the following parameters

  • File Location: This field is auto-populated, you can change it as desired
  • Hard Disk File Type: VDI (Default)
  • Storage on Physical Hard Disk: Dynamically Allocated (Default)

Once set, click ‘Create’, to create a new VM

Step 4 — Settings Configuration

Once your VM has been created, you will need a adjust a few settings. Click on the ‘Settings’ button in the toolbar.

First, navigate to ‘Display’ in the left hand toolbar to adjust the display settings

  • Set the Video Memory to 128MB, this will ensure smooth performance
  • Check the ‘Acceleration’ tickbox to enable 3D Acceleration. Note: If you experience a black screen upon login, after performing the full install, you may need to uncheck this box.

Second, navigate to ‘Network’ to adjust the network settings

  • In the dropdown, set ‘Attached to:’ as ‘Bridged Adapter’

Bridged Mode allows your VM to connect directly to your network. What this means is that your host machine will share its network connection with the VM. Everyone on your network will be able to see and interact with the VM as they would with the host machine.

Third, navigate to ‘General’ and go to the ‘Advanced’ tab

Change the following settings:

  • Shared Clipboard: Bidirectional
  • Drag’n’Drop: Bidirectional

These two settings will allow you to copy and paste text and files from the VM to your host machine and vice versa.

Fourth, navigate to ‘System’ and go to the ‘Processor’ tab

Here you will want to adjust the slider to change the number of CPU cores the VM is allowed to utilize. Here I have it set to 2.

Fifth and final step, navigate to ‘Storage’ to mount the Kali ISO image

  • Under Storage Devices > Controller: IDE you will see an empty disk image, click on ‘Empty’
  • Next click on the disk icon under Attributes > Optical Drive
  • Then click on ‘Choose/Create a Virtual Optical Disk’ and select the Kali ISO image (kali-linux-2019.4-amd64.iso) you downloaded previously

Step 5 — Start the VM and Install Kali

Once you have finished adjusting the settings click the ‘Start’ button to being the Kali installation process.

After clicking the start button you will be presented with a ‘Boot menu’ screen. Using the keyboard arrow keys, navigate to ‘Graphical install’ and then press Enter to continue.

The next few steps are rather straightforward, just your standard configuration options.

  • Select your preferred language
  • Select your location
  • Select your preferred keyboard configuration
  • Enter the hostname for your VM
  • Set up users and password
  • Configure the clock
  • Partition disks

Once you have finished with the configuration options, click ‘Continue’ to install Kali.

Halfway through the install process you will be asked to configure the package manager. Click on the radio button for ‘yes’. This option will allow you to install or update application packages from online repositories.

Enter information about your proxy server if you use a proxy server for internet access. If you do not, leave it empty.

Next you will be asked whether you want to install the GRUB boot loader, click the radio button for ‘yes’.

You will then be prompted to select the disk where GRUB will be installed. Leave it as the default selection and press ‘Continue’ to complete the installation.

Once the installation is complete you will see notification message, click on ‘Continue’ to reboot the machine and login.

Step 6 — Logging in and installing updates

Login with the credentials you have specified during the installation process. The default user is ‘root’.

Once you have logged in, click on the terminal in the toolbar and type ‘apt update’ in the command line to update the list of available packages and their versions.

Once ‘apt update’ is complete, type ‘apt upgrade’ in the command line to install the newer versions of all the packages you have. After the upgrade process has completed, restart your machine.

Congratulations!! you have successfully installed Kali Linux in VirtualBox.

--

--