Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'vagrant up' fails to mount linked directory /vagrant #1657

Closed
Symmetric opened this issue Apr 24, 2013 · 32 comments
Closed

'vagrant up' fails to mount linked directory /vagrant #1657

Symmetric opened this issue Apr 24, 2013 · 32 comments

Comments

@Symmetric
Copy link

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.

@mitchellh
Copy link
Contributor

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.

@Symmetric
Copy link
Author

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.

@mitchellh
Copy link
Contributor

@Symmetric VMware Workstation support is basically ready, and shipping any day now.

VMware Player is not possible to support due to missing features. :(

@marsmensch
Copy link

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 notifications@github.com:

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//issues/1657#issuecomment-16980650
.

@mitchellh
Copy link
Contributor

@marsmensch I was just answering @Symmetric's direct question.

@cournape
Copy link
Contributor

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

@cournape
Copy link
Contributor

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

@ghost
Copy link

ghost commented Jun 15, 2013

Closed? Is this bug fixed? I meet the same problem. How to solve this problem now? Back to use vagrant 1.2.1?

@cournape
Copy link
Contributor

reverting to 1.2.1 is the simple solution, yes

@cournape
Copy link
Contributor

In any case, that has nothing to do with virtualbox itself

@lenciel
Copy link

lenciel commented Jul 8, 2013

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.

@devinus
Copy link

devinus commented Jul 8, 2013

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

https://github.com/dotless-de/vagrant-vbguest

@lenciel
Copy link

lenciel commented Jul 9, 2013

@devius thanks for your information, I'm using vagrant-vbguest now.

@zvineyard
Copy link

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.

@oakfire
Copy link

oakfire commented Mar 4, 2014

After I installed linux kernal 3.8 image and headers for Docker, I had the same error.

@tmatilai
Copy link
Contributor

tmatilai commented Mar 4, 2014

@oakfire if you update the kernel, you have to reinstall the guest additions.

@adityaU
Copy link

adityaU commented Oct 19, 2014

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

@tmatilai
Copy link
Contributor

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

@ajford
Copy link

ajford commented Oct 23, 2014

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.

@fletchowns
Copy link

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.

@richcave
Copy link

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

@lielran
Copy link

lielran commented Dec 7, 2014

same thing with CentOS7.0 x86_64 minimal (VirtualBoxGuestAddtions 4.3.14)
and Vagrant 1.6.5

@tspayde
Copy link

tspayde commented Dec 17, 2014

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.

@boie0025
Copy link

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.

@marsmensch
Copy link

@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

@boie0025
Copy link

boie0025 commented Feb 2, 2015

@marsmensch -- Excellent! if I do that along with updating all non-kernel packages, I can restart perfectly. Thank you for the tip!

@premyslruzicka
Copy link

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

@lecajer
Copy link

lecajer commented Mar 18, 2015

thanks @lenciel `sudo /etc/init.d/vboxadd setup' worked for me

@kalyankix
Copy link

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

@pulber
Copy link

pulber commented Jul 12, 2015

@premyslruzickajr thanks, it worked (centos 6.5)

@dgoguerra
Copy link

@premyslruzickajr's solution worked for me too, CentOS 6.6. Thanks!

@rgeraldporter
Copy link

works on CentOS 6.7! Also had to updated Virtual Box and vagrant, and run through the fix noted here as well: #3341 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests