kernel autoconf.h file no longer under include/linux

Discussions related to using VirtualBox on Linux hosts.

kernel autoconf.h file no longer under include/linux

Postby rpjday » 30. Jan 2011, 13:15

Short form: The required kernel header file autoconf.h no longer lives at include/linux/autoconf.h; for quite some time, it's been at include/generated/autoconf.h, but VBox 4.0.2 doesn't seem to realize that.

Long form: I notice a few forum postings that seem to address this to some extent, but I don't see a resolution. Just yesterday, I tried to download and install VBox 4.0.2 on my Ubuntu 10.10 laptop, and it *appears* that VBox is still looking for autoconf.h in the old location, causing its installation to fail trying to use DKMS:

Unpacking virtualbox-4.0 (from virtualbox-4.0_4.0.2-69518~Ubuntu~maverick_amd64.deb) ...
Setting up virtualbox-4.0 (4.0.2-69518~Ubuntu~maverick) ...
addgroup: The group `vboxusers' already exists as a system group. Exiting.
update-rc.d: warning: vboxdrv stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (1)
WARNING: Deprecated config file /etc/modprobe.conf, all config files belong into /etc/modprobe.d/.
* Stopping VirtualBox kernel modules * done.
* Uninstalling old VirtualBox DKMS kernel modules * done.
* Trying to register the VirtualBox kernel modules using DKMS
Error! Bad return status for module build on kernel: 2.6.38-rc2-00274-g1f0324c-dirty (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/vboxhost/4.0.2/build/ for more information.

* Failed, trying without DKMS
... snip ...

the "make.log" file is pretty clear on the problem:

DKMS make.log for vboxhost-4.0.2 for kernel 2.6.38-rc2-00274-g1f0324c-dirty (x86_64)
Sun Jan 30 06:09:27 EST 2011
make: Entering directory `/home/rpjday/k/git'
LD /var/lib/dkms/vboxhost/4.0.2/build/built-in.o
LD /var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/built-in.o
CC [M] /var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/linux/SUPDrv-linux.o
In file included from /var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/include/VBox/types.h:30,
from /var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/linux/../SUPDrvInternal.h:35,
from /var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/linux/SUPDrv-linux.c:31:
/var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/include/iprt/types.h:105: fatal error: linux/autoconf.h: No such file or directory
compilation terminated.
make[2]: *** [/var/lib/dkms/vboxhost/4.0.2/build/vboxdrv/linux/SUPDrv-linux.o] Error 1
make[1]: *** [/var/lib/dkms/vboxhost/4.0.2/build/vboxdrv] Error 2
make: *** [_module_/var/lib/dkms/vboxhost/4.0.2/build] Error 2
make: Leaving directory `/home/rpjday/k/git'

and the relocation of that generated autoconf.h file appears to go back to december of 2009, according to the git commit:

commit 5a865c0606eb44d5d12cabb429751c83712183de
Merge: 331d9d5 46e75f6
Author: Linus Torvalds <>
Date: Thu Dec 17 07:23:42 2009 -0800

Merge branch 'for-33' of git://

* 'for-33' of git:// (29 commits)
net: fix for utsrelease.h moving to generated
gen_init_cpio: fixed fwrite warning
kbuild: fix make clean after mismerge
kbuild: generate modules.builtin
genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}()
score: add asm/asm-offsets.h wrapper
unifdef: update to upstream revision 1.190
kbuild: specify absolute paths for cscope
kbuild: create include/generated in silentoldconfig
scripts/package: deb-pkg: use fakeroot if available
scripts/package: add KBUILD_PKG_ROOTCMD variable
scripts/package: tar-pkg: use tar --owner=root
Kbuild: clean up marker
net: add net_tstamp.h to headers_install
kbuild: move utsrelease.h to include/generated
kbuild: move autoconf.h to include/generated <--- there!
drop explicit include of autoconf.h
kbuild: move compile.h to include/generated
kbuild: drop include/asm
kbuild: do not check for include/asm-$ARCH

So is this a known issue? A possible workaround is to just symlink manually, but that seems to be an ugly hack. Or is this a DKMS issue? This is on an updated Ubuntu 10.10 system.


ADDENDUM: From what I've seen online, the simple fix would seem to be the preprocessor code:

-#include <linux/autoconf.h>
+# include <linux/autoconf.h>
+# include <generated/autoconf.h>

MORE ADDENDUM: As a quick workaround, all I did was add the single appropriate symlink for autoconf.h to my configured kernel source tree and the installation of VBox seemed to work fine.
Posts: 18
Joined: 12. Dec 2010, 12:27
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: linux

Re: kernel autoconf.h file no longer under include/linux

Postby anystupidname » 10. Feb 2011, 23:18

Code: Select all   Expand viewCollapse view
ln -s /usr/src/linux-headers-`uname -r`/include/generated/autoconf.h /usr/src/linux-headers-`uname -r`/include/linux/autoconf.h

Thanks! That did the trick.
Posts: 9
Joined: 23. Nov 2009, 19:34
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: ALL

Re: kernel autoconf.h file no longer under include/linux

Postby pbhj » 9. May 2011, 22:11

Thanks to anystupidname for the tip on linking the autoconf.h file. This however didn't work for me with trying to fix VirtualBox-3.2 on an update from Ubuntu Maverick to Natty (11.04).

Had to remove virtualbox and reinstall, not forgetting the USB extension and things are working again.
Posts: 3
Joined: 9. May 2011, 22:04
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: WinXP, Ubuntu, OpenSUSE

Re: kernel autoconf.h file no longer under include/linux

Postby demkpap » 12. May 2011, 20:43

Anystupidname's suggestion has worked beautifully for me, after Virtual Box got broken on upgrading for Ubuntu 10.10 to 11.04
Posts: 1
Joined: 12. May 2011, 20:37
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: WIN XP

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 15 guests