3

I'm trying to set up Laravel Homestead on Windows 8.1 x64 and I can't seem to get passed the error below.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: casensitive_default_1420409560257_10693
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> 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...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    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.

This is a very popular error with Homestead, and I've found a couple similar posts on stackoverflow such as: one, and two. But setting the boot_mode in my Vagrantfile didn't fix the issue.

Vagrant.configure("1") do |config|
  config.vm.boot_mode = :gui
end

To make sure I had VT-x I downloaded intels tool, which I do: i7 core; and I checked that Virtualization is enabled in BIOS.

In the Vagrantfile I'm using defaults (most of it appears to be commented out) and I've set config.vm.box to:

"laravel/homestead"

and my Homestead.yaml is set to (and already had id_ras.pub and id_rsa):

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/d/projects
      to: /home/vagrant/projects

sites:
    - map: roopla.app
      to: /home/vagrant/projects/test_app/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

This is pretty far out of my normal Composer, PHP, GruntJS, BowerJS, AngularJS day, and I'm not sure what I'm really doing, initially I was just learning Laravel 4/5 and then I jumped sideways because Homestead looked useful and kewl, so I'm just blindly following instructions so any snippets of knowledge that can be imparted would be much appreciated.

Community
  • 1
  • 1
mtpultz
  • 17,267
  • 22
  • 122
  • 201
  • http://puphpet.com. Always works for me – Nick Jan 04 '15 at 23:37
  • @Ortix92, please provide a full example on implementing Laravel's Homestead with puphet.com. I can't find the connection on your comment. Thanks – FedeKrum Nov 28 '16 at 11:46
  • @mtpultz, I have the same problem over OSX and I can't make it work. Did you manage to have a workarround on this? Thanks – FedeKrum Nov 28 '16 at 11:48

1 Answers1

0

First, make sure you haven't turned on Hyper-V.

Second, probably you have problem with ssh keys. The simplest solution is to alter your vagrant file not to use SSH keys but login and password.

Look at my vagrantfile:

require 'json'
require 'yaml'

VAGRANTFILE_API_VERSION = "2"

homesteadYamlPath = File.expand_path("Homestead.yaml")
afterScriptPath = File.expand_path("after.sh")
aliasesPath = File.expand_path("aliases")

require_relative 'scripts/homestead.rb'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    if File.exists? aliasesPath then
        config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
    end

    config.ssh.username = "vagrant"
    config.ssh.password = "vagrant"   

    Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))    

    if File.exists? afterScriptPath then
        config.vm.provision "shell", path: afterScriptPath
    end

    config.vm.network "forwarded_port", guest: 11300, host: 11301
end

I've added here 2 lines:

    config.ssh.username = "vagrant"
    config.ssh.password = "vagrant"  

because I had the same problem as you and now Homestead works for me without any problems.

Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291