[Solved] vboxdrv.ko): Invalid module format

Discussions related to using VirtualBox on Linux hosts.

[Solved] vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 15:25

I can't get Virtualbox to work on any built kernels from kernel.org.

I get error statement telling me to /etc/init.d/vboxdrv setup
I run it and get error from DKMS stating that an error occurs when running modprobe vboxdrv.

So I run modprobe vboxdrv
and get FATAL: Error inserting vboxdrv (/lib/modules/3.2.7/misc/vboxdrv.ko): Invalid module format

What am I missing?

Wayne Sallee
Wayne@WayneSallee.com
Last edited by Wayne Sallee on 24. Feb 2012, 01:48, edited 1 time in total.
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 16:13

Without some real information all that anyone can do is guess. Do you have the appropriate headers, and other required packages to be able to install and run VirtualBox?
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 16:51

Perryg wrote:Without some real information all that anyone can do is guess. Do you have the appropriate headers, and other required packages to be able to install and run VirtualBox?


I think I do have the headers, but how can I make sure that I do have the headers?

Here's the method I use to build the kernel:
and yes I use root(considered dangerous); no comments needed on that.

Compiling A Linux Kernel

use make -j4 for dual core to speed it up; use a number that's 2 times the numer of cores.

extract kernel tar file
copy extracted kernel to /usr/src

su -
# cd /usr/src
# chown -R root:root linux-2.6.39.99
# cd linux-2.6.39.99
# make mrproper,,,,, while this is running ,,,,,
copy the .config file of the previouse kernel from /boot into /usr/src/linux-2.6.39.99 and rename it to .config or don't bother if you want to start with the new kernel's defaults.

# make menuconfig
This will automaticaly load up the .config file you copied over and will update new options, and allow you to make changes.

# make v=2 2>&1 | tee log.build.log
or # make -j4 v=2 2>&1 | tee log.build.log
This will take about 1.5 hours or so; without the -j4.

# make modules_install 2>&1 | tee log.install_modules.log
or # make -j4 modules_install 2>&1 | tee log.install_modules.log

# make v=2 install 2>&1 | tee log.install.log
This will also add it to /boot/grub/menu.lst , but if you want it to default to boot, edit menulist to set default boot.
Where it says "default " "default 0" boots the first one on the list, and "default 13" boots the 14th one on the list.


Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 17:42

Code: Select all   Expand viewCollapse view
dpkg -l | grep linux-headers

And they match your running kernel.
But this is just the beginning. You need to make sure that you have the additional packages to build external modules like VirtualBox.
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 18:30

.
.
Edit: My distro uses rpms, not deb packages so this code won't work for my distro. That's why the following won't work.

.

Perryg wrote:
Code: Select all   Expand viewCollapse view
dpkg -l | grep linux-headers



Well this is interesting:
Code: Select all   Expand viewCollapse view
dpkg -l | grep linux-headers
dpkg-query: failed to open package info file `/var/lib/dpkg/status' for reading: No such file or directory


I was surprised to see that response, now to figure out why I get that response.

Checking the file system I see that
"/var/lib/dpkg/"
is there, but "status" is not in that directory.

Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 19:12

Looks like the equvilency is
Code: Select all   Expand viewCollapse view
rpm -qa | grep kernel | grep devel


Code: Select all   Expand viewCollapse view
rpm -qa | grep kernel | grep devel
kernel-desktop586-devel-2.6.33.7-2mnb-1-1mnb2
kernel-server-devel-2.6.36.2-2mnb-1-1mnb2
kernel-desktop586-devel-2.6.31.12-3mnb-1-1mnb2
kernel-server-devel-latest-2.6.33.7-2mnb2
kernel-desktop586-devel-2.6.31.13-1mnb-1-1mnb2
kernel-desktop586-devel-2.6.33.7-1mnb-1-1mnb2
kernel-server-devel-2.6.38.7-1mnb2-1-1
kernel-desktop586-devel-2.6.33.5-2mnb-1-1mnb2
kernel-desktop-devel-2.6.33.7-2mnb-1-1mnb2
kernel-desktop-devel-2.6.31.13-1mnb-1-1mnb2
kernel-desktop-devel-2.6.31.12-3mnb-1-1mnb2
kernel-desktop-devel-2.6.38.7-1mnb2-1-1
kernel-server-devel-2.6.33.7-2mnb-1-1mnb2
kernel-desktop-devel-latest-2.6.33.7-2mnb2
kernel-desktop-devel-2.6.33.7-1mnb-1-1mnb2
kernel-server-devel-2.6.33.5-2mnb-1-1mnb2
kernel-desktop-devel-2.6.33.5-2mnb-1-1mnb2
kernel-desktop-devel-2.6.36.2-2mnb-1-1mnb2
kernel-desktop586-devel-latest-2.6.33.7-2mnb2
kernel-linus-devel-3.0.0-3mdv-1-1mdv2010.2


But since I'm referring to a kernel built from kernel.org, and not a packaged kernel this is not the right direction.

Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 19:29

Of course if you are using an rpm base it will be different. Since you did not state that fact before it is up to you to determine which command to run.
Now for what direction you need to take, and since you don't think that you need the proper headers to match you *running* kernel and additional packages to install VirtualBox I don't know what else I can tell you.
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 19:34

Perryg wrote:Of course if you are using an rpm base it will be different. Since you did not state that fact before it is up to you to determine which command to run.


Yes, rpm is different from deb, and I came up with the equivalent, but none of this is of any value anyway, since I'm building the kernel from kernel.org, not using a package.

Perryg wrote:Now for what direction you need to take, and since you don't think that you need the proper headers to match you *running* kernel and additional packages to install VirtualBox I don't know what else I can tell you.


That's ridiculous. I never said any such thing.

Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 19:51

Maybe I did not understand your quote
But since I'm referring to a kernel built from kernel.org, and not a packaged kernel this is not the right direction.

So I am back to my original statement. The headers must match the kernel and the proper packages for your build must be installed in order to install VirtualBox.
I am not talking about how you build the kernel that does not matter to me at all. I am talking about the error you are getting which I assume is from trying to install VirtualBox.
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 19:56

Perryg wrote:Maybe I did not understand your quote
But since I'm referring to a kernel built from kernel.org, and not a packaged kernel this is not the right direction.

So I am back to my original statement. The headers must match the kernel and the proper packages for your build must be installed in order to install VirtualBox.
I am not talking about how you build the kernel that does not matter to me at all. I am talking about the error you are getting which I assume is from trying to install VirtualBox.


Which brings me back to my previous question :-) , "I think I do have the headers, but how can I make sure that I do have the headers?"

Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 20:08

while running and in a terminal run uname -r to see the running kernel and then look at the list you posted.
If you have the headers you will still need the devel package to match the kernel in an rpm based distro plus a few other packages that match your running kernel.


dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel (64-bit)

Or

dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-pae-devel (32-bit)
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 20:30

Code: Select all   Expand viewCollapse view
uname -r
3.2.7


The list I posted are rpms. Rpm devel packages are not available for the kernels I'm building. I'm assuming that the build process of the kernel.org kernels is building headers too, but they won't show up in any rpm list. So how can I tell if the headers are properly built?

dkms I have.
binutils I have.
gcc I have.
make I have.
patch I have.
libgomp I have.
glibc-headers not showing as available, probably in some other package.
glibc-devel I have.
kernel-headers We are already discussing this.
kernel-pae-devel Irrelevant

So how can I check to make sure that I do have the headers?

Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 20:31

see what uname -a tells you then
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: vboxdrv.ko): Invalid module format

Postby Wayne Sallee » 23. Feb 2012, 20:34

Perryg wrote:see what uname -a tells you then

Code: Select all   Expand viewCollapse view
uname -a
Linux waynesalleecom 3.2.7 #1 SMP Tue Feb 21 18:25:21 EST 2012 i686 i686 i386 GNU/Linux


Wayne Sallee
Wayne@WayneSallee.com
Wayne Sallee
 
Posts: 14
Joined: 30. May 2009, 20:50
Location: Florida
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: Win 3.1, Win 8, and many more

Re: vboxdrv.ko): Invalid module format

Postby Perryg » 23. Feb 2012, 20:40

Now looking at your list above, do you see anything that resembles this in the form of a header?
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Next

Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 18 guests