Errors compiling vboxdrv on Centos 7

Discussions related to using VirtualBox on Linux hosts.
Post Reply
fredex1
Posts: 23
Joined: 7. Dec 2015, 04:16
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: linux, freedos

Errors compiling vboxdrv on Centos 7

Post by fredex1 »

Attempting to install vbox 5.0.5.0.8 on Centos 7 (I originally tried 5.0.5.0.10, but that failed in the same way so I thought I'd try one version older to see if it avoided the problem... no such luck). Here is yum output from failed install, as well as excerpts from two build logs that both show errors.

yum output from attempted installation:

yum install VirtualBox-5.0-5.0.8_103449_el7-1.x86_64.rpm
Loaded plugins: fastestmirror, langpacks, nvidia
Examining VirtualBox-5.0-5.0.8_103449_el7-1.x86_64.rpm: VirtualBox-5.0-5.0.8_103449_el7-1.x86_64
Marking VirtualBox-5.0-5.0.8_103449_el7-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package VirtualBox-5.0.x86_64 0:5.0.8_103449_el7-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================
Package Arch Version Repository Size
=====================================================================================================
Installing:
VirtualBox-5.0 x86_64 5.0.8_103449_el7-1 /VirtualBox-5.0-5.0.8_103449_el7-1.x86_64 149 M

Transaction Summary
=====================================================================================================
Install 1 Package

Total size: 149 M
Installed size: 149 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : VirtualBox-5.0-5.0.8_103449_el7-1.x86_64 1/1

Creating group 'vboxusers'. VM users must be member of that group!

No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Stopping VirtualBox kernel modules [ OK ]
Uninstalling old VirtualBox DKMS kernel modules [ OK ]
Trying to register the VirtualBox kernel modules using DKMSError! Bad return status for module build on kernel: 3.10.0-327.el7.x86_64 (x86_64)
Consult /var/lib/dkms/vboxhost/5.0.8/build/make.log for more information.
[FAILED]
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules [FAILED]
(Look at /var/log/vbox-install.log to find out what went wrong)
Verifying : VirtualBox-5.0-5.0.8_103449_el7-1.x86_64 1/1

Installed:
VirtualBox-5.0.x86_64 0:5.0.8_103449_el7-1

Complete!

-------------------------------------------------------------------------------------
excerpt from /var/lib/dkms/vboxhost/5.0.8/build/make.log:

CC [M] /var/lib/dkms/vboxhost/5.0.8/build/vboxnetadp/linux/VBoxNetAdp-linux.o
/var/lib/dkms/vboxhost/5.0.8/build/vboxnetadp/linux/VBoxNetAdp-linux.c: In function ‘vboxNetAdpEthGetDrvinfo’:
/var/lib/dkms/vboxhost/5.0.8/build/vboxnetadp/linux/VBoxNetAdp-linux.c:171:21: warning: unused variable ‘pPriv’ [-Wunused-variable]
PVBOXNETADPPRIV pPriv = netdev_priv(pNetDev);
^
CC [M] /var/lib/dkms/vboxhost/5.0.8/build/vboxnetadp/VBoxNetAdp.o
LD [M] /var/lib/dkms/vboxhost/5.0.8/build/vboxnetadp/vboxnetadp.o
LD /var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt/built-in.o
CC [M] /var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt/linux/VBoxNetFlt-linux.o
/var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltLinuxPacketHandler’:
/var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt/linux/VBoxNetFlt-linux.c:934:9: error: implicit declaration of function ‘vlan_tx_tag_present’ [-Werror=implicit-function-declaration]
if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN)
^
/var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt/linux/VBoxNetFlt-linux.c:944:13: error: implicit declaration of function ‘vlan_tx_tag_get’ [-Werror=implicit-function-declaration]
pVHdr->h_vlan_TCI = RT_H2N_U16(vlan_tx_tag_get(pBuf));
^
cc1: some warnings being treated as errors
make[2]: *** [/var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt/linux/VBoxNetFlt-linux.o] Error 1
make[1]: *** [/var/lib/dkms/vboxhost/5.0.8/build/vboxnetflt] Error 2
make: *** [_module_/var/lib/dkms/vboxhost/5.0.8/build] Error 2
make: Leaving directory `/usr/src/kernels/3.10.0-327.el7.x86_64'






---------------------------------
and an excerpt from the end of /var/log/vbox-install.log

ld -r -m elf_x86_64 -T /usr/src/kernels/3.10.0-327.el7.x86_64/scripts/module-common.lds --build-id -o /tmp/vbox.0/vboxdrv.ko /tmp/vbox.0/vboxdrv.o /tmp/vbox.0/vboxdrv.mod.o
make KBUILD_VERBOSE=1 SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 CONFIG_MODULE_SIG= -C /lib/modules/3.10.0-327.el7.x86_64/build modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0
gcc -Wp,-MD,/tmp/vbox.0/linux/.VBoxNetFlt-linux.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include -I/usr/src/kernels/3.10.0-327.el7.x86_64/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/usr/src/kernels/3.10.0-327.el7.x86_64/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/kernels/3.10.0-327.el7.x86_64/include/uapi -Iinclude/generated/uapi -include /usr/src/kernels/3.10.0-327.el7.x86_64/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-sse -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -Wframe-larger-than=2048 -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=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 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -pg -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -I/lib/modules/3.10.0-327.el7.x86_64/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxnetflt/ -I/tmp/vbox.0/vboxnetflt/include -I/tmp/vbox.0/vboxnetflt/r0drv/linux -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -Wno-declaration-after-statement -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(VBoxNetFlt_linux)" -D"KBUILD_MODNAME=KBUILD_STR(vboxnetflt)" -c -o /tmp/vbox.0/linux/.tmp_VBoxNetFlt-linux.o /tmp/vbox.0/linux/VBoxNetFlt-linux.c
/tmp/vbox.0/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltLinuxPacketHandler’:
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:934:9: error: implicit declaration of function ‘vlan_tx_tag_present’ [-Werror=implicit-function-declaration]
if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN)
^
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:944:13: error: implicit declaration of function ‘vlan_tx_tag_get’ [-Werror=implicit-function-declaration]
pVHdr->h_vlan_TCI = RT_H2N_U16(vlan_tx_tag_get(pBuf));
^
cc1: some warnings being treated as errors
make[2]: *** [/tmp/vbox.0/linux/VBoxNetFlt-linux.o] Error 1
make[1]: *** [_module_/tmp/vbox.0] Error 2
make: *** [vboxnetflt] Error 2
fredex1
Posts: 23
Joined: 7. Dec 2015, 04:16
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: linux, freedos

Re: Errors compiling vboxdrv on Centos 7

Post by fredex1 »

Replying to my own posting:

This bug can be found in the vbox bug tracker as item #14866.

According to that item, it has been fixed and will appear in the next release.

I tried the generic Linux test build (there is no test build for EL7 listed on that page: https://www.virtualbox.org/wiki/Testbuilds) and it installed without problems, but wouldn't run. after a wait of a half minute, maybe more, an error box popped up. unfortunately I no longer have that build installed, and I neglected to write down the message. :?

if I read the bug report correctly, this problem was introduced with the 7.2 kernel. if that is a correct reading, then it may be possible to install BEFORE running the 7.2 updates, after which it might still work. (guessing).
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Errors compiling vboxdrv on Centos 7

Post by frank »

This will be fixed in the next 5.0.x maintenance release. I've created a test build for you which you can find here.
fredex1
Posts: 23
Joined: 7. Dec 2015, 04:16
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: linux, freedos

Re: Errors compiling vboxdrv on Centos 7

Post by fredex1 »

Thanks, Frank, for the test build. I'll post back here with results once I've tried it.
fredex1
Posts: 23
Joined: 7. Dec 2015, 04:16
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: linux, freedos

Re: Errors compiling vboxdrv on Centos 7

Post by fredex1 »

Frank:

it installs without the errors I was seeing with the .10 or .08 release though there are quite a few compiler warnings.

however it fails after startup (but before any vbox windows appear) with an error box that says:

Code: Select all

Failed to create the VirtualBoxClient COM object.

The application will now terminate.

Callee RC: NS_BASE_STREAM_WOULD_BLOCK (0x80470007)
this is the same error to which I refer above in an earlier posting that I got when attempting to test the generic Linux/64 build from the "testbuilds" page.

Please note that I've just updated this system from Centos-6 to Centos-7, so that this is my first time trying to install VirtualBox on Centos-7. I suppose it's possible that this error is due to something missing in my new installation, but I don't know how to debug that.
frank
Oracle Corporation
Posts: 3362
Joined: 7. Jun 2007, 09:11
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Linux, Windows
Location: Dresden, Germany
Contact:

Re: Errors compiling vboxdrv on Centos 7

Post by frank »

This error message normally hints to a VBoxSVC crash. Could you check with 'dmesg' if VBoxSVC crashed? There should be a message about some SEGFAULT. If so, can you provide a core dump?
RockT
Posts: 18
Joined: 15. Aug 2012, 08:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: RHEL, Win7

Re: Errors compiling vboxdrv on Centos 7

Post by RockT »

I cannot confirm the problem with the testbuild. It works here:

OL7 fully patched with kernel 3.10.0-327.3.1.el7.x86_64
VirtualBox-5.0-5.0.11_104626_el7-1.x86_64.rpm
Oracle_VM_VirtualBox_Extension_Pack-5.0.11-104602.vbox-extpack

I can start a Win7-64 VM without problems.

@Frank:

Do you plan to release in the future EL7/C7/OL7 testbuilds regularly too?

VG Rainer
fredex1
Posts: 23
Joined: 7. Dec 2015, 04:16
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: linux, freedos

Re: Errors compiling vboxdrv on Centos 7 [SOLVED]

Post by fredex1 »

@Frank
SOLVED! solution is at the end, since I had already written all the other stuff before finding it.
--------------------------

I did "dmesg | less" then hit "F" to make it tail the end of the file. attempted to start up VB, saw no action in the dmesg output. cannot find a core file. I made sure ulimit -c was set to "unlimited" and tried again. Still no dice.

I found a bunch of old VBoxSVC.log.x files, mostly from November (which must have been brought over from my Centos-6 installation) but nothing dated today, or even yesterday.

I don't see anything in dmesg from an earlier time that points to a VBoxSVC event either.

here is ls output for VBoxSVC, so you can tell me if it looks correct (a checksum, too):
  • -rwxr-xr-x. 1 root root 5163288 Dec 9 10:20 /usr/lib/virtualbox/VBoxSVC
    -rwxr-xr-x. 1 root root 15640 Dec 9 10:20 /usr/lib/virtualbox/components/VBoxSVCM.so

    sha256sum /usr/lib/virtualbox/VBoxSVC /usr/lib/virtualbox/components/VBoxSVCM.so
    5d7c0a0342ad42228a64f5a867eb61a98971ba839611d0ee246acbac79f4df8a /usr/lib/virtualbox/VBoxSVC
    f720aca52c54e8c60fe741e48874bb75b9ac75c5ed23648d926b74cf30c979ea /usr/lib/virtualbox/components/VBoxSVCM.so
Ah, possibly EUREKA! The VBoxSVC log files I mentioned above all had the wrong owner/group (500, legacy value left over from Centos-6). I changed 'em "chown -R fredex:fredex /home/fredex/.virtualbox" then went on about looking for other issues. then a few mins later when I started VirtualBox it came up! (well, there were a couple of things I had to fix, like the network card name).

So, it turns out to be a "stupid user error", or an ID ten T error. I've got one of the VMs now started up, so I can only hope that's the last of the weird problems.

Thanks, Frank, for the handholding and advice, as well as the test build!
Niko_K
Posts: 5
Joined: 23. Apr 2013, 20:29

Re: Errors compiling vboxdrv on Centos 7

Post by Niko_K »

I've got the same problem with the just released CentOS 7.2 (with 7.1 everything worked well).
Will VrtualBox-5.0.12 be released soon? I guess that this would fix the problem (after what I've read here).
Is there a change to install a testbuild using yum (maybe by using yum localinstall??)

Cheers,
Niko
fredex1
Posts: 23
Joined: 7. Dec 2015, 04:16
Primary OS: Linux other
VBox Version: OSE other
Guest OSses: linux, freedos

Re: Errors compiling vboxdrv on Centos 7

Post by fredex1 »

Niko:

When I was having the problem I had been installing the updates from the CR repo, and those updates were destined to be part of 7.2. However, at the time I didn't realize that was the cause of the problem.

have you tried one of the test builds from: https://www.virtualbox.org/wiki/Testbuilds

there isn't one there for EL7, (lets hope they eventually start putting one there), but there is a generic linux build that may help get you out of the woods while we're waiting for an official build. (I note that the revision numbers given are several steps higher than what they were when I was having the problem, so one can hope the necessary fix is included there.)

good luck!

Fred
bluegroper
Posts: 50
Joined: 22. Dec 2008, 08:14
Primary OS: FreeBSD
VBox Version: OSE other
Guest OSses: Windozes, Linuxes, BSD's
Location: Would rather be swimming.

Re: Errors compiling vboxdrv on Centos 7

Post by bluegroper »

I may have discovered a work-around. Don't recompile vboxdrv.
Use # grubby --set-default-index=[n] where [n] is the index number of the old kernel. Reboot.
Virtualbox now working again as desired, with previous kernel. Sure this is a temporary kludge, but gets me out of immediate trouble.
Be sure to check your correct [n] index number with # grubby --info=ALL My [n] is 2.
HTH
Disclaimer. I been using C5 and C6 for too many years, BUT I'm a raw newbie with C7. YMMV, etc
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Errors compiling vboxdrv on Centos 7

Post by socratis »

The fix should be part of 5.0.12 as described in ticket #14866.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Mihai1119
Posts: 1
Joined: 19. Dec 2015, 14:55

Re: Errors compiling vboxdrv on Centos 7

Post by Mihai1119 »

as root

Code: Select all

locate VBoxNetFlt-linux.c
/usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/VBoxNetFlt-linux.c
emacs /usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/VBoxNetFlt-linux.c
Search for KERNEL_VERSION and replace first line to look like the second one:

Code: Select all

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
Save, exit, and try again with
/etc/init.d/vboxdrv setup

It should work.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Errors compiling vboxdrv on Centos 7

Post by Perryg »

Mihai1119 wrote:as root

Code: Select all

locate VBoxNetFlt-linux.c
/usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/VBoxNetFlt-linux.c
emacs /usr/share/virtualbox/src/vboxhost/vboxnetflt/linux/VBoxNetFlt-linux.c
Search for KERNEL_VERSION and replace first line to look like the second one:

Code: Select all

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
Save, exit, and try again with
/etc/init.d/vboxdrv setup

It should work.
No need to hack the install. Just upgrade to 5.0.12
Post Reply