The host path of the shared folder is missing: ~/Code

Xeen picture Xeen · Feb 17, 2015 · Viewed 16.7k times · Source

I'd like to use laravel homestead for my development machine and installed virtualbox and vagrant successfully, but when I run vagrant up I get this error:

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: ~/Code

The Homestead.yaml file looks like this:

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

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
      hhvm: true

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

These are the default settings, but they don't really work for my machine - I don't even have /home/vagrant folder nor do I have ~/Code anywhere where I can see. I'm using ubuntu 12.04 - can you please point me to how I should configure my settings because by the official documentation I'm kind of lost.

Answer

trogne picture trogne · Aug 18, 2015

Inside the homestead directory, you have to run the command bash init.sh.

This will generate the Homestead.yaml file (and after.sh and aliases) inside your home directory (~).

If you are changing Homestead.yaml again, you have to re-run bash init.sh again. It will ask for overwrite, say yes.

(and as mentioned in other answers, be sure that the directory for folders: - map: exists)