Back

Problem launching vagrant on Homestead


I've set up the local Homestead version following these guidlines: http://laravel.com/docs/homestead

I got to the part where I launch vagrant using vagrant up, and I get this output:

bash-3.2$ vagrant up /Users/Colin/Homestead/scripts/homestead.rb:26:in read': No such file or directory - /Users/me/.ssh/id_rsa.pub (Errno::ENOENT) from /Users/Colin/Homestead/scripts/homestead.rb:26:inblock in configure' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/kernel_v2/config/vm_provisioner.rb:72:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/kernel_v2/config/vm_provisioner.rb:72:inadd_config' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/kernel_v2/config/vm.rb:284:in provision' from /Users/Colin/Homestead/scripts/homestead.rb:24:inconfigure' from /Users/Colin/Homestead/Vagrantfile:9:in block in <top (required)>' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/v2/loader.rb:37:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/v2/loader.rb:37:in load' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/loader.rb:103:inblock (2 levels) in load' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/loader.rb:97:in each' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/loader.rb:97:inblock in load' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/loader.rb:94:in each' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/config/loader.rb:94:inload' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/vagrantfile.rb:28:in initialize' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:574:innew' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:574:in vagrantfile' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:359:inhost' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:168:in block in action_runner' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:33:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:33:in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:346:inhook' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:556:in unload' from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:169:inensure in <main>' from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:169:in `<main>'

Any ideas what is going wrong?

Thanks, Colin

JoshMountain replied 4 years ago Solution

The first line shows you the error:

No such file or directory - /Users/me/.ssh/id_rsa.pub

You haven't properly configured your SSH key location. You need to do something like:

vim Homestead/Homestead.yaml

and change the /me/ directories to /Colin/. This is assuming you have an SSH key pair setup. If you don't, run this command in terminal first:

ssh-keygen -t rsa -C "[email protected]"
cdpritcha replied 4 years ago

Thanks for your help Josh!

I changed the paths in the Homestead.yaml file. I had created a SSH key pair before, but I didn't do it in the Homestead directory. I ran the command again while I was in the Homestead directory and I still got the same error.

Looking at the key generation, it is putting the key into my user folder, not into the Homestead folder:

Colins-Mac-Pro:Homestead Colin$ ssh-keygen -t rsa -C "myemailaddress"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/Colin/.ssh/id_rsa):

I tried this:

Enter file in which to save the key (/Users/Colin/.ssh/id_rsa): /Users/Colin/Homestead/.ssh/id_rsa/homestead

and, after inputting the passphrase, got this:

open /Users/Colin/Homestead/.ssh/id_rsa/homestead failed: No such file or directory.

Should I manually create the .ssh and .ssh/id_rsa folders in the Homestead folder?

JoshMountain replied 4 years ago

You shouldn't have to manually create anything for SSH. Once you run this command (doesn't matter where you run it) the key will exist in /Users/Colin/.ssh :

ssh-keygen -t rsa -C "[email protected]"
cdpritcha replied 4 years ago

Thanks again. I've moved the keys that were created into the ~/.ssh directory, and renamed them id_rsa and id_rsa.pub.

I think that has solved the one issue (I hope). I don't get the same error as before. No I have a new one.

Now the terminal tells me:

* The host path of the shared folder is missing: /Users/Colin/Code 

Here's the full history:

Colins-Mac-Pro:~ Colin$ cd ~/Homestead
Colins-Mac-Pro:Homestead Colin$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
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: /Users/Colin/Code 

Any idea why I don't have this Code directory and where I get it?

Rikcon replied 4 years ago

cdpritcha said:

Thanks again. I've moved the keys that were created into the ~/.ssh directory, and renamed them id_rsa and id_rsa.pub.

I think that has solved the one issue (I hope). I don't get the same error as before. No I have a new one.

Now the terminal tells me:

* The host path of the shared folder is missing: /Users/Colin/Code 

Here's the full history:

Colins-Mac-Pro:~ Colin$ cd ~/Homestead
Colins-Mac-Pro:Homestead Colin$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
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: /Users/Colin/Code 

Any idea why I don't have this Code directory and where I get it?

This is a shared folder between your Vagrant VM and your Mac. Create a folder Code in /users/Colin, or change the path to an existing folder with your laravel code in Homestead.yaml.

cdpritcha replied 4 years ago

Thanks . Seems to be working now. I appreciate the help!


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us