15

My host is running Windows 7 Pro (64 bit). The Guest OS in this case is Windows Server 2008 R2. The 'vagrant up' command is running into an issue where I keep getting:

****default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: password
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...****

till it eventually times out and says:

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.

The VM actually comes up fine, is accessible and usable.

  • Why is it trying to even SSH to the Windows machine?

My Vagrantfile contents are:


Vagrant.configure("2") do |config|

  # Max time to wait for the guest to shutdown
  config.windows.halt_timeout = 60

  # Admin user name and password
  config.winrm.username = "Administrator"
  config.winrm.password = "Password"

  # Configure base box parameters
  config.vm.box = "BaseBox"
  config.vm.box_url = "./Base.box"
  config.vm.guest = :windows
  config.vm.provider "virtualbox" do |v|
    v.gui = true
  end

  # Port forward WinRM and RDP (changed values to NOT conflict with host)
  config.vm.network :forwarded_port, guest: 3389, host: 3391
  config.vm.network :forwarded_port, guest: 5985, host: 5987, id: "winrm", auto_correct: true

end

akshtray
  • 161
  • 1
  • 1
  • 4
  • have you installed vagrant-windows? `gem install vagrant-windows` – dfedde May 09 '14 at 21:50
  • I should have added this in my original post but slipped my mind. I installed Vagrant 1.6.1 using the Windows binary on the site. I also have version 4.3.10r93012 of Virtual Box running on my Windows 7 machine. – akshtray May 09 '14 at 21:53

2 Answers2

17

You need to use

   config.vm.communicator = "winrm"

In your vagrant file. Take a look at this feature preview

dfedde
  • 852
  • 7
  • 19
  • Thanks for that dfedde. It definitely helped and I am not getting the repeated 'default: Warning: Remote connection disconnect. Retrying...' messages. But I am still getting a timeout towards the end. Like the previous time, I DO NOT have any issue using the VM and it appears full functional. – akshtray May 12 '14 at 14:35
  • Is it still trying to connect via ssh? – dfedde May 12 '14 at 18:57
  • 1
    Regarding the timeout using winrm, I ran into this as well. I found my domain policy was disabling the 'Allow unencrypted traffic' setting (Computer Configuration\Administrative Templates\Windows Components\Windows Remote Management (WinRM)\WinRM Client). It looks like support for winrm over an encrypted channel may be coming soon: https://github.com/mitchellh/vagrant/pull/3960 – dirtybird Jun 18 '14 at 18:47
0

I experienced the issue in Windows 7. At last we found out that this problem is due to the Linux OS that we are using with Vagrant version is not compatible. So, we took the latest version (i.e. v1.6.3) of Vagrant and updated our OS to point to agent.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-i386-v20131103.box"

Vagrant version 4.3.8 was not working with the below OS. agent.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box".

I hope this helps to resolve the issue.

Raj
  • 11
  • 1