rabol's avatar
Level 14

Homestead installation on Mac OS X 10.12

Hi

I’m a big fan of Laravel and I recently switch for using PC to using a Mac, so I was trying to install Homestead and I found a few small things missing in the installation guide - https://laravel.com/docs/5.3/homestead

I did follow all the steps, installed VirtualBox, Vagrant and added the ‘laravel/homestead’ box, but then the first small issue appeared

The ‘You may….’ Sounded to me like it was an option so it took me a while to figure that I actually HAD to do the git clone.

I then made the changes to the Homestead.yaml and did a 'vagrant up' Lot’s of errors and no Homestead

/Users/mymachine/Homestead/scripts/homestead.rb:109:in read': No such file or directory @ rb_sysopen - /Users/mymachine/.ssh/id_rsa (Errno::ENOENT) from /Users/mymachine/Homestead/scripts/homestead.rb:109:inblock (2 levels) in configure' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm_provisioner.rb:72:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm_provisioner.rb:72:inadd_config' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/plugins/kernel_v2/config/vm.rb:324:in provision' from /Users/mymachine/Homestead/scripts/homestead.rb:106:inblock in configure' from /Users/mymachine/Homestead/scripts/homestead.rb:105:in each' from /Users/mymachine/Homestead/scripts/homestead.rb:105:inconfigure' from /Users/mymachine/Homestead/Vagrantfile:30:in block in <top (required)>' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/v2/loader.rb:37:in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:113:inblock (2 levels) in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:in each' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:107:inblock in load' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:in each' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/config/loader.rb:104:inload' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/vagrantfile.rb:28:in initialize' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:innew' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:746:in vagrantfile' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:492:inhost' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:214:in block in action_runner' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/action/runner.rb:33:in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:479:inhook' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/lib/vagrant/environment.rb:728:in unload' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:inensure in ' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.6/bin/vagrant:177:in `'

what did I miss ?

Thanks in advance

0 likes
19 replies
Jaytee's avatar

Seems like you don't have an ssh key. I can't remember the full command but run this in your terminal:

Or search how to create a ssh key via terminal

ssh-keygen

rabol's avatar
Level 14

Hi

If creating the key is 'required' it should be indluded in the init.sh or as minimum be written in the installation guide

I created the key, but then i get a new error:

"There are errors in the configuration of this machine. Please fix the following errors and try again:

vm:

  • The host path of the shared folder is missing: ~/Code"
rabol's avatar
Level 14

again... the ~/Code directory should be created... since it is part of the 'default' it should be mentioned so 'dummy' users like me can get started :)

Jaytee's avatar

Hey rabol, the ssh key isn't just used for homestead, it's used for a variety of tasks on a per day basis.

In terms of the folder name, it's up to you to create it. It doesnt need to be called code. Remember, you didn't run homestead AFTER you configured it.

rabol's avatar
Level 14

well... as I mentioned, I have just switched to MAC from PC and it is the first time that I need the ssh key, so for me it is not something that I use on a daily basis.

"Remember, you didn't run homestead AFTER you configured it" - well, I'm following the installation guide and there is no reference to do something after configuration , except 'vagrant up'

In my Homestead folder there is a php script called homestead, but that produces a lot of errors as well

Jaytee's avatar

The ssh key isn't laravels fault. Sometimes it's already installed on your system and sometimes it isn't.

Post your homestead yaml file and your hosts file here and format it (put it within three backticks either side)

Then post the path to your folder where your laravel projects are going to be installed.

Example: ~/documents/projects

rabol's avatar
Level 14

Please forgive men, but I'm not trying to blame anyone - Simply a new user that is trying to follow the guide :)

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 
10.1.1.33 homestead.app
---
ip: "10.1.1.33"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

networks:
    - type: "public_network"
      ip: "192.168.10.20"
      bridge: "en1: Wi-Fi (AirPort)"
      
# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp
Jaytee's avatar

Okay so was the homestead IP address originally 192.168.10.10 or the one that's in the file ?

So your code folder is in your directory (I.e, your user name directory )

Jaytee's avatar

I also apologise, I've been waiting 2 months for my Internet to be installed so I'm on a mobile phone therefore I can't format and my responses are delayed

rabol's avatar
Level 14

yes, originally it was 192.168.10.10, but then I get this error ´´´ The specified host network collides with a non-hostonly network! This will cause your specified IP to be inaccessible. Please change the IP or name of your host only network so that it no longer matches that of a bridged or non-hostonly network

and I found another post describing that problem and the solution was to use something like this - not really sure why it would be a problem as my LAN is 192.168.10.xxx so adding another machine should be fine

with the 10.x.x.x the vm can start but does not respond on any of the 3 IP it have
I also added the network section to Homestead yaml due to the fact that my iMac is using WiFi

I'm actually puzzled why it is so complicated... it should be a 'simple' VM with pre-installed software, or do I miss the whole point ?

Jaytee's avatar

Hmm I've never seen that before and I'm not exactly great with networks,

Try changing the ip back to 192.168.10.10 and remove the whole network option from the yaml file and then run :

Vagrant destroy and then vagrant up again

It's also worth noting, that error will be related to vagrant not homestead :/

Worth a shot Doing what I said above tho

Jaytee's avatar

If that doesn't work, add the network back and change the network type to private_network, the ip the same as the default homestead (the one in my previous comment) and then remove the bridge section

I have to use a private network whilst not connected to the internet so worth a shot having settings like mine also

Jaytee's avatar

You're on a Mac right? Using valet for now.

willvincent's avatar

Probably the only thing you had left to do for homestead was change the IP to something other than 192.168.10.10...

Please or to participate in this conversation.