Laravel Homestead not working on 'vagrant up' command

1k Views Asked by At

I am trying to setup homestead for my laravel project, following the documentation:

Per Project Installation
Instead of installing Homestead globally and sharing the same Homestead box across all of your projects, you may instead configure a Homestead instance for each project you manage. Installing Homestead per project may be beneficial if you wish to ship a Vagrantfile with your project, allowing others working on the project to simply vagrant up.
To install Homestead directly into your project, require it using Composer:
composer require laravel/homestead --dev
Once Homestead has been installed, use the make command to generate the Vagrantfile and Homestead.yaml file in your project root. The make command will automatically configure the sites and folders directives in the Homestead.yaml file.
Mac / Linux:
php vendor/bin/homestead make
Windows:
vendor\\bin\\homestead make
Next, run the vagrant up command in your terminal and access your project at http://homestead.app in your browser. Remember, you will still need to add an /etc/hosts file entry for homestead.app or the domain of your choice.

Okay, everything seems fine: my Homestead.yaml:

ip:          192.168.10.10
memory:      2048
cpus:        1
provider:    virtualbox
authorize:   'C:\Users\pwojt\.ssh\id_rsa.pub'

keys:
    - 'C:\Users\pwojt\.ssh\id_rsa'
folders:
    -
        map: 'C:\xampp\htdocs\liveandnow'
        to:  /home/vagrant/Code
sites:
    -
        map: liveandnow.com
        to:  /home/vagrant/Code/public
databases:
    - liveandnow
name:        liveandnow
hostname:    liveandnow

However I get this error message:

λ vagrant up
Bringing machine 'liveandnow' up with 'virtualbox' provider...
==> liveandnow: Importing base box 'laravel/homestead'...
==> liveandnow: Matching MAC address for NAT networking...
==> liveandnow: Checking if box 'laravel/homestead' is up to date...
==> liveandnow: Setting the name of the VM: liveandnow
==> liveandnow: Fixed port collision for 80 => 8000. Now on port 2201.
==> liveandnow: Fixed port collision for 443 => 44300. Now on port 2202.
==> liveandnow: Fixed port collision for 3306 => 33060. Now on port 2203.
==> liveandnow: Fixed port collision for 5432 => 54320. Now on port 2204.
==> liveandnow: Fixed port collision for 8025 => 8025. Now on port 2205.
==> liveandnow: Fixed port collision for 27017 => 27017. Now on port 2206.
==> liveandnow: Fixed port collision for 22 => 2222. Now on port 2207.
==> liveandnow: Clearing any previously set network interfaces...
==> liveandnow: Preparing network interfaces based on configuration...
    liveandnow: Adapter 1: nat
    liveandnow: Adapter 2: hostonly
==> liveandnow: Forwarding ports...
    liveandnow: 80 (guest) => 2201 (host) (adapter 1)
    liveandnow: 443 (guest) => 2202 (host) (adapter 1)
    liveandnow: 3306 (guest) => 2203 (host) (adapter 1)
    liveandnow: 5432 (guest) => 2204 (host) (adapter 1)
    liveandnow: 8025 (guest) => 2205 (host) (adapter 1)
    liveandnow: 27017 (guest) => 2206 (host) (adapter 1)
    liveandnow: 22 (guest) => 2207 (host) (adapter 1)
==> liveandnow: Running 'pre-boot' VM customizations...
==> liveandnow: Booting VM...
==> liveandnow: Waiting for machine to boot. This may take a few minutes...
    liveandnow: SSH address: 127.0.0.1:2207
    liveandnow: SSH username: vagrant
    liveandnow: SSH auth method: private key
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.

Now I have checked my keys, they seems to be in the same place as listed in my file. I have added a line in hosts:

192.168.10.10  liveandnow.com

To the bottom of the file. From laravel homestead documentation, I can't see anything that I have missed.

2

There are 2 best solutions below

0
Noah Telussa On

In your homestead.yaml file you got as following:

folders:
-
    map: 'C:\xampp\htdocs\liveandnow'
    to:  /home/vagrant/Code

This needs to be without the quotes

folders:
-
    map: C:\xampp\htdocs\liveandnow
    to:  /home/vagrant/Code

Let me know if that fixes your problem

0
Przemek Wojtas On

Found solution to the problem. Turns out it was VT not enabled in my bios