Install VirtualBox Guest Addition on Kali Linux 2

These days (of holiday for me) I'm playing with the new Kali Linux 2. As usual I've installed the OS in a VirtualBox machine from scratch. So I have downloaded the x64 official full ISO here and I have created the virtual machine using setup steps provided by Kali.

Before getting the OS fully operational, with screen and graphic support, clipboard and shared folder (host/guest) you must install also the Virtual Box Guest Addition. It is very simple, let's do it.

Step 1: insert the Guest Addition Image

The first think to do is to insert the Guest Addition CD in the Kali (Guest) Machine. From device menu on your VirtualBox, click on Insert Guest Additions CD Image.... On a Mac it looks like the following screenshot.

Then you should see the Guest Addition available on the Desktop, click to cancel on the AutoRun dialog, we are not ready to instal the addition.

Step 2: Install the Linux Header files

Now we have to install the Linux Headers files, they are header files used to compile the kernel and other
applications which depend on the symbols and structures defined in these header files, like kernel modules. An example can be graphic card drivers needed to the Guest Addition Setup. To install them, open the terminal and type

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

This command will install the linux headers accordingly to your Kali kernel version (obtained with the $ uname -r command). I suggest to play with the uname command to understand some information about your system (kernel version, name, release and so on).

Step 3: run the Guest Addition Setup

To run the Guest Addition Setup type the following commands on a terminal. These copy the VBoxAddition Linux setup from the CS to the Desktop and run it.

$ cd /media/cdrom
$ cp VBoxLinuxAdditions.run ~/Desktop/
$ cd ~/Desktop/
$ chmod 777 VBoxLinuxAdditions.run 
$ ./VBoxLinuxAdditions.run 

This is a screenshot from my Kali Guest.

NB: Ensure that all the phases of the Guest Addition setup are done (note the ..done messages on the terminal output of the last command). If something wrong happens some features may not work properly.

Step 4: reboot the system

Type $ reboot on the terminal to reboot the Kali Guest.

Andrea Tarquini

IT Geek, Full Stack Developer, Programming Language Polyglot and IT security fan.

https://github.com/h4t0n https://twitter.com/h4t0n