在Vagrant中挂载网络共享文件夹

时间:2016-06-14 15:30:29

标签: windows vagrant directory share

我想将公司网络中共享的(连接)文件夹挂载到我的Vagrant机器上。

我有什么:

  • 包含安装文件(.exe)并在公司网络中共享的文件夹;
  • 基于Windows(8.1)Vagrant机器。

我尝试了NFSRsyncSMB选项 - 没有任何效果。

以下是我拥有的Vagrant文​​件的一部分:

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  config.vm.synced_folder "V:\Dev\Ort Sys\Releases\Daily Build\Rel 2015\x64", "\share", type: "nfs"

请帮我解决我的问题。感谢。

1 个答案:

答案 0 :(得分:0)

实际上,我解决了这个问题。您需要做的就是做上面的Vagrant评论中的内容

  

第一个参数是主机到实际文件夹的路径。该   第二个参数是guest虚拟机挂载文件夹的路径。而且   可选的第三个参数是一组非必需的选项。

我使用PowerShell脚本和此命令绕过了这个:

 New-PSDrive –Name “B” –PSProvider FileSystem –Root “\\name\of\the\folder\which\I need to mount” –Persist