[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: linux-headers should be installed on the vagrant base boxes

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 ->

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.

> I think you mean the debian-cloud pseudo package.

Apologies, I do mean that. However, as you can see[1], there is no result for that either.

[0] https://github.com/caskroom/homebrew-versions/tree/master/Casks
[1] https://bugs.debian.org/cgi-bin/pkgreport.cgi?package=debian-cloud

Joshua David Stauter
Triangle Square Circle
(646) 543-3243

On Mon, Sep 14, 2015 at 10:09 AM, Emmanuel Kasper <emmanuel@libera.cc> wrote:
On 09/11/2015 10:56 PM, Joshua Stauter wrote:
> Hello all
> I have been working with the images on atlas[0] and a not insignificant
> pain point is that whenever you rebuild a box you have to manually go in
> (outside of vagrant) and install the appropriate linux-headers-$(uname -r)
> package in order for dkms and ultimately for VBoxGuestAdditions to fully
> work. (If there is a version mismatch shared folders do not work, for
> example).

Hello Joshuah
As I am currently building the vagrant base boxes on Debian stable, I am
using 4.3.18 as the virtualbox guests addition version.

Which version of Virtualbox are you using on your host ?
Last time I checked with vbox host version > vbox guest version, folder
sharing was working, albeit with a warning from Vagrant.

> I also attempted to list this issue in the debian bug tracker[1] but was
> unable to find the "vagrant-cloud" package the atlas page instructed me to
> use.

I think you mean the debian-cloud pseudo package.


Reply to: