Guest Additions fails on CentOS Stream 9

Discussions about using Linux guests in VirtualBox.
Post Reply
Guest-Additions-User1
Posts: 3
Joined: 19. Apr 2023, 00:13

Guest Additions fails on CentOS Stream 9

Post by Guest-Additions-User1 »

After an update to kernel version 5.14.0-452, Guest Additions stopped working on my CentOS Stream 9 VM (on an Ubuntu 22.04 host, fwiw) and I am unable to reinstall, even using the latest test build and development snapshot of Guest Additions.

Here is the tail of my vboxadd-setup.log file that shows the compilation error (full file attached):

8<
gcc -Wp,-MMD,/tmp/vbox.0/.combined-os-specific.o.d -nostdinc -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/compiler-version.h -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=gnu11 -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 -mindirect-branch-cs-prefix -mfunction-return=thunk-extern -fno-jump-tables -mharden-sls=all -fpatchable-function-entry=16,16 -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-strong -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -falign-functions=16 -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-array-bounds -Wno-alloc-size-larger-than "-Wimplicit-fallthrough=5" -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -Wno-declaration-after-statement -fno-pie -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -I./include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS -DRT_ARCH_AMD64 -DMODULE -DKBUILD_BASENAME='"combined_os_specific"' -DKBUILD_MODNAME='"vboxguest"' -D__KBUILD_MODNAME=kmod_vboxguest -c -o /tmp/vbox.0/combined-os-specific.o /tmp/vbox.0/combined-os-specific.c ; ./tools/objtool/objtool --hacks=jump_label --hacks=noinstr --hacks=skylake --orc --retpoline --rethunk --sls --static-call --uaccess --module --prefix=16 /tmp/vbox.0/combined-os-specific.o
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:1500:39: error: assignment of read-only member ‘vm_flags’
1500 | 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:1982:35: error: assignment of read-only member ‘vm_flags’
1982 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
| ^~
make[2]: *** [scripts/Makefile.build:296: /tmp/vbox.0/combined-os-specific.o] Error 1
make[1]: *** [Makefile:1942: /tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:145: vboxguest] Error 2
kernel modules and services were not reloaded
Attachments
setup-log.txt
(26.2 KiB) Downloaded 10 times
chris-llu
Posts: 5
Joined: 23. May 2022, 22:35

Re: Guest Additions fails on CentOS Stream 9

Post by chris-llu »

I'm experiencing the same issue with the 5.14.0-452 Centos 9 kernel. I did not have this issue with previous kernels on Centos 9. I am running the host on Windows 10. So, this issue is either with the kernel or VirtualBox and not a host OS issue. I have not tried a development build of VirtualBox, but looking in the official SVN repo, the last change that might have an impact was 7 weeks ago, this is before the 5.14.0-452 kernel came out, which I believe came out 3 weeks ago. So, I don't think a dev build of VirtualBox would fix anything.
larlau
Posts: 1
Joined: 12. Jun 2024, 16:04

Re: Guest Additions fails on CentOS Stream 9

Post by larlau »

I'm experiencing same issue with both test builds and snapshots.

Noticed similar error with Nvidia drivers that are now fixed.
I think modifying the vm_flags is now performed through the API wrapper, as explained by Suren on kernel org. I haven't had time to check, yet
vm_flags is used as a read-only property so that readers of the flags
don't have to change, however flag modifiers should be using new
wrapper functions. Fixing the errors in this report should be trivial.
For example:
vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND;
should be replaced with
vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND);
and
vma->vm_flags &= ~VM_MAYWRITE;
with
vm_flags_clear(vma, VM_MAYWRITE);
chris-llu
Posts: 5
Joined: 23. May 2022, 22:35

Re: Guest Additions fails on CentOS Stream 9

Post by chris-llu »

I tried the newest kernel, kernel-5.14.0-457, and still the same issue.

I think our issue might be related to RHEL 9.4. I started to have this issue a couple of weeks after RHEL 9.4 was released. This pretty much coincides when Centos would of got the 9.4 updates. Maybe Guest Additions doesn't support RHEL 9.4/Centos on 9.4 packages? The kernel might not even be the issue since a lot of programs and libraries were updated as well. Maybe one of these is preventing GA from working properly?
chris-llu
Posts: 5
Joined: 23. May 2022, 22:35

Re: Guest Additions fails on CentOS Stream 9

Post by chris-llu »

If you look at the log file that has the errors from the Guest Additions install, you will see that make can't find a file and that is why it fails. At least on my system, the file is there. I created a ticket for the VBox team to look at (https://www.virtualbox.org/ticket/22099). Please comment on ticket so that they know it is impacting people.
Post Reply