Guest additions fail to run.

Discussions about using Linux guests in VirtualBox.
Post Reply
gijsv
Posts: 3
Joined: 26. Mar 2019, 11:31

Guest additions fail to run.

Post by gijsv »

Host: 4.19.30-1-MANJARO
Guest: Fedora 5.0.3-200.fc29.x86_64
Virtualbox: VirtualBox Graphical User Interface Version 6.0.4 r128164

When trying to install the guest additions "VBoxGuestAdditions_6.0.4.iso" in a Fedora 29 host with kernel 5.0, on a Manjaro 4.18 host. It fails with error:

Code: Select all

sudo ./VBoxLinuxAdditions.run 
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.0.4 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 6.0.4 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules.  This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:   /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: Building the modules for kernel 
5.0.3-200.fc29.x86_64.

VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what 
went wrong
VirtualBox Guest Additions: Running kernel modules will not be replaced until 
the system is restarted
VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: modprobe vboxsf failed
The log contains the following error, it looks like MS_REMOUNT is undeclared.

Code: Select all

Building the main Guest Additions module for kernel 5.0.3-200.fc29.x86_64.
Building the shared folder support module.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= -C /lib/modules/5.0.3-200.fc29.x86_64/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j1 modules
Makefile:189: ================= WARNING ================
Makefile:190: 'SUBDIRS' will be removed after Linux 5.3
Makefile:191: Please use 'M=' or 'KBUILD_EXTMOD' instead
Makefile:192: ==========================================
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)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/tmp/vbox.0
  gcc -Wp,-MD,/tmp/vbox.0/.vfsmod.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -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/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror-implicit-function-declaration -Werror=implicit-int -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -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 -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fvar-tracking-assignments -g -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -Wno-declaration-after-statement -fshort-wchar -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -fno-pie -I/lib/modules/5.0.3-200.fc29.x86_64/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxsf/ -I/tmp/vbox.0/vboxsf/include -I/tmp/vbox.0/vboxsf/r0drv/linux -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DIN_MODULE -DIN_GUEST_R0 -DRT_NO_EXPORT_SYMBOL -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS  -DMODULE  -DKBUILD_BASENAME='"vfsmod"' -DKBUILD_MODNAME='"vboxsf"' -c -o /tmp/vbox.0/vfsmod.o /tmp/vbox.0/vfsmod.c
/tmp/vbox.0/vfsmod.c: In function ‘sf_read_super_aux’:
[b]/tmp/vbox.0/vfsmod.c:235:14: error: ‘MS_REMOUNT’ undeclared (first use in this function); did you mean ‘DT_RELCOUNT’?[/b]
  if (flags & MS_REMOUNT) {
              ^~~~~~~~~~
              DT_RELCOUNT
/tmp/vbox.0/vfsmod.c:235:14: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:277: /tmp/vbox.0/vfsmod.o] Error 1
make[1]: *** [Makefile:1557: _module_/tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile.include.footer:106: vboxsf] Error 2
Any help on solving the issue would be much appreciated, as I need file sharing for this project.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Guest additions fail to run.

Post by socratis »

gijsv wrote:
Virtualbox: VirtualBox Graphical User Interface Version 6.0.4 r128164
...
VirtualBox Guest Additions: Building the modules for kernel 5.0.3-200.fc29.x86_64.
If you want to use the latest version for your host/guests, you should also consider doing the same for VirtualBox. Try the latest test builds, they contain the fix.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
mturk
Posts: 2
Joined: 26. Mar 2019, 12:07

Re: Guest additions fail to run.

Post by mturk »

socratis wrote:
gijsv wrote:
Virtualbox: VirtualBox Graphical User Interface Version 6.0.4 r128164
...
VirtualBox Guest Additions: Building the modules for kernel 5.0.3-200.fc29.x86_64.
If you want to use the latest version for your host/guests, you should also consider doing the same for VirtualBox. Try the latest test build they contain the fix.
Latest test build (VBoxGuestAdditions_6.0.5-129561.iso) gives pretty much the same error on 5.0.3-200 kernel

Code: Select all

/tmp/vbox.0/vfsmod.c:235:14: error: ‘MS_REMOUNT’ undeclared (first use in this function); did you mean ‘DT_RELCOUNT’?
  if (flags & MS_REMOUNT) {
              ^~~~~~~~~~
              DT_RELCOUNT
/tmp/vbox.0/vfsmod.c:235:14: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:277: /tmp/vbox.0/vfsmod.o] Error 1
gijsv
Posts: 3
Joined: 26. Mar 2019, 11:31

Re: Guest additions fail to run.

Post by gijsv »

Unfortunately the newest build 6.0.5 downloaded directly from the site gives the same exact error.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Guest additions fail to run.

Post by andyp73 »

I've just had a look at the guest addition sources from the .iso included in test build 6.0.5 r129563 and the fix that is in the svn repository doesn't appear to be included. Let me see if the devs are around on IRC and see what they say.

In the short term you can make the change to /opt/VBoxGuestAdditions-6.0.5/src/vboxguest-6.0.5/vboxsf/vfsmod.h and make the #include read:

Code: Select all

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
    # include <uapi/linux/mount.h> /* for MS_REMOUNT */
#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
   # include <linux/mount.h>
#endif
From the directory /opt/VBoxGuestAdditions-6.0.5/src/vboxguest-6.0.5 run "make" and then "make install".

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
andyp73
Volunteer
Posts: 1631
Joined: 25. May 2010, 23:48
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Assorted Linux, Windows Server 2012, DOS, Windows 10, BIOS/UEFI emulation

Re: Guest additions fail to run.

Post by andyp73 »

The devs have worked their magic and there are new Test Builds available that include guest additions that should compile on all kernels later than 5.0.0. For VirtualBox 6.0 you need r129577 and later and for 5.2 it is r129578 and later.

-Andy.
My crystal ball is currently broken. If you want assistance you are going to have to give me all of the necessary information.
Please don't ask me to do your homework for you, I have more than enough of my own things to do.
gijsv
Posts: 3
Joined: 26. Mar 2019, 11:31

Re: Guest additions fail to run.

Post by gijsv »

I see, great on the reaction speed. I got it working with the include addition in the vfsmod.h, thanks for the fast support!
mturk
Posts: 2
Joined: 26. Mar 2019, 12:07

Re: Guest additions fail to run.

Post by mturk »

Cool, VBoxGuestAdditions_6.0.5-129577.iso test build compiles for 5.0.x kernel.

Code: Select all

[mturk ~]$ cat /var/log/vboxadd-setup.log
Building the main Guest Additions module for kernel 5.0.3-200.fc29.x86_64.
Building the shared folder support module.
Building the graphics driver module.
Thanks
rwicks
Posts: 3
Joined: 7. Apr 2022, 12:09

Re: Guest additions fail to run.

Post by rwicks »

OK, I had this problem and I know the solution now.

Basically, your "Guest Additions CD Image" with your version of VirtualBox is too old to work with your new kernel which is newer than your VirtualBox software. You can either install the newest version of VirtualBox so the Image included with the software works with the kernel you have, OR you can just grab a newer version of the ISO CD Image.

I signed up for an account JUST to answer this question, I'm not allowed to post URLs (yet, apparently in spam purgatory) - but the Guest Additions CD Image for VirtualBox is online and you can use the most up to date version of that. Remember you can mount ISO images with something like:
mkdir /tmp/loop
mount <iso_image> /tmp/loop
Using a version of the Guest Additions CD Image that is newer than your VirtualBox MAY not work, but it worked OK for me.

Basically, nothing is wrong with VirtualBox or your new VM - your VM's kernel just has changed enough that older versions of the Guest Additions CD Image can't compile the kernel you have.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Guest additions fail to run.

Post by mpack »

rwicks wrote: Using a version of the Guest Additions CD Image that is newer than your VirtualBox MAY not work, but it worked OK for me.
Whether it worked (or rather: didn't fail obviously) is not the issue. Guest Additions for a newer version of VirtualBox should never be used with an older version. The reverse is usually ok, because backwards compatibility is a lot easier than accurately predicting the future.
rwicks
Posts: 3
Joined: 7. Apr 2022, 12:09

Re: Guest additions fail to run.

Post by rwicks »

mpack wrote:
rwicks wrote: Using a version of the Guest Additions CD Image that is newer than your VirtualBox MAY not work, but it worked OK for me.
Whether it worked (or rather: didn't fail obviously) is not the issue. Guest Additions for a newer version of VirtualBox should never be used with an older version. The reverse is usually ok, because backwards compatibility is a lot easier than accurately predicting the future.
Well this is true.

I'm was only setting up a VM to help a more junior user to do some configuration, and I wanted a parallel machine so that I didn't step him into the wrong direction. It doesn't matter to me if this is a long term solution or not. I didn't want to have to uninstall and reinstall VirtualBox and risk some problem - particularly with the Extension Pack because I do have VMs that must be up and accessible. I would wager a bet that the only difference between the modules that are built is compatibility with more versions of the kernel, but of course I don't know.

I'm at 6.0.4r and the current version is 6.1 - I got VBoxGuestAdditions_6.1.32.iso - there's a lot of people befuddled with this, messing around with source code with the installer and so on, that's a lot more dangerous than just getting the new edition in my opinion.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Guest additions fail to run.

Post by mpack »

Genuine VirtualBox comes bundled with the correct Guest Additions ISO that you should use with the software. There should be no need for confusion.
rwicks
Posts: 3
Joined: 7. Apr 2022, 12:09

Re: Guest additions fail to run.

Post by rwicks »

mpack wrote:Genuine VirtualBox comes bundled with the correct Guest Additions ISO that you should use with the software. There should be no need for confusion.
The confusion, at least for me, is "VirtualBox always worked before, why is this piece of crap version of Linux I'm testing out failing?"

Well, it's not a piece of crap - just the Linux kernel has changed - you need to update your VirtualBox software, or if you want to take a (perhaps pretty big) risk, get the VirtualBox Guest Edition CD for a newer version and HOPE that it works with your older version of VirtualBox. Took me a couple of hours to realize NOTHING was wrong, other than the kernel changed how it compiled modules, and the version of the Guest Edition I was using was created before the kernel changed how it compiled modules.
Post Reply