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

synced folders not mounting after vagrant reload #7695

Closed
dknell opened this issue Aug 9, 2016 · 16 comments
Closed

synced folders not mounting after vagrant reload #7695

dknell opened this issue Aug 9, 2016 · 16 comments
Assignees
Milestone

Comments

@dknell
Copy link

dknell commented Aug 9, 2016

I realize this has been reported before, but the issue still exists. After vagrant reload (or vagrant halt and then vagrant up) the synced folders do not mount and displays the error below. After reading other closed issues (like 3341), it is clear that the VirtualBox Guest Additions need to be updated. In fact, I updated them to the latest 5.1.2 and ran vagrant reload and the synced folders mounted correctly.

My question is this - @mitchellh are there any plans to update the ubuntu/trusty64 box on Atlas so it has a more recent version of VirtualBox Guest Additions? Sure I can create my own box or even update the box on my vagrant instance, but if I do a vagrant destroy I have to do this all over again. Having the Atlas version updated would persist through your auto-build process so we would get OS patches and also know that VirtualBox Guest Additions works correctly with synced folder mounting.

Vagrant version

1.8.5

Host operating system

Mac OS X 10.11.5

Guest operating system

ubuntu/trusty64

Virtualbox Guest Additions Version (in ubuntu/trusty64 box)

4.3.36

Virtualbox version

5.1.2

Debug output

==> default: Mounting shared folders...
    default: /vagrant => /Users/me/Projects/test
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attemped was:

set -e
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 command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

Expected behavior

The synced folders should mount every time after vagrant reload or vagrant halt/vagrant up

Actual behavior

The synced folders don't mount after a vagrant reload

Steps to reproduce

  1. Create a simple Vagrantfile with ubuntu/trusty64 as the box and a synced folder
  2. vagrant up - the first time, the folder is mounted correctly
  3. vagrant reload - you will get the error above

References

3341

@mail2asik
Copy link

Same issue for me as well.

@Alino
Copy link

Alino commented Sep 24, 2016

+1

@ckoenig673
Copy link

+1 with Windows.
I was using Kitchen with Vagrant and I wanted to sync a folder to install some software. When the Kitchen Create process runs the sync to the folder is fine. But if I have to do a reboot the sync'd folder no longer works. What I do see is if I go in to DOS and try to navigate to the path, the folder is inaccessible. If I browse to the folder using File Explorer the sync folder comes back. Then I am able to browse via DOS. (Then I can do a converge) Not sure why but the symlink will not kick in until I open up File Explorer and browse to the path where it exists.

@chrisroberts chrisroberts added this to the 1.8 milestone Oct 3, 2016
@nmcalabroso
Copy link

I can confirm this issue on MacOS Sierra 10.12 as well. I'm running VirtualBox 5.1.8 and Vagrant 1.8.6. Folders are being mounted on the initial vagrant up but fails on next up or vagrant reload.

@richrdkng
Copy link

richrdkng commented Dec 13, 2016

+1

Same here:

  • Windows 10 x64 (v1607 - 14393.479)
  • VirtualBox 5.1.10
  • Vagrant 1.9.1
  • Guest: Ubuntu 14.04.5 LTS x64 (GuestAdditions 5.1.10)

After trying to resolve this issue unsuccessfully, I wrote a bash script to automatically remount my shared folders appropriately, so e.g.: for the default /vagrant mount:

sudo mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant

Although this solution is temporary and nothing special really, it works.

@estani
Copy link

estani commented Mar 12, 2017

Windows only

VistualBox v5.1.16 seems to not support long path prefix anymore (i.e. "\?\C:....") this inhibits the use of sync folder via vboxfs until it get fixed (and perhaps other fs as well)

The only workaround I could come up with is turning this feature off directly in vagrant code.
HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.2\lib\vagrant\util\platform.rb

--- platform.rb.orig    Sun Mar 12 11:19:15 2017
+++ platform.rb Sun Mar 12 11:09:25 2017
@@ -203,7 +203,8 @@
           return path + "\\" if path =~ /^[a-zA-Z]:\\?$/

           # Convert to UNC path
-          "\\\\?\\" + path.gsub("/", "\\")
+          path.gsub("/", "\\")
         end

         # Returns a boolean noting whether the terminal supports color.

This is not something vagrant should fix, but having a way of turning this feature off will make vagrant more robust (just in case this happens again).
When VirtualBox fixes this (just reopened ticket 14651) this workaround won't be required anymore.

Note that because of this, there is no way to share folders with paths >260 Characters in this version of VirtualBox (just downgrade to at least 5.0.16)

@DaddyOh
Copy link

DaddyOh commented Jun 12, 2017

I have this issue on mac osx El Capitan 10.11.6
Virtual Box 5.1.22
Vagrant 1.9.5
bentos/Centos-6.8 (2.3.4)

Initial vagrant up works perfectly. Vagrant up after halt or suspend does not.
only the mount of /vagrant is affected. I have other shares in the Vagrantfile that mount

@chrisroberts chrisroberts self-assigned this Jun 15, 2017
@chrisroberts
Copy link
Member

Hi there,

It looks like this has been resolved within a previously shipped version of Vagrant so I am now closing this issue. If the original issue was not fully resolved, please reopen this issue or create a new one.

Cheers!

@abhi-161994
Copy link

abhi-161994 commented Mar 20, 2018

If Anyone is Facing this issue vbox "Syncing/Mount" just enter the Vagrant ssh where the vagrant file is without vagrant up and run the command "sudo yum upgrade" dat'll Take time once it's finished exit the vagrant and hit vagrant up again.Issue will resolved. .. :)

@Bharathkumarraju
Copy link

Yes i am also facing same issue in my mac

vbox version 5.1.34r121010 and vagrant version 2.0.0

@Abhisheknanda1344463
Copy link

@Bharathkumarraju try to do which i mentioned above.

@Bharathkumarraju
Copy link

@Abhisheknanda1344463 thank you, I have removed vagrant-vbguest and ran it worked :)

@binlecode
Copy link

This shared folder mount issue is confirmed remaining in latest VirtualBox 6.0 and vagrant 2.2.2.
Hosting OS: MacOS 10.14.2.

@crantron
Copy link

This happened to me today on vagrant 2.2.4 , virtual box 6.0 , and Mac OS 10.14.3. it works the first time perfectly then after vagrant halt or reload it stops syncing.

@crantron
Copy link

I seemed to fixed this after installing the latest edition of guest additions and following this (the accepted answer) : https://superuser.com/questions/1195928/how-do-i-install-virtualbox-guest-additions-for-centos-7.

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests