What would cause a Vagrant shared folder to silently unmount?

210 views
Skip to first unread message

David Karr

unread,
May 20, 2016, 5:16:51 PM5/20/16
to Vagrant
I've been going through a Puppet book for a couple weeks ("Learning Puppet 4"), which uses Vagrant to set up the VMs.  I've had the VMs running pretty continuously for a while, with no symptoms.  I used the default "shared folder" connection quite often to transfer files back and forth.

Today I noticed that the "/vagrant" path was empty.  I found that confusing.  I saw no indication that the shared folder mount had gone away.  I checked the config of the VM in VirtualBox, and it still specified the shared folder.  I checked the Vagrant docs and confirmed that there's no indication it would go away.

I ended up just shutting down the VM and restarting it with "vagrant halt" and "vagrant up", and my shared folder was back.

Why would the shared folder have silently unmounted itself?  Anything I should look for for more information about this?

Alvaro Miranda Aguilera

unread,
May 22, 2016, 6:08:08 PM5/22/16
to vagra...@googlegroups.com
Hello,

the shared folders are mounted by vagrant manually, so if during those puppet provision a reboot happen that may explain why the mountpoint are gone.

Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/3b7f6ff6-daf3-4d51-8990-9199ec68f17a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David M. Karr

unread,
May 22, 2016, 7:21:10 PM5/22/16
to vagra...@googlegroups.com
On 05/22/2016 03:08 PM, Alvaro Miranda Aguilera wrote:
Hello,

the shared folders are mounted by vagrant manually, so if during those puppet provision a reboot happen that may explain why the mountpoint are gone.

And I'm guessing that you mean that Vagrant mounts the folders only when it creates the VMs, so if I did "vagrant up" initially, which created everything, including the mounts, and then did "vagrant halt" and then "vagrant up", and "vagrant ssh", then the mounts would not be present?

As this is just an exercise from a book, it doesn't really matter what I do to reestablish the mounts, but are there any conventional mechanisms in Vagrant that will make it easier to remount them on restart?

I suppose I could do this as a Puppet exercise, as that's what I'm using this for.
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/-2b5yCdoecI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewf95y4K%2BQ6_UwVBhY2TB911HZWJyiLLaeOtV5KNQ4O5w%40mail.gmail.com.

Alvaro Miranda Aguilera

unread,
May 22, 2016, 7:54:21 PM5/22/16
to vagra...@googlegroups.com
Hello,

Vagrant up will create the VM the first time, from there will just start if already exists.

Vagrant up is what will mount the shared folders, so if for any reason a reboot happen that will explain the mount points are gone.

if you do, vagrant halt and vagrant up, the mount point should be there.


if you would like to remount the mount points.

type:

mount -t vboxsf

that will display the name of the device being mounted, that you can use to create the mount command.

Alvaro.

David Karr

unread,
May 22, 2016, 8:13:48 PM5/22/16
to Vagrant


On Sunday, May 22, 2016 at 4:54:21 PM UTC-7, Alvaro Miranda Aguilera wrote:
Hello,

Vagrant up will create the VM the first time, from there will just start if already exists.

Vagrant up is what will mount the shared folders, so if for any reason a reboot happen that will explain the mount points are gone.

Oh, I see.  If I did "sudo reboot" (or some other path that results in the VM "self-rebooting" outside of the control of Vagrant) from within the VM, it would come back up without the shared folders, but if I brought it down (however I did that) and brought it back up with "vagrant up", that would remount the shared folder(s).

Got it.

The other thing that I'm curious about, which is sort of a small tangent from the original question, but where in the configuration do I specify the shared folder configuration?  I see in the docs the use of the "config.vm.synced_folder" option, but I don't see that in the VagrantFile I'm using.  The original source is at https://github.com/jorhett/learning-puppet4 . Does perhaps Vagrant create this source folder mapping (location of VagrantFile to "/vagrant") by default without having to specify it?

Alvaro Miranda Aguilera

unread,
May 22, 2016, 8:24:18 PM5/22/16
to vagra...@googlegroups.com
Hello,

Vagrantfile is the minimal set of configuration, think of it as an starting point.

the minimum you need is config.vm.box

That will include by default current directory mounted in the vm as /vagrant

from there you can disable that or add more.

Alvaro.


Reply all
Reply to author
Forward
0 new messages