Cannot build Virtualbox Guest Additions

Hey All,

Hoping for some suggestions here. I’m running Rocky 8.5 and trying to install the guest addons from VirtualBox 6.0.10. I’ve installed the packages to build but the log says that it’s missing files. Unfortunately I do not have the option to update VirtualBox to the latest (6.1) yet.

Any ideas or help would be awesome!


Building the main Guest Additions 6.0.10 module for kernel 4.18.0-348.12.2.el8_5.x86_64.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/4.18.0-348.12.2.el8_5.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j3 modules
make[1]: warning: -jN forced in submake: disabling jobserver mode.
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 ;                                                      \
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/ obj=/tmp/vbox.0
(cat /dev/null;   echo kernel//tmp/vbox.0/vboxguest.ko;) > /tmp/vbox.0/modules.order
  gcc -Wp,-MD,/tmp/vbox.0/.VBoxGuest-linux.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/includc
  gcc -Wp,-MD,/tmp/vbox.0/.VBoxGuest.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/genec
  gcc -Wp,-MD,/tmp/vbox.0/.VBoxGuestR0LibGenericRequest.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arc
In file included from ././include/linux/compiler_types.h:58,
                 from <command-line>:
/tmp/vbox.0/VBoxGuest.c: In function ‘vgdrvCheckIfVmmReqIsAllowed’:
./include/linux/compiler-gcc.h:406:24: error: expected ‘)’ before ‘__attribute__’
 # define fallthrough   __attribute__((__fallthrough__))
/tmp/vbox.0/include/iprt/cdefs.h:1169:48: note: in expansion of macro ‘fallthrough’
 # define RT_FALL_THROUGH()      __attribute__((fallthrough))
/tmp/vbox.0/include/iprt/cdefs.h:1176:33: note: in expansion of macro ‘RT_FALL_THROUGH’
 #define RT_FALL_THRU()          RT_FALL_THROUGH()
/tmp/vbox.0/VBoxGuest.c:2443:13: note: in expansion of macro ‘RT_FALL_THRU’
In file included from /tmp/vbox.0/include/iprt/types.h:32,
                 from /tmp/vbox.0/VBoxGuestInternal.h:33,
                 from /tmp/vbox.0/VBoxGuest.c:54:
/tmp/vbox.0/include/iprt/cdefs.h:1169:60: error: expected identifier or ‘(’ before ‘)’ token
 # define RT_FALL_THROUGH()      __attribute__((fallthrough))
/tmp/vbox.0/include/iprt/cdefs.h:1176:33: note: in expansion of macro ‘RT_FALL_THROUGH’
 #define RT_FALL_THRU()          RT_FALL_THROUGH()
/tmp/vbox.0/VBoxGuest.c:2443:13: note: in expansion of macro ‘RT_FALL_THRU’
make[2]: *** [scripts/ /tmp/vbox.0/VBoxGuest.o] Error 1
make[2]: *** Waiting for unfinished jobs....
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_VBoxGuestR0LibGenericRequest.o";
   ./tools/objtool/objtool orc generate  --module --no-fp  --retpoline "/tmp/vbox.0/.tmp_VBoxGuest-linux.o";
make[1]: *** [Makefile:1571: _module_/tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:111: vboxguest] Error 2
modprobe vboxguest failed

# uname -r
# dnf list --installed kernel*
Installed Packages
kernel.x86_64   4.18.0-348.el8.0.2   @anaconda
kernel.x86_64   4.18.0-348.12.2.el8_5   @baseos
kernel-core.x86_64   4.18.0-348.el8.0.2   @anaconda
kernel-core.x86_64   4.18.0-348.12.2.el8_5   @baseos
kernel-devel.x86_64   4.18.0-348.12.2.el8_5   @baseos
kernel-headers.x86_64   4.18.0-348.12.2.el8_5   @baseos
kernel-modules.x86_64   4.18.0-348.el8.0.2   @anaconda
kernel-modules.x86_64   4.18.0-348.12.2.el8_5   @baseos
kernel-tools.x86_64   4.18.0-348.12.2.el8_5   @baseos
kernel-tools-libs.x86_64   4.18.0-348.12.2.el8_5   @baseos
# test -e include/generated/autoconf.h -a -e include/config/auto.conf
# echo $?

Hi @jtech - I don’t have a solution, sorry, but can you explain why you are building the guest additions? I’m using VBox for more than a decade across various host OS and never had to do this, that’s why I’m wondering.
FWIW, I’m running VBox 6.1 ( 6.1.32 r149290) on RL 8.5 and all I did was to download the guest additions .iso file and mount it inside the VBox guest.
(Via the storage settings > optical drives > mount image, of the guest setup… or from the menu inside the running guest VM…)

BTW - the GuestAdditions iso file matching your version can be downloaded from:

Sorry if that is of no help, or if I’m missing the point here.

Cheers, Thomas

Thanks for the response; this was a standard install like you described. I mounted the ISO using the storage menu in VBox. This error file is the result of running the script on that ISO. My understanding is that the script builds the modules into the kernel. I’m not building my own kernels, this is a standard install as far as I can tell.

1 Like

The solution is to upgrade to Virtualbox 6.1.

If you’re feeling adventurous you could try using the patch shown here. That wouldn’t be my recommended solution though.


Thank you for that @FrankCox ! Cheers!

Ah, damn - that explains. I’ve somehow skipped the 6.0.x Vbox by coincidence.
Seems like again the old saying is true, that “thou shall not trust a dot-zero version” of anything :slight_smile:

Glad that a solution was found and thanks for the headsup, @FrankCox
You live and you learn

1 Like