VirtualBox Ubuntu Guest Additions not installing : modprobe vboxsf failed
I just installed this software off virtual box, i downloaded the ISO off the official ubuntu website, was the lastest LTS.
I attempted to install Guest Additions using the 'Insert Guest Additions CD Image". Result:
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.0 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.2.0 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions
kernel modules.
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
Press Return to close this window...Inside the /var/log/vboxadd-setup.log:
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.Full version of log file can be found here [?]
37 Answers
Ok, so this is a known problem. Instead of using the image provided by virtualbox you should just download it trough aptitute sudo apt-get install virtualbox-guest-dkms and if you need the headers download this sudo apt-get install linux-headers-virtual instead of the classic sudo apt-get install linux-headers-$(uname -r).
Cheers
Edit: Changed the {} for () as pointed by @Abdelouahab.
open the terminal and run sudo reboot.
then try to install again via devices -> Insert Guest Additions CD Image.
worked for me.
2in Ubuntu 16.04 I had to reboot the O.S. before installing virtualbox-guest-additions in order to load the correct kernel
1A similar problem can occur with VirtualBox 5.2.18 and Linux guests, including Fedora 28, that are running kernel 4.18: Building the Guest Additions will fail with the same error message, "modprobe vboxsf failed", and no vboxsf module output to the /lib/modules folder.
The solution (for now) is to download and install the latest development snapshot of the Guest Additions, version 5.2.97, as explained in a ticket on the VirtualBox site.
The symptom is messages like these appearing in one of the log files written to /var/log by the build process:
/tmp/vbox.0/utils.c: In function ‘sf_init_inode’:
/tmp/vbox.0/utils.c:165:28: error: passing argument 1 of ‘sf_ftime_from_timespec’ from incompatible pointer type [-Werror=incompatible-pointer-types] sf_ftime_from_timespec(&inode->i_atime, &info->AccessTime); ^~~~~~~~~~~~~~~
/tmp/vbox.0/utils.c:53:53: note: expected ‘struct timespec *’ but argument is of type ‘struct timespec64 *’ static void sf_ftime_from_timespec(struct timespec *tv, RTTIMESPEC *ts)Note the build process can output multiple log files, which means looking at only the latest one (as the message it outputs suggests) is not a reliable way of diagnosing problems. In my case, trying to install the Guest Additions on a headless Fedora server failed with /var/log/vboxadd-setup.log containing only the line
Could not find the X.Org or XFree86 Window System, skipping.The key was to examine the file /var/log/vboxadd-setup.log.1, generated at the same time, which contained the actual error messages from the build, shown above.
1Ubuntu 16.04.
In the comments to the question there are a bit confusing but useful links.
Same exact problem solved by purging 5.2.8 and installing 5.1.34_Ubuntu r121010 from repo:
$ grep virtualbox /etc/apt/sources.list
deb xenial contribInstallation of guest additions completed without "VirtualBox Guest Additions: modprobe vboxsf failed" error.
sudo purge virtualbox*
sudo apt-add-repository "deb $(lsb_release -sc) contrib"
wget -q -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualboxThanks to Justin for the link but had to use
sudo apt-get install VirtualBoxrather than
sudo apt-get install VirtualBox-* cause the last one gave me a whole mess of tricky unmet dependencies.
I just downloaded today the Ubuntu 16.04 ISO file and installed it. I also have the latest VirtualBox version.
Trying to install the Guest Additions, I faced the error mentioned originally.
I just did what others said before... with the guest additions ISO still inserted on the VM, I ran:
sudo rebootAfter logging in again, I went to the ISO folder:
/media/<ubuntu_username>/VBox_GAs_5.2.8Then I executed:
sudo ./autorun.shThe installation finalized without issues.
I ran into this problem both on Ubuntu & Windows host (Lubuntu Guest), and in both cases, this is what I did.
- Unmount the guest additions CD
- Shut down virtual machine.
- Download the appropriate guest additions CD from Virtualbox website. In my case, it was 5.2 Link:
- Go to settings>Storage, and under "controller: ID" option, add an optical drive with the guest additions CD
- Reboot your virtual machine.
- Once the machine is booted, click Devices>Insert Guest Additions CD image
- Cd to the optical drive /media/username/VBox_GAs_5.2
- Run sudo sh ./VBoxLinuxAdditions.run