VirtualBox

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#20091 closed defect (fixed)

Guest additions 6.1.16 won't build in CentOS Stream kernel-4.18.0-257.el8.x86_64 => fixed in svn/6.1.x x>16

Reported by: nixuser Owned by: paulson
Component: guest additions Version: VirtualBox 6.1.16
Keywords: CentOS Stream Cc:
Guest type: Linux Host type: Windows

Description

Latest CentOS Stream kernel breaks guest additions build.

Kernel is kernel-4.18.0-257.el8.x86_64

Attachments (1)

vboxadd-setup.log (7.9 KB ) - added by nixuser 3 years ago.
vboxadd-setup.log

Download all attachments as: .zip

Change History (8)

by nixuser, 3 years ago

Attachment: vboxadd-setup.log added

vboxadd-setup.log

comment:1 by shumkar, 3 years ago

Hi,

I didn't see this ticket when was creating mine: https://www.virtualbox.org/ticket/20092.

Evidently, my ticket is a duplicate of this one.

@nixuser: If you want to try my fix: the folders in /opt are being created after running VBoxLinuxGuestAdditions.run

...As I understand, I have to remove the lines that I'm removing because the CentOS's kernel is named as 4.x but it is patched to such an extent that actually it is like a 5.x.

Last edited 3 years ago by shumkar (previous) (diff)

comment:2 by nixuser, 3 years ago

@shumkar ~ Thanks, your fix worked perfectly but you left a directory out of the path name of the file to edit, should be:

/opt/VBoxGuestAdditions-6.1.16/src/vboxguest-6.1.16/vboxsf/vfsmod.c

Thanks again.

comment:3 by paulson, 3 years ago

Owner: set to paulson
Status: newaccepted

Thanks for the report. The newer Linux kernel in Centos 8.2-2004 (4.18.0-193) brought with it the following changeset which moved the mount(2) flags in the Linux kernel source tree from include/linux/mount.h to include/linux/uapi/mount.h:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e262e32d6bde0f77fb0c95d977482fc872c51996

This Linux changeset was integrated in Linux kernel version 5.0.0.

The VirtualBox vfsmod.c file contains the following Linux kernel version checks to handle Linux commit e262e32d6bde0f77fb0c95d977482fc872c51996:

#if RTLNX_VER_MIN(5,0,0)
# include <uapi/linux/mount.h> /* for MS_REMOUNT */
#elif RTLNX_VER_MAX(3,3,0)
# include <linux/mount.h>
#endif

However CentOS 7.x ships with Linux kernel version 3.10.0-x and CentOS 8.x and CentOS stream ship with Linux kernel version 4.18.0-x both of which result in including linux/mount.h.

The CentOS version.h file for the most recent release which defines the mount(2) flags in fs.h shows:

$ cat CentOS-8.1-1911/usr/src/kernels/4.18.0-147.8.1.el8_1.x86_64/include/generated/uapi/linux/version.h
#define LINUX_VERSION_CODE 266752
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#define RHEL_MAJOR 8
#define RHEL_MINOR 1
#define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b))
#define RHEL_RELEASE_CODE 2049
#define RHEL_RELEASE "147.3.1"
#define KERNEL_HEADERS_CHECKSUM "35962aafc41b4f4ef241fe3ec48530f6cd4d2b00"

Whereas the version.h file for a CentOS release which defines the mount(2) flags in mount.h contains:

$ cat CentOS-8.2-2004/usr/src/kernels/4.18.0-193.19.1.el8_2.x86_64/include/generated/uapi/linux/version.h
#define LINUX_VERSION_CODE 266752
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#define RHEL_MAJOR 8
#define RHEL_MINOR 4
#define RHEL_RELEASE_VERSION(a,b) (((a) << 8) + (b))
#define RHEL_RELEASE_CODE 2052
#define RHEL_RELEASE "257"
#define KERNEL_HEADERS_CHECKSUM "01fe9c8ad44791cbe396ec634d7fa43d17b25419"

Thus to handle this kernel version vs. kernel feature disparity where the Linux kernel version doesn't reflect the code content we can adjust the test for Linux kernel versions to also include a check for RHEL_MAJOR and RHEL_MINOR to be equal or greater to 8.4 as in:

-#if RTLNX_VER_MIN(5,0,0)
+#if RTLNX_VER_MIN(5,0,0) || RTLNX_RHEL_MIN(8,4)

This has been addressed in revision r141925 of the development branch of VirtualBox and is available now in the development snapshot ISO Testbuilds of the Guest Additions. The fix has also been backported to the 6.1 branch of VirtualBox as of revision r141928 and is also available now the 6.1.x Testbuilds ISO of the Guest Additions. The fix will also be part of the next maintenance release of VirtualBox 6.1.x.

comment:4 by nixuser, 3 years ago

Guest Additions ISO r141928 on the from the Test Builds page is working perfectly for me on CentOS Stream, thanks.

comment:5 by paulson, 3 years ago

Resolution: fixed
Status: acceptedclosed
Summary: Guest additions 6.1.16 won't build in CentOS Stream kernel-4.18.0-257.el8.x86_64Guest additions 6.1.16 won't build in CentOS Stream kernel-4.18.0-257.el8.x86_64 => fixed in svn/6.1.x x>16

comment:6 by sergiomb, 2 years ago

anyone have fixes for new kernel kernel-4.18.0-338.el8.x86_64 ?

2021/10/11 15:56:36 akmodsbuild: /tmp/akmodsbuild.KESdz99q/BUILD/VirtualBox-kmod-6.1.26/_kmod_build_4.18.0-338.el8.x86_64/vboxdrv/r0drv/linux/alloc-r0drv-linux.c:204:14: error: implicit declaration of function 'map_vm_area'; did you mean 'get_vm_area'? [-Werror=implicit-function-declaration]
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use