VirtualBox Failed to recompile after kernel update

Discussions related to using VirtualBox on Linux hosts.
Post Reply
nicko
Posts: 25
Joined: 12. Feb 2013, 09:45

VirtualBox Failed to recompile after kernel update

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox Failed to recompile after kernel update

Post by Perryg »

What did the terminal say when you ran the suggest fix?
nicko
Posts: 25
Joined: 12. Feb 2013, 09:45

Re: VirtualBox Failed to recompile after kernel update

Post 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)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox Failed to recompile after kernel update

Post by Perryg »

So since you did not post that log I guess you must have found the error and fixed it, right?
nicko
Posts: 25
Joined: 12. Feb 2013, 09:45

Re: VirtualBox Failed to recompile after kernel update

Post 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
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox Failed to recompile after kernel update

Post 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?
nicko
Posts: 25
Joined: 12. Feb 2013, 09:45

Re: VirtualBox Failed to recompile after kernel update

Post 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.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox Failed to recompile after kernel update

Post 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.
nicko
Posts: 25
Joined: 12. Feb 2013, 09:45

Re: VirtualBox Failed to recompile after kernel update

Post 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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VirtualBox Failed to recompile after kernel update

Post 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.
nicko
Posts: 25
Joined: 12. Feb 2013, 09:45

Re: VirtualBox Failed to recompile after kernel update

Post by nicko »

ok Thanks so I will install Centos 7

Thanks for your help.
Post Reply