kernel modules fail to build

Discussions related to using VirtualBox on Linux hosts.
Post Reply
JDThompson
Posts: 3
Joined: 4. Jul 2026, 17:36

kernel modules fail to build

Post by JDThompson »

I'm trying to update my VirtualBox installation to VirtualBox-7.2-7.2.12_174389_el9-1.x86_64.rpm on my Almalinux-9.8 machine, but the kernel modules fail to build. Here is the tail of the log file:

CC [M] /usr/src/vboxhost/vboxdrv/combined-os-specific.o
In file included from /usr/src/vboxhost/vboxdrv/combined-os-specific.c:43:
/usr/src/vboxhost/vboxdrv/r0drv/linux/fileio-r0drv-linux.c: In function ‘VBoxHost_RTFileOpen’:
/usr/src/vboxhost/vboxdrv/r0drv/linux/fileio-r0drv-linux.c:162:30: error: implicit declaration of function ‘open_with_fake_path’ [-Werror=implicit-function-declaration]
162 | struct file *pFile = open_with_fake_path(&Path, fOpenMode, d_inode(Path.dentry), current_cred());
| ^~~~~~~~~~~~~~~~~~~
/usr/src/vboxhost/vboxdrv/r0drv/linux/fileio-r0drv-linux.c:162:30: warning: initialization of ‘struct file *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:250: /usr/src/vboxhost/vboxdrv/combined-os-specific.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [Makefile:1968: /usr/src/vboxhost/vboxdrv] Error 2
make[2]: Leaving directory '/usr/src/kernels/5.14.0-687.20.1.el9_8.x86_64'
make[1]: *** [/usr/src/vboxhost/vboxdrv/Makefile-footer.gmk:146: vboxdrv] Error 2
make[1]: Leaving directory '/usr/src/vboxhost/vboxdrv'
make: *** [Makefile:78: vboxdrv] Error 2

Any ideas?

I have been unable to revert to my previous installation as those modules have apparently been deleted when I updated.
KloCZ2
Posts: 15
Joined: 21. Aug 2025, 11:21

Re: kernel modules fail to build

Post by KloCZ2 »

Same problem here - after upgrade to AlmaLinux 9.8 and kernel 5.14.0-687.24.1.el9_8.x86_64, building of vbox modules ending with errors.

I tried - stable VirtualBox-7.2-7.2.12_174389_el9-1.x86_64, development version VirtualBox-7.2-7.2.97_174221_el9-1.x86_64.rpm (even it should be latest development snapshot from Testbuild pages, it's probably older than final version [?] ), and also development version VirtualBox-7.1-7.1.19_174041_el9-1.x86_64.rpm -- situation is always the same.

Is there any functional workaround for this ? Reverting back to Alma/RHEL 9.7 it's not easy / possible (and also it's not optimally for security reasons).
KloCZ2
Posts: 15
Joined: 21. Aug 2025, 11:21

Re: kernel modules fail to build

Post by KloCZ2 »

KloCZ2 wrote: 11. Jul 2026, 05:10 Same problem here - after upgrade to AlmaLinux 9.8 and kernel 5.14.0-687.24.1.el9_8.x86_64, building of vbox modules ending with errors.

I tried - stable VirtualBox-7.2-7.2.12_174389_el9-1.x86_64, development version VirtualBox-7.2-7.2.97_174221_el9-1.x86_64.rpm (even it should be latest development snapshot from Testbuild pages, it's probably older than final version [?] ), and also development version VirtualBox-7.1-7.1.19_174041_el9-1.x86_64.rpm -- situation is always the same.

Is there any functional workaround for this ? Reverting back to Alma/RHEL 9.7 it's not easy / possible (and also it's not optimally for security reasons).
Ok, functional workaround is revert Alma/RHEL to older kernel (5.14.0-611.54.6.el9_7.x86_64, in my case), then is possible to load vbox modules under 7.2.12 version and VBox is running; it's not ideal solution (due to security reasons), but better than nothing. Although I'm observing the crash of VMs after several hours, as under the all previous 7.2.X versions (under the 7.1.X versions is everything fine) - I'll describe it more precisely in belonged thread here in "VirtualBox on Linux Hosts" section.
JDThompson
Posts: 3
Joined: 4. Jul 2026, 17:36

Re: kernel modules fail to build

Post by JDThompson »

Thanks for the responses. Sounds like I'm not alone in this. The oldest kernel I still have installed is 5.14.0-687.20.1; going to an even earlier one sounds like more of a PITA than it's worth. My Ubuntu machine can still run VirtualBox, anyway.
Last edited by JDThompson on 12. Jul 2026, 23:34, edited 1 time in total.
JDThompson
Posts: 3
Joined: 4. Jul 2026, 17:36

Re: kernel modules fail to build

Post by JDThompson »

Looking at the kernel config file in /lib/modules/5.14.0-687.24.1.el9_8.x86_64, it appears that KVM options are enabled in the default kernel:

# grep CONFIG_KVM config
CONFIG_KVM_GUEST=y
CONFIG_KVM_COMMON=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GENERIC_MMU_NOTIFIER=y
CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES=y
CONFIG_KVM_PRIVATE_MEM=y
CONFIG_KVM_GENERIC_PRIVATE_MEM=y
CONFIG_KVM=m
CONFIG_KVM_SW_PROTECTED_VM=y
CONFIG_KVM_INTEL=m
CONFIG_KVM_INTEL_TDX=y
CONFIG_KVM_AMD=m
CONFIG_KVM_AMD_SEV=y
CONFIG_KVM_SMM=y
CONFIG_KVM_HYPERV=y
# CONFIG_KVM_XEN is not set
CONFIG_KVM_MAX_NR_VCPUS=4096

I have the KVM modules blacklisted, and lsmod shows thay they are not loaded, but could this be the problem?
Maddmac
Posts: 2
Joined: 22. Jul 2026, 16:23

Re: kernel modules fail to build

Post by Maddmac »

Rocky 9 (Centos 9, RHEL 9) fails to build 7.2.10 and 7.2.14 kernel modules after update to latest kernel, 5.14.0-687.26.1.el9_8.x86_64. I had to fall back to a previous kernel, 5.14.0-687.17.1.el9_8.x86_64, which works fine. :cry:
bgee22
Posts: 36
Joined: 25. May 2009, 17:20
Primary OS: Linux other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Centos, Fedora 10, FreeDOS

Re: kernel modules fail to build

Post by bgee22 »

Same problem here. AlmaLinux 9 and VirtualBox 7.2.14_174565_el9.

I rebooted AlmaLinux to kernel 5.14.0-687.17.1, then ran vboxconfig. That worked.

The first few lines from vbox-setup.log:

Code: Select all

Building the main VirtualBox module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.14.0-687.26.1.el9_8.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j20 modules
make[1]: warning: -j20 forced in submake: resetting jobserver mode.
ewessel
Posts: 2
Joined: 13. Jan 2017, 23:01

Re: kernel modules fail to build

Post by ewessel »

I'm glad I'm not the only one having this issue. VBox 7.2.10 crashed, and trying to run the vboxconfig gave an error. Tried upgrading to 7.2.14 gave the same error, logs start off with this:

Building the main VirtualBox module.
Error building the module:
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.14.0-687.20.1.el9_8.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j24 modules
make[1]: warning: -j24 forced in submake: resetting jobserver mode.
make -f ./scripts/Makefile.build obj=/tmp/vbox.0 \

Hopefully someone at oracle will take a look at this and get it working again?
Maddmac
Posts: 2
Joined: 22. Jul 2026, 16:23

Re: kernel modules fail to build

Post by Maddmac »

It looks like the bug is being tracked in github as bug #771.
KloCZ2
Posts: 15
Joined: 21. Aug 2025, 11:21

Re: kernel modules fail to build

Post by KloCZ2 »

Good news - on RHEL9.8 and newest kernel (5.14.0-687.30.1), with fresh testbuild of VirtualBox-7.2 (VirtualBox-7.2-7.2.15_174675_el9-1.x86_64.rpm), it looks like that building of vbox modules is working again :

Code: Select all

cat -var-log-vbox-setup.log
Building the main VirtualBox module.
Building the net filter module.
Building the net adapter module.

lsmod|grep vbox
vboxnetadp             32768  0
vboxnetflt             40960  0
vboxdrv               745472  2 vboxnetadp,vboxnetflt


PS: It's very hard to place a new post here in forum. It returns to me continuously :

Access Denied
You don't have permission to access "http://forums.virtualbox.org/posting.php?" on this server.
Reference #18...

PS2: Aha, it's because of slashes in the path to the var-log ... interesting.
JDThompson
Posts: 3
Joined: 4. Jul 2026, 17:36

Re: kernel modules fail to build

Post by JDThompson »

Good news - on RHEL9.8 and newest kernel (5.14.0-687.30.1), with fresh testbuild of VirtualBox-7.2 (VirtualBox-7.2-7.2.15_174675_el9-1.x86_64.rpm), it looks like that building of vbox modules is working again
Where did you find this build? The closest I can find is VirtualBox-7.2-7.2.15_174675_el9-1.x86_64.rpm, dated 20 July 2026, and it still fails to build the kernel modules.
Post Reply