0

Recently I have started playing with Vagrant for setting up dev environments. I have been able to build a base box with Packer and provision/configure the VM later on with powershell scripts.

Some of the software I would like to installed is kept on shared drive. I would like to mount this as synced folder during starting the machine.

I have tried the following:

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

I have tried //corp/dfs as well, but to no avail.

I provide credentials and get following error:

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:

I'm on Windows host and using Hyper-V provider for Vagrant.

jjczopek
  • 3,319
  • 2
  • 32
  • 72

1 Answers1

0

The way I see it there are two possible approaches here:

  1. Mount the share on your Host (Windows), and provide a path to that mount point in the Vagrantfile as a synced_folder.

  2. Mount the share on your Guest(s) during provisioning.

Your current approach is to try and have the Vagrantfile generate the mount point on the fly. I can't say whether or not that is even possible, but one of the above two methods is certainly more reliable, easier to debug, and less error-prone.

Brian Brownton
  • 1,313
  • 14
  • 31