My host os is Mac OS X and I have experienced this on both VirtualBox 5 and later editions of the 4.3 release (installed from homebrew cask versions[0]). Trying `vagrant up` just now with a fresh Vagrantfile saying only
config.vm.box = "debian/jessie64" gives me:
==> default: Machine booted and ready!
GuestAdditions versions on your host (5.0.4) and guest (4.3.18) do not match.
The guest's platform is currently not supported, will try generic Linux method...
At the point where the default
/vagrant share is set up. It then attempts to upgrade the guest additions...
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
stdin: is not a tty
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.0.4 - guest version is 4.3.18
stdin: is not a tty
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.4 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.18 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
Building the main Guest Additions module ...fail!
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Sure enough, it fails to mount shared folders with this message:
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly.
And the contents of /var/log/vboxadd-install.log are as follows:
Uninstalling modules from DKMS
Attempting to install using DKMS
Creating symlink /var/lib/dkms/vboxguest/5.0.4/source ->
/usr/src/vboxguest-5.0.4
DKMS: add completed.
Error! Your kernel headers for kernel 3.16.0-4-amd64 cannot be found.
Please install the linux-headers-3.16.0-4-amd64 package,
or use the --kernelsourcedir option to tell DKMS where it's located
Failed to install using DKMS, attempting to install without
/tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop.
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
However, a quick `apt-get install linux-headers-3.16.0-4-amd64` (on the guest) and `vagrant reload` (on the host) enables vagrant to upgrade the guest additions itself and the shared folders are fine.