The box is not able to report an address for WinRM to connect to yet.

220 views
Skip to first unread message

Kaleb Albee

unread,
Apr 4, 2016, 3:51:29 PM4/4/16
to Vagrant

I am running into an issue where winrm seems to be timing out way too soon.  It keeps giving me the following error, however I have an ip address for the guest machine.

Has anyone ran into this problem before, my time out setting is pretty big?  

###### ERROR ###
The box is not able to report an address for WinRM to connect to yet.
WinRM cannot access this Vagrant environment. Please wait for the
Vagrant environment to be running and try again.
#################

#################
# VAGRANT FILE
#################

# -*- mode: ruby -*-
# vi: set ft=ruby :
require_relative 'tools'

# kinda like a static value in other languages, all caps mean the same.
VAGRANT_INSTANCE_NAME   = "vagrant-build"

PRIMARY = false
P_HOST = false
P_DS = false
P_TEMP = false
P_RESOURCE = false 

# 2 GB of ram
RAM = 4 * 1024
# 2 processors for the vm
CPUS = 4

Vagrant.configure(2) do |config|
  # make sure the proper plugins are available to the host machine.
  plugins?

  # tell vagrant how we are going to communicate.
  config.vm.communicator          = 'winrm'
  if PRIMARY
    config.winrm.username           = '<REDACTED>'
    config.winrm.password           = '<REDACTED>'
  end

  config.vm.boot_timeout          = 1800
  config.vm.guest                 = :windows
  config.vm.synced_folder ".", "/vagrant", disabled: true
  
  config.vm.define VAGRANT_INSTANCE_NAME do |d|
    
    # give the box a hostname
    d.vm.hostname   = VAGRANT_INSTANCE_NAME
    d.vm.network 'private_network', ip: '10.4.9.154'

    # tell the system where to find the dummy.box
    d.vm.box        = 'dummy'
    d.vm.box_url    = './files/dummy.box'

    # define the network ip address.

    # start setting up the box using the provider installation.
    d.vm.provider :vsphere do |vsphere, override|
      override.nfs.functional               = false
      vsphere.host                          = P_HOST ? 'vcenter-test.academy.cc' : 'vcenter-devtest.academy.cc'
      vsphere.user                          = '<REDACTED>'
      vsphere.password                      = '<REDACTED>'
      vsphere.vlan                          = 'vDS_TEST 10.4.9.0 %2f24'
      vsphere.vm_base_path                  = 'Development/DEV Automation'
      vsphere.name                          =  VAGRANT_INSTANCE_NAME
      vsphere.resource_pool_name            = 'DEV Automation'
      vsphere.data_store_name               = P_DS ? 'NEXSAN-DEV-01' : 'DevTest-01'
      vsphere.template_name                 = P_TEMP ? 'Development/DEV Automation/WIN2012R2-DEV-Template' : 'Development/DEV Automation/packer_vm_chef'
      vsphere.compute_resource_name         = P_RESOURCE ? 'Test-Cluster' : 'Vagrant-Cluster'
      vsphere.insecure                      = true
      vsphere.memory_mb                     = RAM
      vsphere.cpu_count                     = CPUS
      # vsphere.addressType                   = 'Generated'
      vsphere.customization_spec_name       = 'IP_Spec'
    end
  end
end
# VERSION
$ vagrant -v
Vagrant 1.8.1

#plugins
vagrant@vagrant-ubuntu-trusty-64:~/vmware$ vagrant plugin list
vagrant-berkshelf (4.1.0)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.5, system)
vagrant-triggers (0.5.2)
vagrant-vsphere (1.7.1)

Thanks in advance 


Kaleb Albee

unread,
Apr 4, 2016, 7:05:45 PM4/4/16
to Vagrant

As an update, i am also getting with a windows guest the following:  I have had to go in to the vagrant core plugin communicators and add  to communicators/winrm/communicator.rb 
winrm_info = nil unless winrm_info[:host] =~ /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/ at approx line 36.


#############################################################
An error occurred executing a remote WinRM command.

Shell: powershell
Command: $ProgressPreference='SilentlyContinue';
hostname
if ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }
Message: bad URI(is not URI?): http://fe80::6880:2cd:c694:ed9d:5985/wsman
#############################################################

Kaleb Albee

unread,
Apr 4, 2016, 7:08:43 PM4/4/16
to Vagrant
I have also tried to update the helper.rb to raise a winrmnotready exception, however that causes the system to fault out or I think time out.

Kaleb Albee

unread,
Apr 5, 2016, 3:29:20 PM4/5/16
to Vagrant
I noticed the IP is being updated, but it take something like 40 minutes
Reply all
Reply to author
Forward
0 new messages