Synced folder in vagrant is not syncing in realtime

前端 未结 1 407
滥情空心
滥情空心 2021-01-31 03:37

I am setting up a synced folder in a vagrant machine like shown in cmd dump below and expect that whenever I update the files in this folder on the host machine the updates will

相关标签:
1条回答
  • 2021-01-31 04:11

    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.

    0 讨论(0)
提交回复
热议问题