vagrant up fails to mount /vagrant
Closed this issue · 3 comments
I cloned this repository, and then ran vagrant up
, and I'm getting:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'litaio/development-environment' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'litaio/development-environment'
default: URL: https://vagrantcloud.com/litaio/development-environment
==> default: Adding box 'litaio/development-environment' (v1.0.0) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/litaio/boxes/development-environment/versions/1.0.0/providers/virtualbox.box
==> default: Successfully added box 'litaio/development-environment' (v1.0.0) for 'virtualbox'!
==> default: Importing base box 'litaio/development-environment'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'litaio/development-environment' is up to date...
==> default: Setting the name of the VM: development-environment_default_1417914720823_78745
==> default: Pruning invalid NFS exports. Administrator privileges will be required...
Password:
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8080 => 8080 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> 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: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Mounting shared folders...
default: /vagrant => /Users/technicalpickles/litaio/development-environment
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. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
I tried vagrant halt
and then vagrant up
again, to the same effect. I'm running vagrant 1.6.3 and virtualbox 4.3.18.
Some googling lead me to hashicorp/vagrant#1657, which indicates a problem with the virtualbox guest additoins. I tried running sudo /etc/init.d/vboxadd setup
as suggested in hashicorp/vagrant#1657 (comment) but that fails too:
vagrant@lita-dev:~$ sudo /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The gcc utility was not found. If the following module compilation fails then
this could be the reason and you should try installing it.
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)
Doing non-kernel setup of the Guest Additions ...done.
Here's the content of t /var/log/vboxadd-install.log:
/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.
I tried to sudo apt-get install linux-headers-3.13.0-37-generic
, but then /etc/init.d/vboxadd setup
fails with a different error:
grep: /lib/modules/3.13.0-37-generic/build/include/linux/version.h: No such file or directory
make KBUILD_VERBOSE=1 CONFIG_MODULE_SIG= -C /lib/modules/3.13.0-37-generic/build SUBDIRS=/tmp/vbox.0 SRCROOT=/tmp/vbox.0 modules
/usr/src/linux-headers-3.13.0-37-generic/arch/x86/Makefile:98: stack protector enabled but no compiler support
/usr/src/linux-headers-3.13.0-37-generic/arch/x86/Makefile:113: CONFIG_X86_X32 enabled but no binutils support
make[1]: gcc: Command not found
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)
mkdir -p /tmp/vbox.0/.tmp_versions ; rm -f /tmp/vbox.0/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/vbox.0
gcc -Wp,-MD,/tmp/vbox.0/.VBoxGuest-linux.o.d -nostdinc -isystem -I/usr/src/linux-headers-3.13.0-37-generic/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/usr/src/linux-headers-3.13.0-37-generic/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-headers-3.13.0-37-generic/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-headers-3.13.0-37-generic/include/linux/kconfig.h -Iubuntu/include -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mno-red-zone -mcmodel=kernel -maccumulate-outgoing-args -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wno-declaration-after-statement -include /tmp/vbox.0/include/VBox/VBoxGuestMangling.h -I/lib/modules/3.13.0-37-generic/build/include -I/tmp/vbox.0/ -I/tmp/vbox.0/include -I/tmp/vbox.0/r0drv/linux -I/tmp/vbox.0/vboxguest/ -I/tmp/vbox.0/vboxguest/include -I/tmp/vbox.0/vboxguest/r0drv/linux -D__KERNEL__ -DMODULE -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(VBoxGuest_linux)" -D"KBUILD_MODNAME=KBUILD_STR(vboxguest)" -c -o /tmp/vbox.0/.tmp_VBoxGuest-linux.o /tmp/vbox.0/VBoxGuest-linux.c
/bin/sh: 1: gcc: not found
make[2]: *** [/tmp/vbox.0/VBoxGuest-linux.o] Error 127
make[1]: *** [_module_/tmp/vbox.0] Error 2
make: *** [vboxguest] Error 2
Creating user for the Guest Additions.
Creating udev rule for the Guest Additions kernel module.
That made it look like gcc was missing, so installed that with sudo apt-get install gcc
. It also was weird it wasn't able to find version.h
. After installing gcc, it seemed to succeed:
vagrant@lita-dev:~$ sudo /etc/init.d/vboxadd setup
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 ...done.
Building the shared folder support module ...done.
Building the OpenGL support module ...done.
Doing non-kernel setup of the Guest Additions ...done.
Starting the VirtualBox Guest Additions ...done.
I did another vagrant halt
and vagrant up
and it seemed to work ✨
What a pain. I've found that just install the vagrant-vbguest
Vagrant plugin takes care of the nonsense around version differences of the VirtualBox guest additions when you're running a newer version of VB than the box was built with.
For the long term, I'm planning to move this project to use Docker instead of Vagrant.