4

The problem

Whenever I run vagrant up (or homestead up for Laravel Homestead 2.0) I get a connection timeout error as follows;

(...usual 'vagrant up' stuff...)
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
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.

(...left part out to reduce the size of this question...)

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

Important

Main key to this question is that this ONLY happens on my internet connection at home. When I'm at the office (different network) everything runs as expected. So this means it has something to do with my home network / router...?

What I'm running

  • Macbook Pro (late 2013)
  • Mac OS X 10.10.1
  • Router: Huawei HG556a with bridged Airport Extreme

What I've tried

I've tried so many stuff that Google almost doesn't give me new results anymore on my search queries, here are the most important ones;

  • Destroyed the box
  • Completely uninstalled Vagrant & Virtualbox, and reinstalled the latest (and tried with combinations of older) versions.
  • Increased the timeout to 600 and later 1200
  • Setting fixed IPs in the Vagrantfile
  • Forwarded to different ports through the Vagrantfile
  • Set my mac to use the DNS 8.8.8.8 and 8.8.4.4
  • Enabled the GUI which results in homestead login:, which is the same compared to when it works just fine at the office. Even tried logging in with user vagrant and pass vagrant

I really hope someone can give a working solution, I've seriously been at it a couple of days now...

Of course, solutions and good answer will be rewarded with upvotes and marked as answer!

Laurence Cooper
  • 1,215
  • 1
  • 12
  • 21
  • One thing you can try for troubleshooting is to enable the GUI mode. More info on this SO thread: [Vagrant up timeout](http://stackoverflow.com/questions/23690124/vagrant-up-timeout/23742373#23742373). Try that when on your home network to see if it helps identify the issue. – BrianC Nov 19 '14 at 23:15
  • Thanks BrianC, but yeah, tried that one as well. Added it to the list of 'what i've tried' – Laurence Cooper Nov 20 '14 at 00:25
  • Next thought: once the VM is up, can you manually ssh to it, like: `ssh -p 2222 vagrant@127.0.0.1`. Can also try the nc command to verify connectivity: `nc -z 127.0.0.1 2222`, should return "connection succeeded". – BrianC Nov 20 '14 at 04:55
  • Yes and yes, I can ssh into it, and the `nc` command is returning `succeeded`. Thanks again! – Laurence Cooper Nov 20 '14 at 10:45
  • Okay, process of elimination :) Two more ideas if you haven't tried already: 1) create a minimal default Vagrantfile (`vagrant init hashicorp/precise32`) to see if it has the same problem; 2) enable more debug logs to see if they provide a clue (`VAGRANT_LOG=info vagrant up`) – BrianC Nov 20 '14 at 15:13
  • By the way in homestead you could login with user: `homestead` and password `secret`, not just `vagrant` and `vagrant` ;) – phaberest Nov 25 '14 at 12:26
  • Thanks guys, I actually found a solution but still don't know the exact cause (and I want to know!). Vagrant boots up normally ONLY when I have my VPN activated... So I guess it has something to do with the IP or ports used...? If someone could explain, please add an answer! – Laurence Cooper Dec 05 '14 at 11:15
  • @freakstyling may be it's a firewall issue. could you try it with deactivated firewall on router ? – mirza Apr 09 '15 at 14:12
  • had a similiar problem and just managed to solve it. see my answer [here](http://stackoverflow.com/a/35983967/4159720) maybe it helps you too. – koox00 Mar 14 '16 at 09:42

2 Answers2

1

Don't forget to add the "domains" for your Nginx sites to the hosts file on your machine! The hosts file will redirect your requests for the local domains into your Homestead environment. On Mac and Linux, this file is located at /etc/hosts. On Windows, it is located at C:\Windows\System32\drivers\etc\hosts. The lines you add to this file will look like the following:

192.168.10.10 homestead.app

In windows, you have to run notepad as an administrator when accessing and editing your etc/hosts file

0

I had the same issue. In my case I destroy the homestead box and recreated it and all work just fine since. I just ran the following: - homestead destroy - homestead up

Hopes it helps.

Theo
  • 1