I was trying to install the VirtualBox Guest Additions in a Kali Linux virtual machine by following the steps here.
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?)