Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vagrant 多重同步的流浪者';d文件夹_Vagrant - Fatal编程技术网

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']