2016-03-30 133 views
0

最近我已经开始使用Vagrant来设置开发环境。我已经能够使用Packer构建一个基本框,并且稍后使用powershell脚本来配置/配置VM。流浪汉 - 作为同步文件夹的网络共享?

我想安装的一些软件保存在共享驱动器上。我想在启动机器时将其作为同步文件夹安装。

我曾尝试以下:

config.vm.synced_folder "\\\\corp\\dfs", "/DFS", type: "smb" 

我试图//corp/dfs为好,但无济于事。

我提供凭据,并得到以下错误:

Exporting an SMB share failed! Details about the failure are shown 
below. Please inspect the error message and correct any problems. 

Host path: //corp/dfs 

Stderr: The syntax of this command is: 

NET SHARE 
sharename 
      sharename=drive:path [/GRANT:user,[READ | CHANGE | FULL]] 
           [/USERS:number | /UNLIMITED] 
           [/REMARK:"text"] 
           [/CACHE:Manual | Documents| Programs | BranchCache | None] 
      sharename [/USERS:number | /UNLIMITED] 
        [/REMARK:"text"] 
        [/CACHE:Manual | Documents | Programs | BranchCache | None] 
      {sharename | devicename | drive:path} /DELETE 
      sharename \\computername /DELETE 

Error: 


Stdout: 

我的Windows主机和使用流浪的Hyper-V提供的。

回答

0

我看到它的方式这里有两种可能的方法:

  1. 安装在你的主机(Windows)中的份额,并提供了一个路径在Vagrantfile安装点视为synced_folder

  2. 在调配期间将共享挂载到您的客户机上。

您目前的做法是尝试让Vagrantfile即时生成挂载点。我不能说这是否甚至是可能的,但上述两种方法中的一种肯定更可靠,更易于调试,并且不易出错。