1

I am learning how to use Laravel 4.2, which comes ready to use Homestead. I previously used Apache to learn Laravel locally. While setting up Homestead using the official docs, I keep encountering a timeout.

I am using Vagrant 1.6.3, the latest release of Homestead (as of 10 July 2014), PHP 5.5.3 (which should not matter since I am using Vagrant I suppose?), and Laravel 4.2.

I use the following Vagrantfile:

VAGRANTFILE_API_VERSION = "2"

path = "#{File.dirname(__FILE__)}"

require 'yaml'
require path + '/scripts/homestead.rb'

Vagrant.configure("1") do |config|
  config.vm.boot_mode = :gui
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  Homestead.configure(config, YAML::load(File.read(path + '/Homestead.yaml')))
end

I use the following Homestead.yaml:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1

authorize: /home/alex/.ssh/id_rsa.pub

keys:
    - /home/alex/.ssh/id_rsa

folders:
    - map: /home/alex/repos/www
      to: /home/vagrant/repos/www

sites:
    - map: homestead.app
      to: /home/vagrant/repos/www/learning/public

My /etc/hosts file contains the following line:

127.0.0.1   learning.app

When I call vagrant up, I receive the following output:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 => 8000 (adapter 1)
    default: 3306 => 33060 (adapter 1)
    default: 5432 => 54320 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> 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: Warning: Connection timeout. Retrying...
[[17 more failed attempts]]
    default: Warning: 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.

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.

Could my previous set up of Apache be interfering? Did I miss something? Thank you.

ordonezalex
  • 2,645
  • 1
  • 20
  • 33
  • have you tried to boot the box manually via vbox gui and then connect to it via normal shell? – Max Jul 11 '14 at 11:14
  • This is my first real time working with VirtualBox. How do I run the Homestead box from the GUI? Edit: I opened up the VirtualBox GUI and saw I have a couple Homestead boxes and tried to open one. It just shows a black screen (over five minutes now). – ordonezalex Jul 11 '14 at 12:03
  • Possible duplicate of [Vagrant stuck connection timeout retrying](http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying) – kenorb Dec 11 '16 at 14:25
  • @kenorb, probably not a duplicate, since the solutions are completely different. – ordonezalex Dec 18 '16 at 14:35

2 Answers2

2

I had the same problem 'Time out...', until I figured out that the Virtualization Compatibility was disabled in the BIOS of my computer. Source this phorum. http://laravel.io/forum/05-18-2014-trouble-getting-homestead-to-start-in-windows?page=1#reply-9067

Fixed that it worked perfectly.

1

Turn on the VirtualBox GUI and you will be able to better see what is causing your problem. Here are some instructions on how to do it two ways (you will need to do this either on the Vagrantfile file or on the homestead.rb file):

enabling gui in Vagrantfile settings

That should allow you to see the actual boot screen and watch it go.

Are you running Vagrant on a linux host?

noeldiaz
  • 906
  • 5
  • 5
  • Yes, I am running on a Debian derivative (Xubuntu 13.04). – ordonezalex Jul 11 '14 at 19:28
  • I tried this solution. You can now see my `Vagrantfile` in the original post _with_ the changes suggested by the link. I did not see anything different, and the output is identical. – ordonezalex Jul 11 '14 at 19:35
  • Interesting. I just added that config just like you did and as soon as I did "vagrant up" the gui windows pops up. Now, I did have to "vagrant halt" the vm first from suspension. I'm also running on OSX and not Linux, so not sure if that make it different. You could try having the VirtualBox Manager Application open and see if it lets you pull up the gui window from there? – noeldiaz Jul 12 '14 at 02:13