Vagrant Synced Folders Not Working Real-Time on Virtualbox

vagrant synced folders not working real-time on virtualbox

The owner of the box has enabled rsync by default on the sync type. If you look at Vagrantfile of your box (in my case its ~/.vagrant.d/boxes/centos-VAGRANTSLASH-7/0/vmware_fusion but yours might probably under the virtualbox provider) you'll see a Vagrantfile with content

Vagrant.configure("2") do |config|
config.vm.synced_folder ".", "/vagrant", type: "rsync"
end

Just remove this file from the box directory and it will work.

note if you plan to use nfs you can change the sync type in your Vagrantfile

Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", ip: "192.168.88.88"
config.vm.hostname = "my.centos.dev"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
end

Synced folder in vagrant is not syncing in realtime

In your Vagrantfile the synced folder type is default vboxsf, however, in the vagrant up stdout, it is showing rsync type, I think you need to fix it in the config file.

Assume that you are using rsync type, you should have the following in your Vagrantfile

Vagrant.configure("2") do |config|
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: ".git/"
end

NOTE: By default, rsync__auto is set to true, which means rsync-auto will watch and automatically sync this folder.

Run vagrant rsync-auto and the directory should be in sync between host and guest.

Refer to vagrant docs for more information.

Sync Vagrant folder in Windows with VirtualBox

(1) config.vm.synced_folder "../../code/test2", "/synced_folder"

*from VM synced folder will be /synced_folder

(2) no

Vagrant and virtualbox synced directory: permission issues moving from windows host to linux host

Just use mount_options
https://www.vagrantup.com/docs/synced-folders/basic_usage.html#mount_options

Here you have an example how to do this.
http://jeremykendall.net/2013/08/09/vagrant-synced-folders-permissions/

Another way is to run your Websphere server as vagrant user so it will have full permissions to anything you mount as it's owner.

vagrant reload synced_folder

That hasn't been my experience with synced folders, so it's very strange that you're seeing this behavior. From the Vagrant docs...

Synced folders are automatically setup during vagrant up and vagrant reload.

I just tested it with one of my Vagrant boxes and it worked fine. I changed the local folder, did a vagrant reload, and then checked it on the box. Ditto after changing the remote folder.

Given your situation, there's an option you could try. You may be able to disable a synced folder, run vagrant reload, update and re-enable it, and then vagrant reload again. Here's how to disable a synced folder...

web.vm.synced_folder "./web/", "/srv/", disabled: true

Or you may be able to comment the line, run vagrant reload, uncomment and change it, and then vagrant reload again.

I can't vouch for these approaches because I can't reproduce your issue. It just works for me regardless.



Related Topics



Leave a reply



Submit