I was trying to install the VirtualBox Guest Additions in a Kali Linux virtual machine by following the steps here.

I ran: sudo apt-get update, sudo apt-get upgrade, sudo reboot (until truly all packages were upgraded) sudo apt-get install build-essential sudo apt-get install module-assistant, sudo m-a prepare

But when I ran sudo sh VBoxLinuxAdditions.run I got:

Installing additional modules ...
vboxadd.sh: Starting the VirtualBox Guest Additions.
Failed to set up service vboxadd, please check the log file

In the log file it says:

vboxadd.sh: failed: Look at /var/log/vboxadd-install.log to find out what went wrong.
vboxadd.sh: failed: modprove vboxgues failed.

Most likely this was due to not having the kernel headers installed.

Hence I ran sudo apt-get install linux-headers-$(uname-r) but then I get:

E: Unable to locate package linux-headers-4.9.0-kali3-amd64

apt-cache search linux-headers only shows:

linux-headers-4.12.0-kali1-all - [...]

My question is: why am I having this problem and how can it be solved?
(Could it be a problem with my host system, is it maybe a problem of having executed something in a wrong order, should I maybe reinsert Guest Additions iso somehow?)


1 Answer 1


The solution was simple. It worked with sudo apt-get install linux-headers-4.12.0-kali2-all. Use uname -r to find out which package you need. Also note that you may need to change permissions of VBoxLinuxAdditions: chmod 777 VBoxLinuxAdditions.run.

  • Glad to see you solved it. I have never had to change permissions to LinuxAdditions, for me cp VBoxLinuxAdditions.run /tmp then /tmp$VBoxLinuxAdditions.run just does it all the time.
    – Helio
    Mar 15, 2018 at 18:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .