How to Install Kali Linux on VirtualBox (2020)

install kali linux 2020.1 on virtualbox

If you’re a beginner and want to become an ethical hacker, one of the first steps you must take is to install the hacker’s operating system. In this guide, I will teach you how to install Kali Linux on VirtualBox to get you started.

Historically, installing Kali Linux was a very easy and straight forward process. But with the recent introduction of the latest Kali Linux 2020 installer files, things seem not to work too well out of the box.

So I emplore you to follow this guide step-by-step so that you get this right the first time. And on behalf of the Kali developers, I apologize for the extra steps.

But if you’d rather skip the headache, Kali is not the only “hackers” OS. You can install Parrot Security OS which I even prefer over Kali because of these little nuances here and there.

Don’t miss: Check out my FREE course on phishing passwords and 2FA with evilginx2

What You’ll Need

In other to reduce the frustration and install Kali Linux 2020 on VirtualBox in full offline mode you’ll need the following:

  1. Download and install the VirtualBox binary for your operating system
  2. Download Kali Linux 2020 Installer file
  3. Patience in following the instructions step-by-step

Preparation for Install

Now using the prerequisites listed above, we are going to create a guest virtual machine (VM), attach the Kali Linux ISO file you downloaded to it, and thereafter proceed to the actual installation.

1. Launch VirtualBox and create a guest VM.

Click “New” under the Tools menu to start creating a new virtual machine.

Setup VirtualBox for Kali 2020 installation

Then click “Expert mode” on the bottom of the pop-up window.

Create Virtual Guest OS for Kali 2020

Now configure the Kali Linux 2020 guest VM with the following details:

Create Virtual Guest OS for Kali 2020
  • Name: Kali Linux 2020 (You can name yours whatever you like)
  • Machine folder: Don’t change this.
  • Type: Linux
  • Version: Debian 64-bit (If you don’t have 64-bit options on the dropdown, don’t worry this video will help you fix that).
  • Memory size: 2048 MB minimum. (Allocate more RAM if your PC can allow).
  • Hard Disk: Create a virtual hard disk now.

Cross-check what you have with my screenshot above. Click “create” to proceed.

2. Create a virtual hard disk for the Kali guest VM

After you click create from step 1 above, a new window will pop up. Set the File size of the virtual hard disk to a minimum of 30GB. Leave every other configuration as it is and click “create” again to finish up.

Create Virtual hard disk for Kali 2020 installation on VirtualBox

3. Attach the downloaded Kali ISO file to the Kali guest VM.

Right-click on the Kali guest VM and click “settings” Then click Storage > Empty > the Disk Icon > and Choose a disk file as shown in the screenshot below. Now locate where you downloaded the Kali ISO installer file and select it.

Create Virtual hard disk for Kali 2020 installation on VirtualBox

Install Kali Linux 2020.2 on VirtualBox

With all that prep out of the way, continue with the written steps to install Kali Linux 2020 on VirtualBox. Or you can watch this tutorial video if you are more of a visual learner.

Step 1: Double click to launch the Kali VM, and select Graphical install on the boot screen.

Kali Linux 2020 installation boot screen

Step 2: Select your preferred system language.

Select Kali system language

Step 3: Specify your geographic location.

Select Kali system location

Step 4: Select your preferred keyboard layout.

Select Kali system keyboard

Step 5: The installer will now copy over the Kali image to your virtual hard disk, probe the available network interfaces, and prompt you to enter a system hostname. I will leave the hostname as the default “Kali”. Change yours if you want.

Set Kali Linux 2020 system hostname to "Kali"

Step 6: (Optional) You may add this Kali machine to a domain or press enter to skip.

Enter domain name for Kali system

Step 7: Create a standard, non-administrative user for the system.

This will be the user account that you will use for every day running of this Kali machine. (Kudos to the Kali team for adding this step! This was not there until these latest Kali Linux 2020 releases).

Create unprivileged user for Kali Linux 2020

Create a username for the standard user

Create unprivileged user for Kali Linux 2020

Set a password for the standard user.

Create unprivileged user for Kali Linux 2020

Step 8: Set the system time zone.

Set Kali time zone

Step 9: The installer will launch the disk partitioner and offer you 4 options. I recommend beginners to select the Guided – use entire disk option.

Use entire disk - Kali Linux 2020 installation

Select the disk to be partitioned. Only your laptop’s hard disk will probably be listed here.

Partition VirtualBox hard disk for Kali Linux 2020 installation

Select how you want the disk to be partitioned. Again for beginners, I recommend you choose the All files in one partition option. But you could still choose to have the home directory in a separate partition like in the example below.

Partition VirtualBox hard disk for Kali Linux 2020 installation

Review your disk partitioning configuration.

Partition VirtualBox hard disk for Kali Linux 2020 installation

Write the changes to disk. This is the last time to change your mind after now, the disk formatting cannot be reversed. Select yes and press enter.

Notice: At this point, before you select “yes”, I want you to disconnect VirtualBox from the internet. Make sure you proceed from here without internet on the Kali VM you’re creating.

Partition VirtualBox hard disk for Kali Linux 2020 installation

Step 10: (Optional) If you use a proxy, enter the HTTP proxy information or press enter to skip it.

Enter Kali proxy

Step 11: (Important!) If you turned off internet connection as I told you in step 9 above, you’re going to receive this error which is perfectly fine. Just click on “Go Back“.

Bad Archive Mirror Because Offline Mode

And select “Yes” to continue without a network mirror.

Yes Continue without a network mirror

Step 12: Kali Linux 2020 releases now give users the option to decide what Kali desktop environment, and what amount of cybersecurity tools to install during the installation.

Note: Please leave everything as it is on this menu and continue.

Leave Default Package Selection

Step 13: Select “yes” to install GRUB bootloader.

Install GRUB bootloader on Kali system

Select your VBOX hard disk for GRUB to install on it

Install GRUB bootloader on Kali system

Step 14: Finally, give the installer a little while to wrap things up… Installation completed!

Kali Linux 2020 installation on VirtualBox completed

Congrats if you got to this screen! You have just successfully installed Kali Linux 2020 on VirtualBox, but that’s not all. We have a few things to fix before the machine is useable.

Fix Installation Errors in Kali Linux 2020 Offline Installer & Install Guest Additions

Because we installed Kali in offline mode, we are going to very most likely have the following issues but I’ll show you how to fix them.

1. Apt-get install / update not working

Now, this is because on step 11, we chose to configure our apt manager without a network mirror but it is pretty easy to fix.

All you have to do is fill in the official Kali repository sources address below into your Kali sources.list file. Ensure you don’t make a mistake.

deb http://http.kali.org/kali kali-rolling main non-free contrib

Log in using the username and password you set during the installation.

Now open a terminal window and type in the follwing command to open the sources.list file and paste in the above address.

sudo nano /etc/apt/sources.list

Paste it at the bottom like you see in the screenshot below and save (cntrl + s).

Fix Kali Linux Apt-get Install/Update Not Working

Now you must update the system with the below command. You can also use this to confirm the operation worked. But don’t forget to connect your VM back to the internet (remember we disconnected it on step 9).

sudo apt update

2. Upgrade Kali Linux image & headers to the same version

In order to be able to install VirtualBox guess additions to have fullscreen you need to have the right Kali Linux headers installed.

From what I have seen there is a weird mismatch between the installed Kali Linux image and the Kali Linux header. It wouldn’t have been a problem if we could just install the matching Kali Linux headers to match the installed Kali image from the Kali repos.

Anyways to fix that type begin typing in sudo apt install linux-headers- and press the tab key twice to see the versions available.

Repeat that again for the Linux image by typing sudo apt install linux-image- and again press tab twice to see available versions.

Now go ahead and install the matching versions from both commands like you see in my screenshot below. If you have issues doing this, refer to the video above for clarifications.

Fix Kali Linux Header Kali Linux Image Mismatch

In my case, this came down to the following commands. But the matching version numbers for yours may be different.

sudo apt install linux-headers-5.7.0-kali1-amd64 && sudo apt install linux-image-5.7.0-kali1-amd64 -y

Now you need to close the virtual machine (as rebooting may not do the trick here) for the big changes to take effect.

3. Install VirtualBox Guest Additions on Kali Linux 2020.2 Without Errors

If you have done everything exactly up till this point then you won’t receive any errors in installing VirtualBox guest additions.

sudo apt install virtualbox-guest-utils virtualbox-guest-x11

Close the virtual machine to restart it and you’re done. But just in case the VM refuses to go into full-screen mode automatically on login, just press the right ctrl key + F like twice or thrice.

Wondering what to do next? I invite you to follow my How to Become a Hacker series to learn practical ethical hacking and put your Kali Linux machine to good use.

If you have any questions regarding this post, please send them to me in the comment box below. And also consider sharing this post with your friends if it helped you.

5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Scroll to Top