Kali Linux in VirtualBox … the constant “Brain-Ache” with Guest Additions

I appreciate there are a plethora of posts about this particular subject online, ranging from the simple to the sublime, however I just need something to remember the basic order of things and something to remind me of the component parts.

Let’s start with what we don’t need:

  • virtualbox-guest-dkms
  • virtualbox-guest-utils
  • virtualbox-guest-x11

So we must remove them

ShellScript
sudo apt remove -y virtualbox-guest-x11 virtualbox-guest-dkms virtualbox-guest-utils

Now let’s remember what we do need:

  • Linux Headers
  • build-essential
  • dkms
ShellScript
apt install linux-headers-$(uname -r) build-essential dkms

Right, now onto the more VirtualBox specific stuff, because there are guest additions for every version that is released (hence this is a “Brain-Ache”, because you have to remember every time you upgrade the kernel).

Edit (m-a may be required, I run it anyway, just in case)

Nginx
# m-a obtains any required headers that may be missing for the compilation of everything on your systemm-a prepare

First lets download our version of guest additions, check your version of VirtualBox in the about, you will see the version number you need, in the image you will see it is 7.0.20.

So you will need to replace the x.x.x below with your version.

ShellScript
wget https://download.virtualbox.org/virtualbox/x.x.x/VBoxGuestAdditions_x.x.x.iso

So we now have the correct version of the guest additions image, now we need to install them.

ShellScript
sudo mkdir /media/isosudo mount /path/to/iso/VBoxGuestAdditions_x.x.x.iso /media/iso -o loopsudo /media/iso/VBoxLinuxAdditions.run

Because I happen to keep several kernel versions on my machine I build the guest additions for all of them using the rcvboxadd command.

ShellScript
sudo /sbin/rcvboxadd quicksetup all

But you can replace the all with nothing at all and it will use the current kernel or you can replace it with a specific kernel by supplying the version number, eg. 6.8.11

There you go, simples and remembered for posterity, hopefully someone else will read this and think .. ‘Hey, that’s proper simple, just what I needed’. You’re welcome.

Click here for the Kali Dragon feature image details

The feature Kali Dragon image is a desktop image that can be downloaded from https://wallpapers.com/kali-linux


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.