Vagrant: 1.5.0: Failed to determine VM's IP address even when Virtual Switch Manager setup for this and tried apt-get install steps at http://docs.vagrantup.com/v2/hyperv/boxes.html

Created on 17 Mar 2014  ·  5Comments  ·  Source: hashicorp/vagrant

This is the error:
http://www.flickr.com/photos/sodrupal/13222649915/in/set-72157642498991193

My configuration:
Vagrant 1.5.0 (not using Vagrant 1.5.1 as there appears to be regression where I get a list of ruby errors - see bug for that here: https://github.com/mitchellh/vagrant/issues/3246 )
Windows 8 64bit Pro, 8Gb RAM, HyperV enabled, i7 dual core.
Running vagrant up on host Windows machine in a git bash command line console terminal window.

I have setup the Virtual Switch to try to ensure that the VM gets the IP

I noticed (see above screenshot) that the hyper-v manager/virtual switch manager reports: Degraded (integration services upgrade required) so I logged into the VM via the hyper-v manager and I tried to run the apt-get install commands stated at: http://docs.vagrantup.com/v2/hyperv/boxes.html

i.e.:

$ sudo apt-get install linux-tools-3.11.0-15-generic
$ sudo apt-get install hv-kvp-daemon-init
$ sudo cp /usr/lib/linux-tools/3.11.0-15/hv_* /usr/sbin/

But as you can see, it reports that everything is already up to date:
http://www.flickr.com/photos/sodrupal/13222650305/in/set-72157642498991193

I get the following when I issue vagrant up:

$ vagrant up --provider hyperv
Bringing machine 'default' up with 'hyperv' provider...
==> default: Importing a Hyper-V instance
    default: Cloning virtual hard drive...
    default: Creating and registering the VM...
    default: Successfully imported a VM with name: precise64_1
==> default: Starting the machine...
==> default: Waiting for the machine to report its IP address...
    default: Timeout: 120 seconds
Hyper-V failed to determine your machine's IP address within the
configured timeout. Please verify the machine properly booted and
the network works. To do this, open the Hyper-V manager, find your
virtual machine, and connect to it.

The most common cause for this error is that the running virtual
machine doesn't have the latest Hyper-V integration drivers. Please
research for your operating system how to install these in order
for the VM to properly communicate its IP address to Hyper-V.

Rob@W8THINKPAD ~/work/projects/dev/sitesvms/drupaldev-apache-hyperv (master)
$

I'm not trying to do anything special here: All I'm trying to do is get a Ubuntu VM to work on the hyper-v. Nothing fancy, no special config. My machine is a i7 dual core, 8Gb RAM, Thinkpad X201S with Samsung SSD, with the virtualisation enabled in the BIOS (VirtualBox runs ok on this machine in Windows and Ubuntu).

I would have thought a cookbook guide detailing the end-to-end steps without ambiguity would have been published on the vagrantup.com - Surely for Vagrant 1.5 to be deemed releasable the developers would have run their own tests and ran through their own setups - these should be shared. It seems that good basic end-to-end cookbook style documentation wasn't a priority criteria for releasing Vagrant 1.5. I want to help (and indeed do - I WRITE documentation here: https://drupal.org/node/2183343 AND here: http://stackoverflow.com/a/15067918/227926 so I'm NOT a Help Vampire) but I get over-general feedback on the standard thing I'm trying to do: https://github.com/mitchellh/vagrant/issues/3150#issuecomment-37425791

Sorry, but I'm disappointed at the moment, but thanks for making a great tool, shame about the documentation.

Most helpful comment

this is because your hyperv is not using an ipv4 address, to fix this, look at this post: http://blog.areflyen.no/2012/10/10/setting-up-internet-access-for-hyper-v-with-nat-in-windows-8/

The additional step you have to do is go to

  1. Control Panel\Network and Internet\Network Connections
  2. Right click on your network adapter and click on properties
  3. Click on the sharing tab
  4. Select Allow other network users… and select the newly created virtual network switch (prefixed with “vEthernet”).
  5. Click ok and it should give you an ip address prefixed with 192.168.137.x

Hope this helps, took me a while to figure it out

All 5 comments

this is because your hyperv is not using an ipv4 address, to fix this, look at this post: http://blog.areflyen.no/2012/10/10/setting-up-internet-access-for-hyper-v-with-nat-in-windows-8/

The additional step you have to do is go to

  1. Control Panel\Network and Internet\Network Connections
  2. Right click on your network adapter and click on properties
  3. Click on the sharing tab
  4. Select Allow other network users… and select the newly created virtual network switch (prefixed with “vEthernet”).
  5. Click ok and it should give you an ip address prefixed with 192.168.137.x

Hope this helps, took me a while to figure it out

Thanks @varghesejacob What also works is to delete any VM and connection already setup if encountering these issues.

There another way to do that with out sharing the network connection?

Also, a note about another reason why Vagrant might fail to detect the IP of the VM: Make sure that "Data Exchange" is enabled under Settings -> "Integration Services" for the VM in Hyper-V. Otherwise, the hv_kvp daemon (Hyper-V Key Value Pair Daemon) inside the VM will not have a device it can use to report information back to Hyper-V.
image

This is equivalent to the following in the Vagrantfile:

config.vm.provider "hyperv" do |h|
  h.vm_integration_services = {
      ...
      key_value_pair_exchange: true,
      ...
  }
end

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings