Re: VirtualBox kernel modules fail to build
On Mon, Jul 13, 2026 at 4:34 AM John Thompson via AlmaLinux Users <users@lists.almalinux.org> wrote:
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?
--
-John (JohnDThompson@gmail.com) Appleton, WI USA
Try this solution/workaround: https://forums.rockylinux.org/t/virtualbox-7-1-rocky-9-8/20579/6 Akemi
On 7/13/26 13:35, Akemi Yagi wrote:
Try this solution/workaround:
https://forums.rockylinux.org/t/virtualbox-7-1-rocky-9-8/20579/6
Thanks. Did it work for you? It still failed for me: VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_HOST_VMX -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-omit-frame-pointer -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 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_HOST_VMX -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"combined_agnostic1"' -DKBUILD_MODNAME='"vboxdrv"' -D__KBUILD_MODNAME=kmod_vboxdrv /tmp/vbox.0/combined-agnostic1.c | scripts/genksyms/genksyms -r /dev/null >> /tmp/vbox.0/.combined-agnostic1.o.cmd; fi make[1]: *** [Makefile:1968: /tmp/vbox.0] Error 2 make: *** [/tmp/vbox.0/Makefile-footer.gmk:146: vboxdrv] Error 2 -- -John (JohnDThompson@gmail.com) Appleton, WI USA
It it did not work for you, try this fix: Look at this file: /usr/share/virtualbox/src/vboxhost/vboxdrv/r0drv/linux/fileio-r0drv-linux.c and replace "open_with_fake_path" with its modern kernel replacement: "file_open_root" Worked for me. Akemi On Mon, Jul 13, 2026 at 11:41 AM John Thompson <johndthompson@gmail.com> wrote:
On 7/13/26 13:35, Akemi Yagi wrote:
Try this solution/workaround:
https://forums.rockylinux.org/t/virtualbox-7-1-rocky-9-8/20579/6
Thanks. Did it work for you? It still failed for me:
VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_HOST_VMX -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -include /tmp/vbox.0/include/VBox/SUPDrvMangling.h -fno-omit-frame-pointer -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 -DSUPDRV_WITH_RELEASE_LOGGER -DVBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV -DIPRT_WITHOUT_EFLAGS_AC_PRESERVING -DVBOX_WITH_HOST_VMX -DCONFIG_VBOXDRV_AS_MISC -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"combined_agnostic1"' -DKBUILD_MODNAME='"vboxdrv"' -D__KBUILD_MODNAME=kmod_vboxdrv /tmp/vbox.0/combined-agnostic1.c | scripts/genksyms/genksyms -r /dev/null >> /tmp/vbox.0/.combined-agnostic1.o.cmd; fi make[1]: *** [Makefile:1968: /tmp/vbox.0] Error 2 make: *** [/tmp/vbox.0/Makefile-footer.gmk:146: vboxdrv] Error 2
--
-John (JohnDThompson@gmail.com) Appleton, WI USA
participants (2)
-
Akemi Yagi -
John Thompson