I daily use a Debian SID (Still In Development) in a Virtualbox hosted on a MS-Windows system. As this version of GNU/Linux is updated almost every day, it is not so uncommon that your embedded system does not work properly after you updated it. For example, Xorg is not able to fully use your screen or the clipboard cannot be shared between the host and the guest.
The reason is that for the guest additions to work properly, it has to be compiled with the current kernel of your system.
Here is an excerpt of the logs you can find in
/var/log/syslog when you have
systemd: Starting vboxadd.service... vboxadd: VirtualBox Guest Additions: Starting. vboxadd: VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. vboxadd: This system is currently not set up to build kernel modules. vboxadd: Please install the Linux kernel "header" files matching the current kernel vboxadd: for adding new hardware support to the system. vboxadd: The distribution packages containing the headers are probably: vboxadd: linux-headers-amd64 linux-headers-4.14.0-3-amd64 vboxadd: modprobe vboxguest failed vboxadd: The log file /var/log/vboxadd-setup.log may contain further information. systemd: vboxadd.service: Main process exited, code=exited, status=1/FAILURE systemd: vboxadd.service: Failed with result 'exit-code'. systemd: Failed to start vboxadd.service. systemd: Starting vboxadd-service.service... vboxadd-service: vboxadd-service.sh: Starting VirtualBox Guest Addition service. vboxadd-service.sh: Starting VirtualBox Guest Addition service. vboxadd-service: VirtualBox Additions module not loaded! systemd: vboxadd-service.service: Control process exited, code=exited status=1 systemd: vboxadd-service.service: Failed with result 'exit-code'. systemd: Failed to start vboxadd-service.service.
While these lines are crystal clear, I write here the solution to help my failing memory:
Install your distribution kernel headers
sudo ap-get install linux-headers-$(uname -r)
Mount the VBoxGuestAdditions volume and run the install script
sudo sh /media/cdrom/VBoxLinuxAdditions.run
In case the second operation fails, you can find the compilation step logs in
If the generated kernel module fails to load, you can find the reason of such a failure with the following command:
systemctl status vboxadd.service