title: Vagrant synced folders (smb) on hyper-v with internal switch
body: <p>I am trying to provision a VM through vagrant but can't figure out how to get synced folders (smb) working when I use an internal switch.</p>
  
  <p>I use hyper-v as hypervisor and one of the limitations is that a static IP for the VM can not be enforced from vagrant. I have a script to set up a static IPv4 in the guest machine that runs as <code>provisioning</code> step. </p>
  
  <p>The problem is that synced folders are mounted <em>before</em> provisioning kicks off. At that moment the host network is unreachable, mounting fails and <code>vagrant up</code> ends with an error.</p>
  
  <p>A possible solution that I thought of (but didn't work) was to figure out if the VM has been provisioned yet and enable the synced folder in that case. I was hoping the plugin <code>vagrant-reload</code> could have helped me but the synced folders are not re-evaluated again.</p>
  
  <p>Any one that can give me some pointers?</p>
  
  <p>My machine configuration:</p>
  
  <ul>
  <li>Host: Windows 10</li>
  <li>Guest: CentOS7</li>
  <li>Hypervisor: Hyper-V</li>
  </ul>
  
  <p>My vagrantfile:</p>
  
  <pre><code>Vagrant.configure(2) do |config|
      provisioned = File.exist?(".vagrant/machines/default/hyperv/action_provision")
  
      config.vm.box = "centos/7"
      config.vm.network "private_network", bridge: "Vagrant"
  
      config.vm.synced_folder "./shared", "/shared", type: "smb",
          disabled: provisioned == false,
          smb_host: "10.0.0.3",
          smb_username: "vagrant", 
          smb_password: "vagrant",
          mount_options: ["username=vagrant","password=vagrant"]
  
      config.vm.provision "file",
          source: "./provisioning",
          destination: "/tmp/provisioning" 
  
      config.vm.provision "static-ip",
          type: "shell",
          inline: "/bin/sh /tmp/provisioning/static-ip.sh"
  
      config.vm.provision :reload
  
      config.vm.provider 'hyperv' do |hv|
          hv.ip_address_timeout = 240
          hv.cpus = 2
          hv.memory = "2048"
          hv.vmname = "centos"
      end
  end
  </code></pre>
  
  <p><strong>Please note</strong>: I got this working when I use the Default switch or an External switch. But I want to get this working with an internal switch to test a scenario with a VM that never connects to the internet.</p>