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

Comments

Projects
None yet
@Symmetric

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

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Apr 24, 2013

Member

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.

Member

mitchellh commented Apr 24, 2013

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.

@mitchellh mitchellh closed this Apr 24, 2013

@Symmetric

This comment has been minimized.

Show comment
Hide comment
@Symmetric

Symmetric Apr 25, 2013

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.

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

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Apr 25, 2013

Member

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

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

Member

mitchellh commented Apr 25, 2013

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

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

@marsmensch

This comment has been minimized.

Show comment
Hide comment
@marsmensch

marsmensch Apr 25, 2013

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

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

@mitchellh

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh Apr 25, 2013

Member

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

Member

mitchellh commented Apr 25, 2013

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

@cournape

This comment has been minimized.

Show comment
Hide comment
@cournape

cournape Jun 11, 2013

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 ?

Contributor

cournape commented Jun 11, 2013

@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

This comment has been minimized.

Show comment
Hide comment
@cournape

cournape Jun 11, 2013

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

Contributor

cournape commented Jun 11, 2013

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

@chao787

This comment has been minimized.

Show comment
Hide comment
@chao787

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

chao787 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

This comment has been minimized.

Show comment
Hide comment
@cournape

cournape Jun 18, 2013

Contributor

reverting to 1.2.1 is the simple solution, yes

Contributor

cournape commented Jun 18, 2013

reverting to 1.2.1 is the simple solution, yes

@cournape

This comment has been minimized.

Show comment
Hide comment
@cournape

cournape Jun 18, 2013

Contributor

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

Contributor

cournape commented Jun 18, 2013

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

@lenciel

This comment has been minimized.

Show comment
Hide comment
@lenciel

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

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

This comment has been minimized.

Show comment
Hide comment
@devinus

devinus 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

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

This comment has been minimized.

Show comment
Hide comment
@lenciel

lenciel Jul 9, 2013

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

lenciel commented Jul 9, 2013

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

@zvineyard

This comment has been minimized.

Show comment
Hide comment
@zvineyard

zvineyard Jan 13, 2014

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.

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

This comment has been minimized.

Show comment
Hide comment
@oakfire

oakfire Mar 4, 2014

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

oakfire commented Mar 4, 2014

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

@tmatilai

This comment has been minimized.

Show comment
Hide comment
@tmatilai

tmatilai Mar 4, 2014

Collaborator

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

Collaborator

tmatilai commented Mar 4, 2014

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

@adityaU

This comment has been minimized.

Show comment
Hide comment
@adityaU

adityaU 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

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

This comment has been minimized.

Show comment
Hide comment
@tmatilai

tmatilai Oct 19, 2014

Collaborator

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

Collaborator

tmatilai commented Oct 19, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@ajford

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

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

This comment has been minimized.

Show comment
Hide comment
@fletchowns

fletchowns Nov 5, 2014

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

This comment has been minimized.

Show comment
Hide comment
@richcave

richcave Nov 18, 2014

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

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

This comment has been minimized.

Show comment
Hide comment
@lielran

lielran Dec 7, 2014

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

lielran commented Dec 7, 2014

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

@tspayde

This comment has been minimized.

Show comment
Hide comment
@tspayde

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

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

This comment has been minimized.

Show comment
Hide comment
@boie0025

boie0025 Jan 29, 2015

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.

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

This comment has been minimized.

Show comment
Hide comment
@marsmensch

marsmensch Jan 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@boie0025

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

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!

@premyslruzickajr

This comment has been minimized.

Show comment
Hide comment
@premyslruzickajr

premyslruzickajr Mar 2, 2015

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

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

This comment has been minimized.

Show comment
Hide comment
@Jeremlicious

Jeremlicious Mar 18, 2015

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

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

@kalyankix

This comment has been minimized.

Show comment
Hide comment
@kalyankix

kalyankix Mar 18, 2015

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

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

This comment has been minimized.

Show comment
Hide comment
@pulber

pulber Jul 12, 2015

@premyslruzickajr thanks, it worked (centos 6.5)

pulber commented Jul 12, 2015

@premyslruzickajr thanks, it worked (centos 6.5)

@dgoguerra

This comment has been minimized.

Show comment
Hide comment
@dgoguerra

dgoguerra Jul 13, 2015

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

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

@rgeraldporter

This comment has been minimized.

Show comment
Hide comment
@rgeraldporter

rgeraldporter Mar 23, 2016

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

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 join this conversation on GitHub. Already have an account? Sign in to comment