Vagrant 多重同步的流浪者';d文件夹
是否可以在一个文件中设置多个同步文件夹?这是我当前的配置(使用Vagrant 多重同步的流浪者';d文件夹,vagrant,Vagrant,是否可以在一个文件中设置多个同步文件夹?这是我当前的配置(使用vaprobash): 只有第二个映射被加载,另一个被忽略——因此我最终得到了一个正确映射的/vagrant/code目录,但没有vagrant/Sites2021更新: 在2021年,无需使用唯一Id或成为nfs,只需列出您的同步文件夹: config.vm.synced_文件夹“,”/vagrant/Sites” config.vm.synced_文件夹“./Code”、“/vagrant/Code” 原始答案: 我只需要为每
vaprobash
):
只有第二个映射被加载,另一个被忽略——因此我最终得到了一个正确映射的
/vagrant/code
目录,但没有vagrant/Sites
2021更新:
在2021年,无需使用唯一Id或成为nfs
,只需列出您的同步文件夹:
config.vm.synced_文件夹“,”/vagrant/Sites”
config.vm.synced_文件夹“./Code”、“/vagrant/Code”
原始答案: 我只需要为每个挂载设置一个唯一的ID,然后重新加载“流浪者”框
# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant/Sites",
id: "sites", # <--- this ID must be unique
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
# Use NFS for the shared folder
config.vm.synced_folder "../Code", "/vagrant/Code",
id: "code", # <--- different from this one
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
#将NFS用于共享文件夹
config.vm.synced_文件夹“,”/vagrant/Sites“,
id:“站点”#正确,
:mount_options=>['nolock,vers=3,udp,noatime']
#对共享文件夹使用NFS
config.vm.synced_文件夹“./Code”、“/vagrant/Code”,
id:“代码”#正确,
:mount_options=>['nolock,vers=3,udp,noatime']
# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant/Sites",
id: "sites", # <--- this ID must be unique
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
# Use NFS for the shared folder
config.vm.synced_folder "../Code", "/vagrant/Code",
id: "code", # <--- different from this one
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']