有多个同步文件夹的流浪汉

use*_*289 27 vagrant

是否可以在vagrantfile中设置多个sync'd文件夹?这是我当前的配置(使用vaprobash):

# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant/Sites",
          id: "core",
          :nfs => true,
          :mount_options => ['nolock,vers=3,udp,noatime']

# Use NFS for the shared folder
config.vm.synced_folder "../Code", "/vagrant/Code",
          id: "core",
          :nfs => true,
          :mount_options => ['nolock,vers=3,udp,noatime']
Run Code Online (Sandbox Code Playgroud)

只有第二个映射被加载,另一个被忽略 - 所以我最终得到了一个/vagrant/Code正确映射的目录,但没有vagrant/Sites

use*_*289 49

我只需要为每个安装设置一个唯一的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']
Run Code Online (Sandbox Code Playgroud)