I've been slapping the VM about a bit (starting and stopping in VBox as well as vagrant halt, to try and get USB drivers installed), and it appears to have got into a bad state.
When I run vagrant up, I get the following error:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant
[31mThe following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant[0m
I've repro'd this with debug logs enabled; a gist of the output is here.
Given the debug output, specifically this DEBUG ssh: stderr: /sbin/mount.vboxsf: mounting failed with the error: No such device, it looks like this is a VirtualBox issue. The "showvminfo" output shows that the shared folder SUPPOSEDLY exists, but then when I mount virtualbox says it doesn't.
VirtualBox doesn't really like being slapped around a lot, it gets finicky. :( Sad.
I've opened a VBox ticket: https://www.virtualbox.org/ticket/11751.
@mitchellh, seems like virtualbox is very flakey, is there any plan/possibility to replace with VMWare player? Must be a pain to keep getting issues for that project.
@Symmetric VMware Workstation support is basically ready, and shipping any day now.
VMware Player is not possible to support due to missing features. :(
This is an issue tracker. Put this nonsense elsewhere. VBox works for many
of us. Nobody wants a _replacement_ with VMWare Player.
Am 25.04.2013 um 02:16 schrieb Paul Tiplady [email protected]:
I've opened a VBox ticket: https://www.virtualbox.org/ticket/11751.
@mitchellh https://github.com/mitchellh, seems like virtualbox is very
flakey, is there any plan/possibility to replace with VMWare player? Must
be a pain to keep getting issues for that project.
—
Reply to this email directly or view it on
GitHubhttps://github.com/mitchellh/vagrant/issues/1657#issuecomment-16980650
.
@marsmensch I was just answering @Symmetric's direct question.
@mitchellh this actually looks like a vagrant bug: the mount command does not match the shared folder set up in virtualbox (/vagrant vs vagrant). The following works for me (inside the VM) -- note the vagrant vs /vagrant:
sudo mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
Isn't this just a consequence of the shared folder id removal in vagrant ?
Looking more into this: the shared folder name was changed form /vagrant to vagrant inside virtualbox, and reverting to vagrant 1.2.1 solves this (vagrant 1.2.2 has the issue).
Closed? Is this bug fixed? I meet the same problem. How to solve this problem now? Back to use vagrant 1.2.1?
reverting to 1.2.1 is the simple solution, yes
In any case, that has nothing to do with virtualbox itself
This is usually a result of the guest’s package manager upgrading the kernel without rebuilding the VirtualBox Guest Additions. Ran sudo /etc/init.d/vboxadd setup on the guest solved this problem for me.
@lenciel That's exactly what it was in my case. I'm using salty-vagrant, and a package installation upgraded my kernel. I was pointed to this great plugin for keeping your VBox guest additions up to date:
@devius thanks for your information, I'm using vagrant-vbguest now.
I had this same exact error while trying to build a SLES 11 guest on a MacOS host. I updated to Vagrant 1.4.3 and my share folders mounted and the errors went away.
After I installed linux kernal 3.8 image and headers for Docker, I had the same error.
@oakfire if you update the kernel, you have to reinstall the guest additions.
closed? I am getting same error with Vagrant 1.6.5 on OSX v10.10
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
The error output from the last command was:
/sbin/mount.vboxsf: mounting failed with the error: No such device
@adityaU Your box doesn't seem to have the VirtualBox Guest Additions installed or they fail to load. So it seems like a box (or VirtualBox) issue. Which VirtualBox version do you have? Where is the box from? What guest addition version does it use?
I'm getting the same problem with Vagrant 1.6.5 on a Debian Wheezy host. Virtualbox 4.3.18, installed from the Virtualbox debian repos.
I'm using a CentOS guest based off box-cutter/centos64-i386 out of VagrantCloud.
As far as I can tell, the box image I'm using has 4.3.16 built in, but is in the process of updating to 4.3.18. It fails then, and results in my problem.
I've put my vagrantfile and the output of the vagrant up command into a gist: https://gist.github.com/0c8ade2e352f446ae27c.git
EDIT: I ran vagrant box update and that seemed to fix the problem. New version of the box uses 4.3.18 "out of the box" and doesn't have the same problem.
I also ran into this when using opscode_centos-6.5_chef-provisionerless.box from https://github.com/opscode/bento in conjunction with https://github.com/dotless-de/vagrant-vbguest. I uninstalled vagrant-vbguest to get around it.
I encountered the same mount error but it was caused by VBoxGuestAdditions not able to find the kernel-devel package. Maybe this will help somebody...
On vagrant up :
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.
The missing package can be probably installed with
yum install kernel-devel-2.6.32-358.23.2.el6.x86_64
Building the main Guest Additions module[FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
/var/log/vboxadd-install.log had
/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.
I installed the appropriate kernel-devel package with rpm and the mount errors disappeared.
sudo rpm -Uvh kernel-devel-2.6.32-358.23.2.el6.x86_64.rpm
same thing with CentOS7.0 x86_64 minimal (VirtualBoxGuestAddtions 4.3.14)
and Vagrant 1.6.5
I am having similar issues with Vagrant 1.7.1. I have a CentOS 7 .box image I created using Packer. I first create a RAW image (just the minimal install from a mirror). I then create a base install that includes installing of the vagrant tools and a few other misc. commands. I then create a dev image. This is where things go wrong.
I have yet to determine what exactly causes the problem, but it seems to happen during the dev Packer build. I am doing a yum update and also installing docker. If I omit the yum update then I do not get this problem when doing vagrant up with the image, but if I include the yum update I get this exact error when I try to do a vagrant up.
This of course leads me to believe one of the packages being updated by yum is causing this I just do not know which one. There are about 135 packages that get updated.
Hope this helps at least a little.
For anyone else who comes across this using CentOS 7 -- I was getting the same issue with Vagrant 1.7.2, and this box: 'chef/centos-7.0'.
I can confirm what @tspayde says. I can reload with the proper mounts until I run yum update. After running yum update I can no longer mount the shared folders.
@boie0025 does it work again after a reboot?
from my past experience it works flawless if you make sure that there is always a current version of the kernel-devel-* and kernel-headers-* packages installed.
yum install kernel-devel-$(uname -r)
yum install kernel-headers-$(uname -r)
yum install dkms
@marsmensch -- Excellent! if I do that along with updating all non-kernel packages, I can restart perfectly. Thank you for the tip!
I had this problem on CentOS 7 after running yum update. I ran @marsmensch's commands but it didn't work untill I rebuilt VirtualBox Additions with @lenciel's tip /etc/init.d/vboxadd setup. Thanks to both!
yum update -y
yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) dkms -y
/etc/init.d/vboxadd setup
thanks @lenciel `sudo /etc/init.d/vboxadd setup' worked for me
I did an yum update after downloading centos7 minimal box that installed kernel-devel as suggested by @premyslruzickajr , and ran vboxadd setup, followed by vagrant reload. Shared folders worked like a charm!! Thanks @premyslruzickajr and @Jeremlicious
@premyslruzickajr thanks, it worked (centos 6.5)
@premyslruzickajr's solution worked for me too, CentOS 6.6. Thanks!
works on CentOS 6.7! Also had to updated Virtual Box and vagrant, and run through the fix noted here as well: https://github.com/mitchellh/vagrant/issues/3341#issuecomment-39015570
Most helpful comment
This is usually a result of the guest’s package manager upgrading the kernel without rebuilding the VirtualBox Guest Additions. Ran
sudo /etc/init.d/vboxadd setupon the guest solved this problem for me.