It seems there’s lots of confusion on what is the correct way to install VirtualBox guest additions packages on Kali Linux. Unfortunately, there’s only one way to do it! So if you’re not following the steps below, you won’t be able to use Kali Linux is full screen properly (seamless windows) and shared clipboard or drag n’drop will not work. I’ve actually posted this in a separate post with detailed step by step instructions showing how to install Kali Linux on VirtualBox. But even on that post, I’ve seen many users getting confused and it seems creating a separate post about correct way to install VirtualBox Guest additions packages on Kali Linux is the way to go.
This post will fix or resolve the following issues:
- Can’t make Kali Linux run in full screen on VirtualBox
- Can’t enable shared folder on Kali Linux running on VirtualBox.
- Shared clipboard not working on Kali Linux on VirtualBox.
- Kali Linux on VirtualBox is slow and not responding. It freezes!
- Mouse integration is not working on Kali Linux on VirtualBox.
- Kali Linux on VirtualBox doesn’t detect your display resolution properly.
While we are at it, I will also include the instructions on how to create a shared folder so that you can copy paste contents between your host and guest operating system.
Correct way to install VirtualBox Guest Additions packages on Kali Linux
I guess the most annoying issue in a VirtualBox is when you are not able to make it fullscreen and even if you’re able to, it just wont play nicely. Following are the exact steps you need to follow to install VirtualBox guest additions packages on Kali Linux and fix these issue.
Step 1: Install dependencies
One thing to note is that you need to have the correct repositories added before any of these would work. Once you’ve added the correct and official repositories, just update your package manager.
apt-get update apt-get upgrade -y apt-get dist-upgrade -y
Update 24/04/2015: As Violatedsmurf pointed out in the comments section, it’s better off doing update, upgrade and dist-upgrade before installing headers. It’s because if you’ve installed an older Kali Linux version, correct Linux headers might not be available in the repo anymore.
Install all the dependencies by running the following command:
apt-get install linux-headers-$(uname -r) -y
Step 2: Mount VirtualBox Guest Additions drive
From device menu on your VirtualBox, click on Install VirtualBox guest additions option (while you’re running Kali Linux) and you’ll see a CD/DVD drive is mounted.
Step 3: Copy and install the package
Copy the VBoxLinuxAdditions.run file from the drive to the root directory using following command
cp /media/cdrom/VBoxLinuxAdditions.run /root/Desktop/ cd /root/Desktop/
Make it executable:
chmod 755 /root/VBoxLinuxAdditions.run
Once you’ve installed VirtualBox Guest Additions package, reboot Kali Linux.
In the screenshot above, note all the …done. messages. When you see these, you know it was a successful installation.
Now you will have Kali Linux running on full screen on your VirtualBox.
Creating Shared Folders with the Host System
In order to share folders on your host system with your Kali Linux VirtualBox, there are a few short steps that needs to be completed.
Step 4: Add a folder/drive to Shared Folder Settings
From the VirtualBox Manager, select your Kali Linux VirtualBox instance and click on the ‘Shared Folders Settings’ 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.
Step 5: Auto-mount and Make permanent your shared 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.
Your shared folders will now be available in the media directory. You can create a bookmark or link for easier access to the directory.
Thanks for reading. If you’ve found it useful, please share. Comment if you need help or discuss options.