Page 1 of 1

VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 20:33
by nicko
Hello,

Have have centos 6 server and virtualBox won't start after a Kernel update.

Centos 6.8
VirtualBox 4.3
kernel 2.6.32-642.1.1.el6.x86_64

Code: Select all

make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG=
 -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (
\
        echo;                                                           \
        echo "  ERROR: Kernel configuration is invalid.";               \
        echo "         include/linux/autoconf.h or include/config/auto.conf are
missing.";      \
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix
 it.";  \
        echo;                                                           \
        /bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0

Code: Select all

WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (2.6.32-642.1.1.el6.x86_64) or it fail
ed to
         load. Please recompile the kernel module and install it by

           sudo /etc/init.d/vboxdrv setup

         You will not be able to start VMs until this problem is fixed.
Usage:

VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|
                            intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|
                            hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|
                            usbhost|usbfilters|systemproperties|extpacks|
                            groups|webcams
Thank you.

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 20:44
by Perryg
What did the terminal say when you ran the suggest fix?

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 20:53
by nicko
[root]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel modules [ OK ]
Removing old VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 21:54
by Perryg
So since you did not post that log I guess you must have found the error and fixed it, right?

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 21:58
by nicko
no I did not fix the error and I did not find the log file. The only log file I have its /var/log/vbox-install.log

Code: Select all


make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG=
 -C /lib/modules/2.6.32-504.1.3.el6.x86_64/build modules
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (
\
        echo;                                                           \
        echo "  ERROR: Kernel configuration is invalid.";               \
        echo "         include/linux/autoconf.h or include/config/auto.conf are
missing.";      \
        echo "         Run 'make oldconfig && make prepare' on kernel src to fix
 it.";  \
        echo;                                                           \
        /bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 22:48
by Perryg
I am guessing that the reason you can not build the kernel module is due to not having matching kernel headers for the new kernel. Have you updated them?

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 22:56
by nicko
yes i did:
yum install kernel-headers-2.6.32-642.1.1.el6.x86_64

Code: Select all

Package kernel-headers-2.6.32-642.1.1.el6.x86_64 already installed and latest version
I am able to recompile virtualBox to the old kernel "2.6.32-573.18.1.el6.x86_64" but not to the new one.

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 23:08
by Perryg
And kernel-devel?

All of this usually happens when you do not use dkms to keep the supporting packages up to date when installing a new kernel. In the end this is a host OS issue I am afraid.

I might suggest that you use the wild card command when installing the headers and devel package. -$(uname -r) instead of typing the version yourself.

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 23:16
by nicko
And kernel-devel?
Yes its up to date.

so i do have to install centos 7 if is the OS issue? or should I update to virtualbox 5?

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 23:33
by Perryg
You need to fix your host operating system because something is not happy with the new kernel. Updating VirtualBox will only cause you more problems since the new versions depend on newer packages.

Re: VirtualBox Failed to recompile after kernel update

Posted: 11. Jul 2016, 23:39
by nicko
ok Thanks so I will install Centos 7

Thanks for your help.