Installing VirtualBox on Kali (Host)

You can install VirtualBox on Kali Linux, allowing you to use virtual machines (VMs) inside of Kali Linux. However if you are wanting to install Kali Linux as a VM, you want our [Kali Linux Guest Vbox (coming soon)](coming soon) page.

The first thing we are going to do is import VirtualBox’s repository key:

kali@kali:~$ wget -q -O- \
  | sudo apt-key add -

We then move onto adding VirtualBox’s repository. We add this to a separate file, so it does not interfere with Kali Linux’s main repository.

One thing to bare in mind, Kali Linux is based on Debian, so we need to use Debian’s current stable version:

kali@kali:~$ echo "deb [arch=amd64] $( lsb_release -cs ) contrib" \
  | sudo tee /etc/apt/sources.list.d/virtualbox.list

As we have altered our network repository, we need to re-build the cache.

kali@kali:~$ sudo apt update

As VirtualBox has various kernel modules (e.g. vboxdrv, vboxnetflt and vboxnetadp), we need to make sure they are kept up-to-date when Kali’s kernel gets updated. This can be achieved using dkms.

kali@kali:~$ sudo apt install -y dkms

Now its time to install VirtualBox itself (along with its Extension Pack to expand VirtualBox’s advanced features):

kali@kali:~$ sudo apt install -y virtualbox virtualbox-ext-pack

When prompted, read and accept the license.

You can now find VirtualBox in the menu or start it via the command line:

kali@kali:~$ virtualbox

Updated on: 2020-Mar-05
Author: g0tmi1k