6

Whenever I try to Vagrant Up it will load the box and do most everything right, but because I'm trying to use Puppet to provision this CentOS 6.3 minimal I need SSH to work during Vagrant Up (if I want it as autonomous as possible).

I get the following information from Vagrant's INFO log:

DEBUG virtualbox_4_2:   - [1, "ssh", 2222, 22]
 INFO ssh: Connecting to SSH: 127.0.0.1:2222
 INFO ssh: SSH not up: #<Timeout::Error: execution expired>
 INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "showvminfo", "c2e7375d-159f-4014-9bda-ff9914423f4c", "--machinereadable"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: name="Vagrant-Apache-Nick_1360372174"
Nick
  • 487
  • 1
  • 4
  • 21
  • Based on the debug info: 1. either NAT port forwarding rule is NOT working or 2. Your host (Windows) is NOT able to connect localhost port 2222 (firewall?). Check. – Terry Wang Feb 11 '13 at 01:22

2 Answers2

10

During Vagrant Up your Windows system tries to connect to SSH. If you type on your command line:

set VAGRANT_LOG=INFO

You may see it fail and try a couple of times. It looks like this:

INFO ssh: Connecting to SSH: 127.0.0.1:2222

This is happening because the timeout is set to 10. This can be modified by placing the following in your Vagrantfile:

config.ssh.timeout = 300

You can use any number you like but I recommend something above 100.

Sources:

  1. This guy had some useful troubleshooting information.
  2. Vagrant Docs for Vagrantfiles
  3. Vagrant Docs for Vagrantfile SSH Timeout
  4. Vagrant Docs for Debugging
  5. Hours of Troubleshooting (Keep Smilin')
Nick
  • 487
  • 1
  • 4
  • 21
  • 3
    Thank you for the set VAGRANT_LOG=INFO. This is gold! – hex Mar 25 '13 at 10:48
  • Same kind of problem exists with me as well, When I run "vagrant up" command it shows default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Error: Connection timeout. Retrying... – gkd Apr 02 '14 at 07:34
1

I know I'm WAY late to this post, but I did have nearly the exact same problem for a full day before I simply removed Hyper-V from Windows and it magically solved my issue.

I guess when I was testing with Docker for Windows (not to be confused with docker-machine) it goofed my Hyper-V somehow. Not 100% sure why this tweaked fixed this issue, but it worked like a charm after Docker for Windows seemed to fubar my VirtualBox (Docker for Windows and Local by FlyWheel / VirtualBox conflict with each other).

enter image description here

Hopefully this helps someone out!

K8sN0v1c3
  • 109
  • 1
  • 10