VirtualBox

Ticket #20091 (closed defect: fixed)

Opened 5 months ago

Last modified 4 months ago

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

vboxadd-setup.log Download (7.9 KB) - added by nixuser 5 months ago.
vboxadd-setup.log

Change History

Changed 5 months ago by nixuser

vboxadd-setup.log

comment:1 Changed 5 months ago by shumkar

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 5 months ago by shumkar (previous) (diff)

comment:2 Changed 5 months ago by nixuser

@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 Changed 5 months ago by paulson

  • Owner set to paulson
  • Status changed from new to accepted

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 Changed 5 months ago by nixuser

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

comment:5 Changed 4 months ago by paulson

  • Status changed from accepted to closed
  • Resolution set to fixed
  • Summary changed from Guest additions 6.1.16 won't build in CentOS Stream kernel-4.18.0-257.el8.x86_64 to 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
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use