Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Discussions related to using VirtualBox on Linux hosts.
Post Reply
M4tr1x
Posts: 8
Joined: 8. Jan 2021, 19:53

Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by M4tr1x »

Hi:

Im try compile vbox 6.1.18 with kernel 5.11 in Fedore 33 failed.

gcc -Wp,-MMD,/tmp/vbox.0/.SUPR0IdcClientComponent.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/10/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"SUPR0IdcClientComponent"' -DKBUILD_MODNAME='"vboxnetflt"' -c -o /tmp/vbox.0/SUPR0IdcClientComponent.o /tmp/vbox.0/SUPR0IdcClientComponent.c
gcc -Wp,-MMD,/tmp/vbox.0/linux/.SUPR0IdcClient-linux.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/10/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -fmacro-prefix-map=./= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=2048 -fstack-protector -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-pie -Wno-declaration-after-statement -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"SUPR0IdcClient_linux"' -DKBUILD_MODNAME='"vboxnetflt"' -c -o /tmp/vbox.0/linux/SUPR0IdcClient-linux.o /tmp/vbox.0/linux/SUPR0IdcClient-linux.c
./tools/objtool/objtool orc generate --module --no-fp --retpoline --uaccess /tmp/vbox.0/linux/SUPR0IdcClient-linux.o
./tools/objtool/objtool orc generate --module --no-fp --retpoline --uaccess /tmp/vbox.0/SUPR0IdcClient.o
./tools/objtool/objtool orc generate --module --no-fp --retpoline --uaccess /tmp/vbox.0/SUPR0IdcClientComponent.o
./tools/objtool/objtool orc generate --module --no-fp --retpoline --uaccess /tmp/vbox.0/VBoxNetFlt.o
/tmp/vbox.0/linux/VBoxNetFlt-linux.c: In function ‘vboxNetFltNeedsLinkState’:
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1761:47: error: invalid use of undefined type ‘const struct ethtool_ops’
1761 | if (pDev->ethtool_ops && pDev->ethtool_ops->get_drvinfo)
| ^~
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1763:32: error: storage size of ‘Info’ isn’t known
1763 | struct ethtool_drvinfo Info;
| ^~~~
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1766:20: error: ‘ETHTOOL_GDRVINFO’ undeclared (first use in this function)
1766 | Info.cmd = ETHTOOL_GDRVINFO;
| ^~~~~~~~~~~~~~~~
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1766:20: note: each undeclared identifier is reported only once for each function it appears in
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1767:26: error: invalid use of undefined type ‘const struct ethtool_ops’
1767 | pDev->ethtool_ops->get_drvinfo(pDev, &Info);
| ^~
/tmp/vbox.0/linux/VBoxNetFlt-linux.c:1763:32: warning: unused variable ‘Info’ [-Wunused-variable]
1763 | struct ethtool_drvinfo Info;
| ^~~~
make[2]: *** [scripts/Makefile.build:279: /tmp/vbox.0/linux/VBoxNetFlt-linux.o] Error 1
make[1]: *** [Makefile:1804: /tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:117: vboxnetflt] Error 2

Help me please
ssh73
Posts: 9
Joined: 21. Feb 2021, 15:22

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by ssh73 »

Pretty straight forward:
1. install ethtool:

Code: Select all

dnf -y install ethtool
2. check if ethtool.h is located in accessible location:

Code: Select all

find /usr -name "ethtool.h"
/usr/include/linux/ethtool.h
3. put

Code: Select all

#include <linux/ethtool.h>
somewhere at the top of the failed VBoxNetFlt-linux.c

And then it should be compiled successfully.
M4tr1x
Posts: 8
Joined: 8. Jan 2021, 19:53

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by M4tr1x »

Hi:

The fix working, compile OK

[ 14.217090] vboxdrv: Found 8 processor cores
[ 14.247426] vboxdrv: TSC mode is Invariant, tentative frequency 1799996257 Hz
[ 14.247429] vboxdrv: Successfully loaded version 6.1.18 (interface 0x00300000)

Linux localhost.localdomain 5.11.0-ck1 #2 SMP Sat Feb 20 23:22:24 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

Thanks !!! :D
ssh73
Posts: 9
Joined: 21. Feb 2021, 15:22

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by ssh73 »

M4tr1x wrote:Hi:

The fix working, compile OK

Thanks !!! :D
Welcome)
M4tr1x
Posts: 8
Joined: 8. Jan 2021, 19:53

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by M4tr1x »

Update

Compile with kernel 5.11.2-ck1 is OK

[ 106.291218] VBoxNetFlt: Successfully started.
[ 106.298940] VBoxNetAdp: Successfully started.
station8@localhost ~> uname -a
Linux localhost.localdomain 5.11.2-ck1 #1 SMP Fri Feb 26 21:05:00 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

Regards
trekfan1
Posts: 98
Joined: 13. May 2007, 07:22
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux
Location: Italy

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by trekfan1 »

Sorry for my English, i'm Italian
M4tr1x
Posts: 8
Joined: 8. Jan 2021, 19:53

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by M4tr1x »

Thanks trekfan1

Update

Compile with kernel 5.11.3 is OK

station8@localhost ~> uname -a
Linux localhost.localdomain 5.11.3 #1 SMP Thu Mar 4 14:50:26 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

[ 103.160422] VBoxNetFlt: Successfully started.
[ 103.169144] VBoxNetAdp: Successfully started.
marckitus9
Posts: 1
Joined: 24. Mar 2021, 11:36

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by marckitus9 »

ssh73 wrote:Pretty straight forward:
1. install ethtool:

Code: Select all

dnf -y install ethtool
2. check if ethtool.h is located in accessible location:

Code: Select all

find /usr -name "ethtool.h"
/usr/include/linux/ethtool.h
3. put

Code: Select all

#include <linux/ethtool.h>
somewhere at the top of the failed VBoxNetFlt-linux.c

And then it should be compiled successfully.
Thanks a lot ssh73. How you know find the errors? Is incredible, works perfects. But one help that I wished liked to hear when I try to change the file is where it is located. The answer is using the command "updatedb" and later "locate VirtualBox", next you know the folder of installation, after this you need find the folder vboxnetflt and inside you need to cd linux and here is the file that you comment. The unique problem of upgrade the kernel is this, VirtualBox seems that always raise an error (although that is a good sign, as it means that it interacts directly with kernel).
Again, thanks a lot.
Alex80
Posts: 23
Joined: 28. Jan 2019, 15:26

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by Alex80 »

It works for me too with Fedora 32 (Kernel: 5.11.7-100.fc32.x86_64).
Big thanks!
(Virtualbox install is always a suck.)
opabloc
Posts: 1
Joined: 24. Mar 2021, 18:17

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by opabloc »

HI everybody!, I had the same issue on Fedora 32 kernel 5.11.7-100. and the workaround works for me.
And I agree Fedora's upgrade is always a pain in the ass with VBox.

Regards
M4tr1x
Posts: 8
Joined: 8. Jan 2021, 19:53

Re: Fedora 33 with kernel 5.11 vitualbox 6.1.18 complie failed

Post by M4tr1x »

Update


Kernel 5.11.10 , Fedora 33 and Vbox 6.1.18 compile OK

[ 66.621175] VBoxNetFlt: Successfully started.
[ 66.631065] VBoxNetAdp: Successfully started.
Linux localhost.localdomain 5.11.10-200.fc33.x86_64 #1 SMP Thu Mar 25 16:51:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Post Reply