synced folders are NOT automaticaly setup during vagrant reload w/o --provision flag

18 views
Skip to first unread message

Victor Vitayaudom

unread,
Oct 10, 2018, 5:12:36 PM10/10/18
to Vagrant
https://www.vagrantup.com/docs/synced-folders/basic_usage.html#enabling

Synced folders are automatically setup during vagrant up and vagrant reload


https://www.virtualbox.org/ticket/14374 occasionally occurs, where a vagrant reload is needed to recover network access.
However an important sync folder is no longer mounted without using the --provision flag for vagrant to reload.
This means everything vagrant needs to destroyed and recreate each time a network hiccups occurs inside vagrant. Outside vagrant is fine.

[vagrant@hashistack-dev ~]$ ping -c 1 www.vagrantup.com
ping: www.vagrantup.com: Name or service not known

Using

  1. We need to use the vagrant-vbguest plugin to mount /projects because we are using centos/7 to be near-like production instead of bento
  2. Docker for Windows does not play well with Virtual box, so we circumvent installation and disable Hypervisor-V.
  3. We then setup vagrant environment for developers with docker and other hashicorp tools.
  4. /projects is an important  ../. mounted sync folder representing the common parent for developer setup to work in/outside of vagrant.
  5. Vagrantfile below

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.box_version = "1809.01"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "2048"
    config.vm.synced_folder ".", "/vagrant", disabled: false          # a RSYNC snapshot
    config.vm.synced_folder "../", "/projects", type: 'virtualbox'    # a MOUNT for developer to work natively on other projects where this directory is a developer setup
  end
  config.vm.provision "shell", inline: "echo I like my sugar with coffee and cream"
end

Alvaro Miranda Aguilera

unread,
Oct 15, 2018, 2:27:50 AM10/15/18
to vagra...@googlegroups.com
Hello

it seems you are requirent few features on top of the previous one that is giving some issues.

why not create your own box so you can control the whole experience?

if everything can run nicely without vagrant, say you build a VM guest with virtualbox, put docker, shared folder works in the way you want, then vagrant can automate that.

Vagrant is just a wrapper arounnd virtualbox/vm/scrips.

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/71081c21-d26c-4424-83e8-c25ea83d5058%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages