Page 1 of 1

Compiling Virtualbox modules during the deb install fails

Posted: 16. Jul 2016, 20:01
by Enxer
I'm trying to complete the install of Virtualbox 5.1 on my ReadyNas (6.5.1) running deb wheezy

Code: Select all

root@NAS:/data/Virtualbox# cat /etc/*-release
PRETTY_NAME="ReadyNASOS 6.5.1"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
The install completes and since it doesn't have compiled modules for my kernel:

Code: Select all

root@NAS:/data/Virtualbox# uname -r
4.1.21.x86_64.1
I pulled down the source from Netgear and ran:

Code: Select all

make oldconfig && make prepare && make headers
I verified that the config shows the same version as above: 4.1.21.x86_64.1. I also linked some folders to the kernel source:

Code: Select all

lrwxrwxrwx 1 root root  40 Jul 14 22:00 linux -> /data/Virtualbox/linux-4.1.21-197-x86_64
lrwxrwxrwx 1 root root  40 Jul 15 08:57 linux-4.1.21-197-x86_64 -> /data/Virtualbox/linux-4.1.21-197-x86_64
lrwxrwxrwx 1 root root  23 Jun 23  2012 linux-kbuild-3.2 -> ../lib/linux-kbuild-3.2
Even after running /sbin/vboxconfig again it fails with attaching the built modules. dmesg:

Code: Select all

[144731.951525] vboxdrv: disagrees about version of symbol module_layout
[147500.819987] vboxdrv: disagrees about version of symbol module_layout
[147585.659829] vboxdrv: disagrees about version of symbol module_layout
Reviewing the vbox-install.log shows it's pulling the headers from the correct location:

Code: Select all

  gcc -Wp,-MD,/tmp/vbox.0/linux/.SUPDrv-linux.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.9/include -I./arch/x86/include -Iarch/x86/include/generated/uapi -Iarch/x86/include/generated  -Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -m64 -mno-80387 -mno-fp-ret-in-387 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -femit-struct-debug-baseonly -fno-var-tracking -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -I/lib/modules/4.1.21.x86_64.1/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxdrv/ -I/tmp/vbox.0/vboxdrv/include -I/tmp/vbox.0/vboxdrv/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DSUPDRV_WITH_RELEASE_LOGGER -Wno-declaration-after-statement -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -fno-omit-frame-pointer -fno-pie  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(SUPDrv_linux)"  -D"KBUILD_MODNAME=KBUILD_STR(vboxdrv)" -c -o /tmp/vbox.0/linux/.tmp_SUPDrv-linux.o /tmp/vbox.0/linux/SUPDrv-linux.c
I feel like there is something obvious I am missing that is making this fail.

Re: Compiling Virtualbox modules during the deb install fails

Posted: 16. Jul 2016, 20:51
by Perryg
Post the entire /var/log/vbox-install.log.

Re: Compiling Virtualbox modules during the deb install fails

Posted: 16. Jul 2016, 22:22
by Enxer
Sure. Please see zipped attached. I just reran:/sbin/vboxconfig

Code: Select all

/sbin/modprobe: invalid option -- 'c'
BusyBox v1.22.1 (Debian 1:1.22.0-4) multi-call binary.

Usage: modprobe [-alrqvsDb] MODULE [symbol=value]...

        -a      Load multiple MODULEs
        -l      List (MODULE is a pattern)
        -r      Remove MODULE (stacks) or do autoclean
        -q      Quiet
        -v      Verbose
        -s      Log to syslog
        -D      Show dependencies
        -b      Apply blacklist to module names too

vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
and I just recalled I forgot to mention modprobe doesn't support dumping a config (-c).

Re: Compiling Virtualbox modules during the deb install fails

Posted: 16. Jul 2016, 22:37
by Perryg
Search for your problem using the following "vboxdrv: disagrees about version of symbol module_layout"

All indications are you have an issue with your headers ( location or wrong ) Or if this is not the first install of VirtualBox maybe an older version that needs to be purged.