Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tend to run newer kernels than most people, partially for fun, partially for bug testing, partially for masochistic fulfilment. A couple of days ago I installed 2.6.38-rc1 and VirtualBox's DKMS module would no longer compile.

I'm not new to VirtualBox throwing spanners in my kernel experiments but is there any way to make it compile?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

The new Kernel has moved linux/autoconf.h to generated/autoconf.h (hint). I don't really know the technical reasoning for this but anything that includes this in the VirtualBox host module source, needs editing.

Thankfully fixing it is just a case of swapping out the strings:

sudo find /usr/share/virtualbox/src/vboxhost -name '*.h' -exec perl -pi -w -e 's/linux\/autoconf/generated\/autoconf/g;' {} \;
sudo /etc/init.d/vboxdrv setup

Of course this change might not be permanent in the Linux Kernel. Things could go back and that would squiffy your ability to compile in the future so if you need to do the opposite in the future, here it is:

sudo find /usr/share/virtualbox/src/vboxhost -name '*.h' -exec perl -pi -w -e 's/generated\/autoconf/linux\/autoconf/g;' {} \;
sudo /etc/init.d/vboxdrv setup
share|improve this answer
    
Use '*.h' instead of *.h to prevent the shell from expanding *.h. Furthermore, there is a sed command which can be used to do replacements, the -i option should be used to do inline replacements. If you use a character other than the / after s, you do not need to escape any occurences of /. The first command becomes sudo find /usr/share/virtualbox/src/vbox -name '*.h' -exec sed 's,linux/autoconf,generated/autoconf,g' -i {} \;. The second command can be altered in the same way. –  Lekensteyn Jul 20 '11 at 19:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.