Ubuntu – Installing guest additions Ubuntu 16.04 | Kernel configuration is invalid


I am running Ubuntu 16.04 as a guest system in Windows 8.1 (VirtualBox) and I'm trying to install the guest additions in order to activate 3D acceleration. However, I get the following error messages:


grep: /lib/modules/4.4.0-104-generic/build/include/linux/version.h: No such file or directory
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/4.4.0-104-generic/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
echo >&2;                           \
echo >&2 "  ERROR: Kernel configuration is invalid.";       \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
echo >&2 ;                          \
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0

sudo sh ./VBoxLinuxAdditions.run:

Verifying archive integrity... All good.
Uncompressing VirtualBox 5.1.28 Guest Additions for Linux...........
VirtualBox Guest Additions installer
Removing installed version 5.1.28 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
vboxadd.sh: Starting the VirtualBox Guest Additions.

You may need to restart the Window System (or just restart the guest system)
to enable the Guest Additions.

Steps I've taken:

  • Install latest Virtualbox drivers 5.2.4

  • install linux-headers-generic

How can I know if my Kernel version is supported or not? What steps could I take from here?

➜  ~ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:    16.04
Codename:   xenial
➜  ~ uname -r      

Best Answer

Found the solution here, as @N0rbert stated, I installed build-essential and then I prepared my system to build a kernel module using the following commands:

sudo apt update && sudo apt dist-upgrade 
sudo apt install build-essential module-assistant dkms
sudo m-a prepare

I don't think dist-upgrade is necessary, maybe upgrade is enough, but use it as you see fit.

/usr/lib/nux/unity_support_test -p :

Not software rendered:    yes
Not blacklisted:          yes
GLX fbconfig:             yes
GLX texture from pixmap:  yes
GL npot or rect textures: yes
GL vertex program:        yes
GL fragment program:      yes
GL vertex buffer object:  yes
GL framebuffer object:    yes
GL version is 1.4+:       yes

Unity 3D supported:       yes