我已将Vagrant配置为使用Rsync共享文件夹,而不是默认情况下由VirtualBox提供的(令人难以置信的SLOW)vBoxsf文件系统:
Vagrant.configure("2") do |config| config.vm.synced_folder ".","/vagrant",type: "rsync",rsync__args: ["--verbose","--archive","-z"] end
显然,有更多配置,但我发现这些指令here,它们通常在从主机到访客同步.
但是,我需要guest虚拟机能够同步回主机,因为我的一些构建工具仅安装在guest虚拟机上.如何在共享文件夹中双向同步?
解决方法
很不幸的是,不行,
引自 documentation:
引自 documentation:
The rsync synced folder does a one-time one-way sync from the machine running to the machine being started by Vagrant.
所以最好使用NFS(如果使用Windows主机,则为SMB)
In some cases the default shared folder implementations (such as VirtualBox shared folders) have high performance penalties. If you're seeing less than ideal performance with synced folders,