我们有一个系统:
- 在 Windows 10 上运行的 VirtualBox 虚拟机管理程序 v7.0.18,
- RHEL9 的客户操作系统,“uname -r”显示其内核版本是“5.14.0-503.14.1.el9_5.x86_64”。
通过“dnf update”升级到上述内核版本后,我们尝试重建 VirtualBox GuestAdditions,并在日志文件中收到以下错误/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1447:39: error: assignment of read-only member ‘vm_flags’
。
日志文件中有趣部分的更多详细信息:
Building the main Guest Additions 7.0.18 module for kernel 5.14.0-503.14.1.el9_5.x86_64.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.14.0-503.14.1.el9_5.x86_64/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 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)
...
In file included from /tmp/vbox.0/combined-os-specific.c:43:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1447:39: error: assignment of read-only member ‘vm_flags’
1447 | papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
| ^~
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapUser’:
/tmp/vbox.0/r0drv/linux/memobj-r0drv-linux.c:1929:35: error: assignment of read-only member ‘vm_flags’
1929 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
| ^~
make[2]: *** [scripts/Makefile.build:249: /tmp/vbox.0/combined-os-specific.o] Error 1
make[1]: *** [Makefile:1944: /tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:133: vboxguest] Error 2
Could not find the X.Org or XFree86 Window System, skipping.
kernel modules and services were not reloaded