Configure Kali Linux as a VirtualBox guest

If Kali-Linux is to run as a "guest host" within VirtualBox, then, as with all other VirtualBox guests with graphical user interfaces, installation of the Guest Additions will be necessary. If you want to take advantage of the improvements, including the compatibility updates and the improved stability of the main application and guest enhancements, then you must use VirtualBox version 4.2.xx or newer.

Providing the Guest Additions in VirtualBox

In order to provide the Guest Additions later in the guest virtual available, we get us in VirtualBox itself, or here.

In the host application VirtualBox, the displayed window is now opened under the menu item "File - Settings - Additional packages". Here you can integrate the newly downloaded Guest Additions to the program to provide them later the guest hosts to mount available.

Installing the Guest Additions in Kali Linux

Back in the guest virtual host Kali Linux you start a terminal window and run the following commands, followed by rebooting the virtual machine.

apt-get update apt-get -y install virtualbox-guest-x11 reboot

After the reboot, you must generally provide the system with the Linux kernel headers so that the modules are available for graphics and other drivers. To do this, refresh the package management again and install the kernel headers matching the current kernel.

apt-get update apt-get -y install linux-headers-$(uname -r)

Once this is done, you can attach the "Guest Additions" CD-ROM image. Select "Devices" from the VirtualBox menu and then "Install Guest Additions". This will mount the Guest Additions ISO file in the virtual CD drive in your Kali Linux Virtual Machine. If you are prompted to start the CD automatically, click the Cancel button.

Then, copy the VboxLinuxAdditions.run file from the Guest Additions CD-ROM virtual machine to a path on the local system of the virtual machine because the virtual CD-ROM device is read-only but not writable. Then you can make the file executable and start the installation process.