You are not logged in.

#1 2024-03-26 21:18:08

aquilarubra
Member
From: Trieste, Italy
Registered: 2018-11-24
Posts: 87

Virtualbox Guest Additions fail

Hi,
since latest updates, I noticed that Virtualbox shared clipboard and other features were not working.

I reinstalled virtualbox-guest-utils inside the guest, but nothing changed.

I run "rcvboxadd setup", and I get the following error in the log:

Building the main Guest Additions 7.0.14 module for kernel 6.8.1-arch1-1.
Error building the module.  Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/6.8.1-arch1-1/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j16 modules
make[1]: warning: -j16 forced in submake: resetting jobserver mode.
make -f ./scripts/Makefile.build obj=/tmp/vbox.0 need-builtin=1 need-modorder=1
# cmd_mod /tmp/vbox.0/vboxguest.mod
  printf '%s\n'   VBoxGuest-linux.o VBoxGuest-common.o common/string/strformatrt.o combined-agnostic.o combined-os-specific.o | awk '!x[$0]++ { print("/tmp/vbox.0/"$0) }' > /tmp/vbox.0/vboxguest.mod
# CC [M]  /tmp/vbox.0/VBoxGuest-linux.o
# CC [M]  /tmp/vbox.0/VBoxGuest-common.o
  gcc -Wp,-MMD,/tmp/vbox.0/.VBoxGuest-linux.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/>
  gcc -Wp,-MMD,/tmp/vbox.0/.VBoxGuest-common.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>
# CC [M]  /tmp/vbox.0/common/string/strformatrt.o
  gcc -Wp,-MMD,/tmp/vbox.0/common/string/.strformatrt.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 >
# CC [M]  /tmp/vbox.0/combined-agnostic.o
  gcc -Wp,-MMD,/tmp/vbox.0/.combined-agnostic.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 ./includ>
# CC [M]  /tmp/vbox.0/combined-os-specific.o
  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 ./inc>
/tmp/vbox.0/VBoxGuest-linux.c: In function ‘vgdrvLinuxParamLogGrpSet’:
/tmp/vbox.0/VBoxGuest-linux.c:1364:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]
 1364 |         strlcpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp));
      |         ^~~~~~~
      |         strscpy
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:243: /tmp/vbox.0/VBoxGuest-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1921: /tmp/vbox.0] Error 2
make: *** [/tmp/vbox.0/Makefile-footer.gmk:133: vboxguest] Error 2
kernel modules and services were not reloaded

It seems that the Virtualbox Guest Addition package is no longer compatible with the latest kernel. Any solution?

Offline

#2 2024-03-28 10:57:39

TheMyNickUserNameLogin
Member
Registered: 2024-03-28
Posts: 1

Re: Virtualbox Guest Additions fail

Created an acc just to answer this question, thus I wont reply to any further questions.
Had same issue, but kinda figured out the answer.
Firstly, I had to fully uninstall currently installed VBox Additions. To do this:
Mount/re-mount guest additions ISO using host OS's VirtualBox UI (the "Devices" -> "Mount Guest Additions Image" button)
`cd` into mounted image and run `sudo ./VBoxLinuxAdditions.run uninstall"
This didn't fully uninstalled additions for some reason, so I also ran `sudo pacman -R virtualbox-guest-utils`
Then, simply install guest additions from AUR repos:
`sudo pacman -S virtualbox-guest-utils`
(Note: there is also "virtualbox-guest-utils-nox" pck in case you use your Arch withour X-server/Headless)
Then restart VM, make sure to enable needed features in Host's VBox UI (e.g. clipboard sharing), and have fun!
Side note: strlcpy is a part of "bsd/string.h" header file from "libbsd" pckg, but I couldn't find line `#include <bsd/string.h>` in any of guest additions source files. Maybe I am too unattentive?

Offline

#3 2024-04-09 11:01:15

ms
Member
From: Bandung, Indonesia
Registered: 2010-07-28
Posts: 81
Website

Re: Virtualbox Guest Additions fail

@aquilarubra,

The temporary fixes is by search-and-replace the source code in "/opt/VBoxGuestAdditions-7.0.14/src" based on the error printed in the log. For example, given

/tmp/vbox.0/VBoxGuest-linux.c:1364:9: error: implicit declaration of function ‘strlcpy’; did you mean ‘strscpy’? [-Werror=implicit-function-declaration]

Edit file "/opt/VBoxGuestAdditions-7.0.14/src/vboxguest-7.0.14/vboxguest/VBoxGuest-linux.c", go to line "1364" and replace "strlcpy" with "strscpy". Run the "rcvboxadd setup" again, watch the log again and fix again. Do it until all of the modules compiled.

I hope that can help.

Offline

#4 2024-04-29 14:19:14

yongliang
Member
Registered: 2024-04-29
Posts: 1

Re: Virtualbox Guest Additions fail

I meet same issue from Ubuntu 24.04 and VirtualBox Additions 7.0.14, and cannot find perfect patch, so I change manually for me, and run "/sbin/rcvboxadd quicksetup all" again. My patch is:
diff -Nuar /etc/VBoxGuestAdditions-7.0.14.orig/src/vboxguest-7.0.14/vboxguest/VBoxGuest-linux.c /etc/VBoxGuestAdditions-7.0.14/src/vboxguest-7.0.14/vboxguest/VBoxGuest-linux.c
--- /etc/VBoxGuestAdditions-7.0.14.orig/src/vboxguest-7.0.14/vboxguest/VBoxGuest-linux.c    2024-01-15 22:02:02.000000000 +0800
+++ /etc/VBoxGuestAdditions-7.0.14/src/vboxguest-7.0.14/vboxguest/VBoxGuest-linux.c    2024-04-29 21:53:41.287040880 +0800
@@ -1361,7 +1361,7 @@
             RTLogGroupSettings(pLogger, pszValue);
     }
     else if (pParam->name[0] != 'd')
-        strlcpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp));
+        strscpy(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp));

     return 0;
}
@@ -1387,7 +1387,7 @@
             RTLogFlags(pLogger, pszValue);
     }
     else if (pParam->name[0] != 'd')
-        strlcpy(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags));
+        strscpy(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags));
     return 0;
}

@@ -1412,7 +1412,7 @@
             RTLogDestinations(pLogger, pszValue);
     }
     else if (pParam->name[0] != 'd')
-        strlcpy(&g_szLogDst[0], pszValue, sizeof(g_szLogDst));
+        strscpy(&g_szLogDst[0], pszValue, sizeof(g_szLogDst));
     return 0;
}

diff -Nuar /etc/VBoxGuestAdditions-7.0.14.orig/src/vboxguest-7.0.14/vboxsf/vfsmod.c /etc/VBoxGuestAdditions-7.0.14/src/vboxguest-7.0.14/vboxsf/vfsmod.c
--- /etc/VBoxGuestAdditions-7.0.14.orig/src/vboxguest-7.0.14/vboxsf/vfsmod.c    2024-01-15 22:02:02.000000000 +0800
+++ /etc/VBoxGuestAdditions-7.0.14/src/vboxguest-7.0.14/vboxsf/vfsmod.c    2024-04-29 21:52:53.230040880 +0800
@@ -551,7 +551,7 @@
         strncpy(mount_info->name, sf_name, sizeof(mount_info->name));
         mount_info->name[sizeof(mount_info->name)-1] = 0;
# else
-        strlcpy(mount_info->name, sf_name, sizeof(mount_info->name));
+        strscpy(mount_info->name, sf_name, sizeof(mount_info->name));
# endif
     }
}
@@ -633,7 +633,7 @@
                 SFLOGRELBOTH(("vboxsf: Could not allocate memory for iocharset!\n"));
                 return -ENOMEM;
             }
-            strlcpy(mount_info->nls_name, iocharset,
+            strscpy(mount_info->nls_name, iocharset,
                 sizeof(mount_info->nls_name));
             kfree(iocharset);
             break;
@@ -722,7 +722,7 @@
                 SFLOGRELBOTH(("vboxsf: Could not allocate memory for automount tag!\n"));
                 return -ENOMEM;
             }
-            strlcpy(mount_info->szTag, tag, sizeof(mount_info->szTag));
+            strscpy(mount_info->szTag, tag, sizeof(mount_info->szTag));
             kfree(tag);
             break;
         default:
@@ -1408,7 +1408,7 @@
     switch (opt) {
     case Opt_iocharset:
     case Opt_nls:
-        strlcpy(info->nls_name, param->string, sizeof(info->nls_name));
+        strscpy(info->nls_name, param->string, sizeof(info->nls_name));
         break;
     case Opt_uid:
         info->uid = result.uint_32;
@@ -1469,7 +1469,7 @@
             printk(KERN_WARNING "vboxsf: cache mode (%u) is out of range, using default instead.\n", result.uint_32);
         break;
     case Opt_tag:
-        strlcpy(info->szTag, param->string, sizeof(info->szTag));
+        strscpy(info->szTag, param->string, sizeof(info->szTag));
         break;
     default:
         return invalf(fc, "Invalid mount option: '%s'", param->key);
@@ -1528,7 +1528,7 @@
     }

     /* fc->source (the shared folder name) is set after vbsf_init_fs_ctx() */
-    strlcpy(info->name, fc->source, sizeof(info->name));
+    strscpy(info->name, fc->source, sizeof(info->name));

# if RTLNX_VER_MAX(5,3,0)
     return vfs_get_super(fc, vfs_get_independent_super, vbsf_read_super_aux);

Offline

Board footer

Powered by FluxBB