Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Vagrant: The host path of the shared folder is missing

Hampton,

I'm following the install process you describe in the early videos. Things go smoothly until right after I edit the .yaml file an attempt "vagrant up' in the Homestead directory.

I get this:

[02:25 PM]~/Homestead $ 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/james/Homestead/Projects

8 Answers

@hamptonpaulk Thanks for the help. I resolved this: It was VirtualBox. VirtualBox was looking for VMs in the wrong place. I changed preferences through the GUI and--voila--vagrant up and vagrant ssh worked perfectly. Whew.

You may need to create that folder, as long as you are following my paths...

try this

mkdir /Users/james/Homestead/Projects

Was this step skipped in the videos? I ran into an identical issue that had me blocked for hours. Creating the directory solved the issue :-/

solved mine, too. Just typed in "mkdir" followed by the path that was reported to be missing (in my case, "mkdir ~/Code")

Thanks!

Hi James Gill -

Yay, Early Adopter! What directory are you in when you run your vagrant up? Is it the same directory that contains your Homestead.yaml file?

Also, what version is your vagrant install? If out of date try to look at the upgrade process here

Hampton,

Thank you! I sheepishly admit I forgot to be in the Homestead directory when I 'vagrant up'. See my edited question above--now, a different (perhaps simpler) error.

Also: vagrant 1.6.3, as in the video.

By the way--very grateful for this course.

Julien Gascard
Julien Gascard
12,818 Points

Hi, just to be sure, are you on OS X or on a Linux distro ? Because the path on Linux is a bit different : /Users/yourname/path -> /home/yourname/path . Hope it helps...

Good Call Julien Gascard

thanks, Julien. I'm on OS X. Problem's solved (see above).

Daniel White
Daniel White
2,558 Points

@JamesGill I think I'm having the same issue as you. Im getting the error message: "vm:

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

What did you do to fix this issue? I do great until I do vagrant up. I have added the project folders and updated the .yaml file but still get an error.

Is this a virtual box issue? Should I change the vm path under preferences? If so where should I change it to?

Thanks

Daniel, did try what I did in my comments above? My problem was fairly simple, once I discovered what happened.

Daniel White
Daniel White
2,558 Points

James, thanks for the quick reply. I have added the projects folder as mentioned above/made sure I'm in homestead directory, but I did not change anything within virtual box. When you stated VirtualBox was looking for the VM in the wrong place, where did you change it, and what path did you change it to?

Timothy Bradley
Timothy Bradley
1,601 Points

Hi Daniel, Did you get this to work? I'm still stuck at this point, also having the same error when starting "vagrant up". Please help!

I have this same issue. I don't understand what is happening. This is what I have in my yaml file:

folders:
    - map: ~/Code
      to: /c/Users/Student/homestead/Code

sites:
    - map: laravel.dev
      to: /c/Users/Student/homestead/Code/laravel-test/public

That is how my directory is set up. Obviously the Code directory exists. What I'm confused about is that it's asking for the path to the shared folder.

Stephen Printup
seal-mask
.a{fill-rule:evenodd;}techdegree
Stephen Printup
UX Design Techdegree Student 45,252 Points

Ok, so I think I messed up-

I found this link: http://stackoverflow.com/questions/27243418/vagrant-up-command-fails

and ran $ vagrant init hashicorp/precise32

as per https://docs.vagrantup.com/v2/getting-started/index.html

and now my command line reads vagrant@precise32:~$ instead of vagrant@homestead:~$ like in the video. I think I've installed an alternative virtual box or something, but I really have no idea. Any help to get me back on track would be appreciated.

My initial problem was that I was getting errors when running vagrant up (unable to find base or code, etc.) The current Laravel file structure is a bit different than in the video and the homestead.yaml file is in homestead/src/stubs instead of in just homestead.

Finally, I initialized vagrant like 3 times (deleting the only vagrant file I saw every time), but am still unclear on where I should put it. Does it now go in homestead/src/stubs or just in homestead. Will the vagrant up command create the code file and base file? Hmm, thanks for any help you can provide.

FYI my homestead.yaml file reads:

ip: "10.0.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: /Users/stephenprintup/.ssh/id_rsa.pub

keys:
    - /Users/stephenprintup/.ssh/id_rsa

folders:
    - map: ~/Users/stephenprintup/Homestead/Projects
      to: /Users/stephenprintup/vagrant/Sites

sites:
    - map: laravel.dev
      to: /home/vagrant/Sites/laravel-basics/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

-Stephen

This worked for me: after making changes to Homestead.yaml, you might have to run bash init.sh once more. It will ask if you want to overwrite some files (including Homestead.yaml). Say yes to everything, and you should be good to go.