Linux – VirtualBox Ubuntu Guest Additions not installing : modprobe vboxsf failed

linux-kernelUbuntuvirtualbox

I just installed this software off virtual box, i downloaded the ISO off the official ubuntu website, was the lastest LTS.

I attempted to install Guest Additions using the 'Insert Guest Additions CD Image".
Result:

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.0 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.2.0 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions 
kernel modules.
VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find 
out what went wrong
VirtualBox Guest Additions: Running kernel modules will not be replaced 
until the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: modprobe vboxsf failed
Press Return to close this window...

Inside the /var/log/vboxadd-setup.log:

ERROR:

Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.

Full version of log file can be found here [?]

Best Answer

Ok, so this is a known problem. Instead of using the image provided by virtualbox you should just download it trough aptitute sudo apt-get install virtualbox-guest-dkms and if you need the headers download this sudo apt-get install linux-headers-virtual instead of the classic sudo apt-get install linux-headers-$(uname -r).

Cheers

Edit: Changed the {} for () as pointed by @Abdelouahab.

Related Question