2011-11-19 // VirtualBox 4.1.6 on Fedora 15 with Kernel 2.6.41.1: module compilation error
Some userspace programs got problems with the 2.6.x→3.x kernel numbering transition. To prevent the need to fix everything at once, the Fedora developers decided to ship 3.x kernels as 2.6.4x on Fedora 15 Lovelock and use the correct numbering scheme on Fedora releases ≥16 Verne.
This kernel version numbering hack makes some problems with the current VirtualBox 4.1.6 on Fedora 15: /etc/init.d/vboxdrv setup
exits with an error (/var/log/vbox-install.log
says that recompiling VBoxPci-linux.o
failed). The reason is simple: A check thinks that the running kernel 2.6.41.1 is older than 3.1. Therefore the wrong header file gets included (asm/amd_iommu.h
instead of linux/amd-iommu.h
).
Quick fix to get your VirtualBox working again:
- Open the belonging source code file as root:
$ su - $ gedit /var/lib/dkms/vboxhost/4.1.6/source/vboxpci/linux/VBoxPci-linux.c
- Search for
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) # include <asm/amd_iommu.h> #else
(~line 37) and replace it with
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) # include <linux/amd-iommu.h> #else
- Recompile the needed modules:
$ su -c '/etc/init.d/vboxdrv setup'
Comments

I think a much better fix would be to change “KERNEL_VERSION(3, 1, 0)” to “KERNEL_VERSION(2, 6, 41)”
@dutchhome: Come on, it does not matter. This it is just a local(!) hack to get things working again on the specific system you are running. It does not get redistributed. BTW: KERNEL_VERSION(2, 6, 41)
is not a “much better” or general solution, too. E.g. it would break things on a 3.0 kernel machine.
@Andreas Haerter: Hi Andreas,
Thanks for the blog and However I agree with @dutchhome that it may be a better workaround to use (2,6,41)…
Although it's a local hack and bug only happens on Fedora/SuSE related versions.
It's still a common scenario when one using 2.6.41kernel downgrades to 2.6.40, which was still using “asm/amd-iommu.h”. so the using of 2.6.41 is better understood here.
Regards, -s
Leave a comment…
- E-Mail address will not be published.
- Formatting:
//italic// __underlined__
**bold**''preformatted''
- Links:
[[http://example.com]]
[[http://example.com|Link Text]] - Quotation:
> This is a quote. Don't forget the space in front of the text: "> "
- Code:
<code>This is unspecific source code</code>
<code [lang]>This is specifc [lang] code</code>
<code php><?php echo 'example'; ?></code>
Available: html, css, javascript, bash, cpp, … - Lists:
Indent your text by two spaces and use a * for
each unordered list item or a - for ordered ones.
Perfect. Thanks for the tip! READERS: note the change to a dash from an underscore also (amd-iommu.h)