Should you decide to install Kali Linux within VirtualBox, you will need to follow the instructions below in order to successfully install the Linux Guest Addition tools.

You must use version 4.2.xx or higher of VirtualBox in order to take advantage of the improvements, including compatibility updates, and enhanced stability of both the core application and the Guest Additions.

Installing VirtualBox Guest Additions in Kali Linux

In order to have proper mouse and screen integration as well as folder sharing with your host system, you will need to install the VirtualBox Guest additions.

Once you have booted into your Kali Linux virtual machine, open a terminal window and issue the following command to install the Linux Kernel headers.

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

Once this is complete you can now attach the Guest Additions CD-Rom. This can be done by selecting ‘Devices’ from the VirtualBox Menu and selecting ‘Install Guest Additions.’ This will mount the GuestAdditions iso to the virtual CD Drive in your Kali Linux virtual machine. When prompted to autorun the CD, click the Cancel button.

VirtualBox-Cancel-Auto-Run

From a terminal window, copy the VboxLinuxAdditions.run file from the Guest Additions CD-Rom to a path on your local system ensure it is executable and run the file to begin installation.

cp /media/cd-rom/VBoxLinuxAdditions.run /root/
chmod 755 /root/VBoxLinuxAdditions.run
cd /root
./VBoxLinuxAdditions.run

VirtualBox-VBox-Additions-Install

Reboot the Kali Linux VM to complete the Guest Additions installation. You should now have full mouse and screen integration as well as the ability to share folders with the host system.

Creating Shared Folders with the Host System

In order to share folders on your host system with your Kali Linux VM, there are a few short steps that need to be completed.

From the VirtualBox Manager, select your Kali Linux VM instance and click on the ‘Shared Folders’ link in the right window pane. This will launch a pop up window for adding shared folders. Within this window click the icon to add a folder.

In the Folder Path text box, provide the path to the folder you would like to share, or click the drop-down arrow to browse your host system for the path. Select the check boxes that allow for ‘Auto-mount’ and ‘Make Permanent’ and click the OK button both times when prompted.

Figure-20-Shared-folder-config

Your shared folders will now be available in the media directory. You can create a bookmark or link for easier access to the directory.

VirtualBox-Shared-folder-in-Kali