title: Vagrant with Hyper-V Provider to run Laravel Homestead
body: <p>Using a new install of Laravel with Laravel Homestead I've been trying to get Vagrant to boot, but it keeps timing out.  I tried using the <code>Default</code> virtual switch, as well as the <code>DockerNAT</code> and <code>NewInternalVirtualSwitch</code> which is a virtual switch I added using the <a href="https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/create-a-virtual-switch-for-hyper-v-virtual-machines" rel="noreferrer">Hyper-V Manager</a>.</p>
  
  <p>I know I can leave the provider as VirtualBox and turn off Hyper-V, but since we use Vagrant and Docker for different application doing this over the last couple days has become tedious since <code>Docker for Windows</code> on Windows 10 Pro requires Hyper-V to be on so each time you have to shut down and restart in either direction.</p>
  
  <p>Has anyone gotten Laravel Homestead to work using the Hyper-V provider, and what steps did you have to take to get networking to work which appears to be the issue?</p>
  
  <p><strong>Homestead.yaml</strong></p>
  
  <pre><code>ip: 192.168.10.10
  memory: 2048
  cpus: 1
  provider: hyperv
  authorize: ~/.ssh/example/id_rsa.pub
  keys:
      - ~/.ssh/example/id_rsa
  folders:
      -
          map: 'D:\Projects\example\server'
          to: /home/vagrant/server
  sites:
      -
          map: server.app
          to: /home/vagrant/server/public
  databases:
      - example
  name: example
  hostname: example
  </code></pre>
  
  <p><strong>Vagrant Up</strong></p>
  
  <pre><code>Bringing machine 'example' up with 'hyperv' provider...
  ==&gt; example: Verifying Hyper-V is enabled...
  ==&gt; example: Importing a Hyper-V instance
      example: Please choose a switch to attach to your Hyper-V instance.
      example: If none of these are appropriate, please open the Hyper-V manager
      example: to create a new virtual switch.
      example:
      example: 1) DockerNAT
      example: 2) Default Switch
      example: 3) NewInternalVirtualSwitch
      example:
      example: What switch would you like to use? 3
      example: Cloning virtual hard drive...
      example: Creating and registering the VM...
      example: Setting VM Integration Services
      example: Successfully imported a VM with name: ubuntu-16.04-amd64_1
  ==&gt; example: Starting the machine...
  ==&gt; example: Waiting for the machine to report its IP address...
      example: Timeout: 120 seconds
      example: IP: fe80::215:5dff:fe38:107
  ==&gt; example: Waiting for machine to boot. This may take a few minutes...
      example: SSH address: fe80::215:5dff:fe38:107:22
      example: SSH username: vagrant
      example: SSH auth method: private key &lt;--- Stalls out for a couple minutes
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Timed out while waiting for the machine to boot. This means that
  Vagrant was unable to communicate with the guest machine within
  the configured ("config.vm.boot_timeout" value) time period.
  
  If you look above, you should be able to see the error(s) that
  Vagrant had when attempting to connect to the machine. These errors
  are usually good hints as to what may be wrong.
  
  If you're using a custom box, make sure that networking is properly
  working and you're able to connect to the machine. It is a common
  problem that networking isn't setup properly in these boxes.
  Verify that authentication configurations are also setup properly,
  as well.
  
  If the box appears to be booting properly, you may want to increase
  the timeout ("config.vm.boot_timeout") value.
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Also tried <a href="https://blogs.technet.microsoft.com/virtualization/2017/07/06/vagrant-and-hyper-v-tips-and-tricks/" rel="noreferrer">tip 4</a> using an external virtual switch and it makes it further, but still fails with an error while trying to assign a hostname:</p>
  
  <pre><code>==&gt; example: Machine booted and ready!
  ==&gt; example: Setting hostname...
  No host IP was given to the Vagrant core NFS helper. This is
  an internal error that should be reported as a bug.
  </code></pre>