I have vagrant up. Created a centosVM with it. I have shared folders activated so I can share files and folders between my local machine and VM. Problem is that it is one way. My VM and local machine (windows 7) can view the folders and files in the shared folder but if I create a file from the VM, it does not get displayed onto the shared folder in windows and whenever I restart the VM (by vagrant destroy
or vagrant reload
) then the files that I created from the VM, gets deleted. This is my vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.4.3"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if ENV["KONG_PATH"]
source = ENV["KONG_PATH"]
else
source = "./"
end
if ENV['KONG_VB_MEM']
memory = ENV["KONG_VB_MEM"]
else
memory = 2048
end
if ENV["KONG_VERSION"]
version = ENV["KONG_VERSION"]
else
version = "0.7.0"
end
config.vm.provider :virtualbox do |vb|
vb.name = "vagrant_kongDEBUG"
vb.memory = memory
end
config.vm.box = "centos/7"
config.vm.synced_folder ".", "/tmp", type: "rsync"
config.vm.network :forwarded_port, guest: 8000, host: 8000
config.vm.network :forwarded_port, guest: 8001, host: 8001
config.vm.network :forwarded_port, guest: 8443, host: 8443
config.vm.provision "shell", inline: "cd /tmp"
config.vm.provision "shell", inline: "ls -l"
config.vm.provision "shell", path: "provision.sh", :args => version
end
You're using rsync mechanism for your shared folder and it implies
You can force the refresh of a shared folder :
so just run a
vagrant rsync
when you need to refresh the content of your shared folder or use thevagrant rsync-auto