Running windows 10 Hyper-V and using vagrant to spin up a windows server instance.
Setup a host to vm synced folders with:
### configuration parameters ###
# Vagrant base box to use
BASE = "mwrock/Windows2016"
# amount of RAM for Vagrant box
RAM_MB = "2048"
# number of CPUs for Vagrant box
CPU_COUNT = "1"
# Number of frontends #
FRONTEND_COUNT = 1
# winrm credentials #
WINRM_USER = "Administrator"
WINRM_PASS = "vagrant"
# Host credentials (Needed for SMB)#
SMB_USER = "SMB_USER"
SMB_PASS = "SMB_PASS"
# Package Drop Folder #
PACKAGE_DROP_FOLDER = "\\\\PACKAGE_DROP_SHARE\\Package-Drop"
### /configuration parameters ###
Vagrant.configure("2") do |config|
(1..FRONTEND_COUNT).each do |i|
config.vm.define "vm-0#{i}" do |node|
node.vm.box = BASE
node.vm.provider "hyperv"
node.vm.hostname = "vm-0#{i}"
node.vm.communicator = "winrm"
node.winrm.username = WINRM_USER
node.winrm.password = WINRM_PASS
node.vm.network "public_network", bridge: "External"
node.vm.provider "hyperv" do |h|
h.memory = RAM_MB
h.cpus = CPU_COUNT
h.vmname = "vm-0#{i}"
h.enable_virtualization_extensions = true
h.linked_clone = true
end
node.vm.synced_folder ".", "/vagrant/", type: "smb", smb_password: SMB_PASS, smb_username: SMB_USER, id: "project"
node.vm.synced_folder PACKAGE_DROP_FOLDER, "/packages/", type: "smb", smb_password: SMB_PASS, smb_username: SMB_USER, id: "packages"
#node.vm.provision "shell", path: "provision.ps1"
end
end
end
The first synced folder works fine, but the UNC share one fails.
This fails with:
Stderr: #< CLIXML
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
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><S S="Error">error _x000D__x000A_</S></Objs>
Stdout: share path: \\PACKAGE_DROP_SHARE\Package-Drop
Not sure if this is user error with how I am formatting my vagrant file with escapes, or if this is a bug, or if it is even possible.
Help would be appreciated.
Thanks