Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Error while installing Virtualbox guest additions in Ubuntu 20.04.2: Look at /var/log/vboxadd-setup.log to find out what went wrong

Writer Andrew Henderson

I'm having an issue trying to install Virtual box Guest Additions. My host OS is Ubuntu 20.04.2, and my Pc has a Windows 10 OS.

The steps I followed to try install Guest additions are:

  1. go to Devices menu. 2.click on Insert Guest Additions CD image, then I type in password and then click run.

This opens a terminal in which it starts to download the Virtual box Guest Additions, and the terminal output I get is:

VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what went wrong

So I checked the content of /var/log/vboxadd-setup.log:

 Building the main Guest Additions 6.1.18 module for kernel 5.8.0-44-generic.
Error building the module. Build output follows.
make V=1 CONFIG_MODULE_SIG= CONFIG_MODULE_SIG_ALL= -C /lib/modules/5.8.0-44-generic/build M=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 -j2 modules
make[1]: warning: -j2 forced in submake: resetting jobserver mode.
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) ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it.
make[1]: *** [Makefile:746: include/config/auto.conf] Error 1
make: *** [/tmp/vbox.0/Makefile-footer.gmk:117: vboxguest] Error 2

But I can't seem to understand what I need to do to make it work.

I would really appreciate any help with this issue.

4

3 Answers

This seems to be a problem caused by a VirtualBox bug. This is what I encountered:

I use Ubuntu 16.04 with kernel 4.4.0-210, after upgrade VirtualBox to 6.1.22, I meet with the problem described above. I solved it with @Jamie Brown's sulution. Thank you!

Then I found VirtualBox changelog at say:

VirtualBox 6.1.24 (released July 20 2021)

Linux Guest Additions: Introduce support for Ubuntu specific kernels (bug #20325)

And the bug ticket page say: When installing Guest Additions from 6.1.20 in kernel 4.4.0.210-generic (Ubuntu 16.04) module vboxsf fails compiling with exactly same error as #18697.

So this is a bug introduced in 6.1.20 and solved in 6.1.24, and only cause error with some specific kernel.

I had the same issue - suddenly today my Vagrant box stopped mounting my shared folders, and kept failing to update the Virtual Guest Additions every time it started:

==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key
==> default: Machine booted and ready!
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 6.1.18
Going on, assuming VBoxService is correct...
[default] GuestAdditions seems to be installed (6.1.18) correctly, but not running.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 6.1.18
Going on, assuming VBoxService is correct...
Job for vboxadd-service.service failed because the control process exited with error code. See "systemctl status vboxadd-service.service" and "journalctl -xe" for details.
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 6.1.18
Going on, assuming VBoxService is correct...
update-initramfs: Generating /boot/initrd.img-4.4.0-209-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
VirtualBox Guest Additions: Starting.
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: or
VirtualBox Guest Additions: /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Building the modules for kernel 4.4.0-209-generic.
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
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 6.1.18
Going on, assuming VBoxService is correct...
Got different reports about installed GuestAdditions version:
Virtualbox on your host claims: 5.0.18
VBoxService inside the vm claims: 6.1.18
Going on, assuming VBoxService is correct...
Restarting VM to apply changes...
==> default: Attempting graceful shutdown of VM...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...

The log was no help, it just said this:

vagrant@ubuntu-xenial:~$ cat /var/log/vboxadd-setup.log
Could not find the X.Org or XFree86 Window System, skipping.

After messing around for ages and reading several StackOverflow answers from a few years ago (none of which helped) I upgraded my kernel:

vagrant@ubuntu-xenial:~$ wget
sudo install ubuntu-mainline-kernel.sh /usr/local/bin/
ubuntu-mainline-kernel.sh -c
sudo ubuntu-mainline-kernel.sh -i v5.11.15

And then restarted with vagrant halt and vagrant up, and the VB Guest Additions got themselves all sorted out.

So if you've got an old box, it looks like the latest VirtualBox Guest Additions do not play nice and you need to update your kernel.

I had the same issue on a guest OS with Ubuntu 20.04.2 LTS, kernel 5.11.0-27-generic and VBox 6.1.16.

As Keaser pointed out, this seems to be related to some mismatch between Guest Additions and the Linux kernel version installed.

After upgrading VBox to 6.1.26 and re-installing the provided Guest Additions, followed by a reboot, the problem was solved.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy