You are not logged in.

#1 2012-07-27 10:35:09

Thar
Member
Registered: 2007-08-28
Posts: 20

Virtualbox modules compilation from virtualbox-source no longer works

Since virtualbox-source dropped /usr/bin/vboxbuild and started depending on dkms, I can no longer compile VirtualBox modules for my kernel.

I use:

thar@myhost ~> uname -a
Linux myhost 3.4.6-1-ck #1 SMP PREEMPT Sun Jul 22 09:37:50 EDT 2012 x86_64 GNU/Linux

virtualbox, virtualbox-source and dkms in newest versions. Module compilation and instalation with dkms is seemingly fine:

thar@myhost ~> sudo dkms install vboxhost/4.1.18

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.4.6-1-ck -C /usr/lib/modules/3.4.6-1-ck/build M=/var/lib/dkms/vboxhost/4.1.18/build..............
cleaning build area....

DKMS: build completed.

vboxdrv.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/3.4.6-1-ck/kernel/misc/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/3.4.6-1-ck/kernel/misc/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/3.4.6-1-ck/kernel/misc/

vboxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /usr/lib/modules/3.4.6-1-ck/kernel/misc/

depmod......

DKMS: install completed.

But then:

thar@myhost ~> sudo modprobe vboxdrv
ERROR: could not insert 'vboxdrv': Exec format error

I have seen similar topic on Chakra support forums. The advice was not to use dkms. Because in Arch virtualbox-source package has a dependency on it, it is not applicable (and anyways, virtualbox-source doesn't have vboxbuild anymore).

Offline

#2 2012-07-27 11:24:28

Thar
Member
Registered: 2007-08-28
Posts: 20

Re: Virtualbox modules compilation from virtualbox-source no longer works

Some more info.

thar@myhost ~> sudo modprobe vboxdrv
ERROR: could not insert 'vboxdrv': Exec format error
thar@myhost ~> dmesg | tail | grep vboxdrv
[ 6128.915876] vboxdrv: disagrees about version of symbol module_layout

Google search says that this means module has been compiled for wrong version of kernel. But as shown in a post above, KERNELRELEASE variable and kernel directories match those of my kernel version.

Offline

#3 2012-07-27 13:13:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,703
Website

Re: Virtualbox modules compilation from virtualbox-source no longer works


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2012-07-27 13:28:07

Thar
Member
Registered: 2007-08-28
Posts: 20

Re: Virtualbox modules compilation from virtualbox-source no longer works

So, if I understand correctly how this is relevant, dkms correctly finds kernel and assorted dirs but uses incorrect (stock) headers?

This kind of question why dkms has been added to virtualbox-source, since the very reason for this package was for custom kernel users to compile necessary modules with ease.

Last edited by Thar (2012-07-27 13:29:17)

Offline

#5 2012-07-27 22:08:07

leodag
Member
Registered: 2012-05-21
Posts: 9

Re: Virtualbox modules compilation from virtualbox-source no longer works

I was able to workaround this by doing:

# dkms install vboxhost/4.1.18 -k <your kernel here>/<your arch here>

Your kernel name must be the name of your kernel's modules directory in /usr/lib/modules/

An example:
My kernel is linux-pf 3.4.6-1, an its modules are in /usr/lib/modules/3.4-pf/, so my kernel name is 3.4-pf. I use Arch x86_64. So I have to run this:

# dkms install vboxhost/4.1.18 -k 3.4-pf/x86_64

Offline

#6 2012-07-27 23:22:04

Torcado
Member
Registered: 2012-07-27
Posts: 2

Re: Virtualbox modules compilation from virtualbox-source no longer works

leodag wrote:

I was able to workaround this by doing:

# dkms install vboxhost/4.1.18 -k <your kernel here>/<your arch here>

Your kernel name must be the name of your kernel's modules directory in /usr/lib/modules/

An example:
My kernel is linux-pf 3.4.6-1, an its modules are in /usr/lib/modules/3.4-pf/, so my kernel name is 3.4-pf. I use Arch x86_64. So I have to run this:

# dkms install vboxhost/4.1.18 -k 3.4-pf/x86_64

Did that but I am still experiencing the same issue as before. I have also added --kernelsourcedir and pointed it to the source directory of my kernel … still no luck.

Offline

#7 2012-07-27 23:25:13

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Virtualbox modules compilation from virtualbox-source no longer works

Thar wrote:

But then:

thar@myhost ~> sudo modprobe vboxdrv
ERROR: could not insert 'vboxdrv': Exec format error

I have seen similar topic on Chakra support forums. The advice was not to use dkms. Because in Arch virtualbox-source package has a dependency on it, it is not applicable (and anyways, virtualbox-source doesn't have vboxbuild anymore).

My advice is to look at what module you're trying to actually modprobe. Chances are its the old one which vboxbuild built/install (and left behind). Directly calling insmod on the module that dkms built will work. You need to find the module that modprobe is loading (use --verbose), delete that, and re-run depmod for the kernel.

This has nothing to do with FS#30584.

Offline

#8 2012-07-27 23:34:40

Torcado
Member
Registered: 2012-07-27
Posts: 2

Re: Virtualbox modules compilation from virtualbox-source no longer works

falconindy wrote:
Thar wrote:

But then:

thar@myhost ~> sudo modprobe vboxdrv
ERROR: could not insert 'vboxdrv': Exec format error

I have seen similar topic on Chakra support forums. The advice was not to use dkms. Because in Arch virtualbox-source package has a dependency on it, it is not applicable (and anyways, virtualbox-source doesn't have vboxbuild anymore).

My advice is to look at what module you're trying to actually modprobe. Chances are its the old one which vboxbuild built/install (and left behind). Directly calling insmod on the module that dkms built will work. You need to find the module that modprobe is loading (use --verbose), delete that, and re-run depmod for the kernel.

This has nothing to do with FS#30584.

You are so right! Thanks a lot for your support!

Offline

#9 2012-07-28 06:48:32

Thar
Member
Registered: 2007-08-28
Posts: 20

Re: Virtualbox modules compilation from virtualbox-source no longer works

Indeed, removing modules from /usr/lib/modules/extramodules-3.4-ck/ and running depmod worked. Thanks, falconindy smile This thread can be marked solved now.

Offline

#10 2012-07-29 16:48:29

indianahorst
Member
Registered: 2008-08-23
Posts: 130

Re: Virtualbox modules compilation from virtualbox-source no longer works

None of the previous mentioned methods worked for me:

I'm still using the stock kernel  3.3.4 because of the high load problems since 3.3.5.

$ uname -a
Linux zeus 3.3.4-2-ARCH #1 SMP PREEMPT Wed May 2 18:28:42 CEST 2012 x86_64 GNU/Linux

linux-headers are installed:

$ yaourt -Qs linux-headers
core/linux-headers 3.3.4-2
    Header files and scripts for building modules for linux kernel

vboxbuild doesn't work...

$ sudo /usr/lib/vboxbuild
sudo: /usr/lib/vboxbuild: command not found

dkms also...

$ sudo rc.d start dkms
:: Starting Dynamic Kernel Module System                                [BUSY] 
Error! echo
Your kernel headers for kernel 3.3.4-2-ARCH cannot be found at
/usr/lib/modules/3.3.4-2-ARCH/build or /usr/lib/modules/3.3.4-2-ARCH/source.              [DONE]
$ sudo dkms install vboxhost/4.1.18 -k 3.3.4-2-ARCH/x86_64
Error! echo
Your kernel headers for kernel 3.3.4-2-ARCH cannot be found at
/usr/lib/modules/3.3.4-2-ARCH/build or /usr/lib/modules/3.3.4-2-ARCH/source.

BUT:
/usr/lib/modules/3.3.4-2-ARCH/build exists and contains a symlink to the correct headers under /usr/src/linux-3.3.4-2-ARCH:

ls -l /lib/modules/3.3.4-2-ARCH/build
lrwxrwxrwx 1 root root 35 Mai  2 18:39 /lib/modules/3.3.4-2-ARCH/build -> ../../../usr/src/linux-3.3.4-2-ARCH

What can I still do to get virtualbox working?

Thanks!

Offline

Board footer

Powered by FluxBB