Error when running vagrant: "The host path of the shared folder is missing"
Asked Answered
J

6

15

I have downloaded a Vagrantfile, but when i run vagrant up in terminal the following message appears:

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

OBS.: Using Ubuntu 14.10


I created a folder named Sync in my home.

Jaredjarek answered 15/3, 2015 at 0:14 Comment(2)
Did you ever figure out this answer ?Useful
Can you share your Vagrantfile?Lippert
F
10

According to Vagrant docs host path must be either absolute (i.e. /home/user/Sync) or relative to project root (place where your Vagrantfile is).

Relative to project root means if your Vagrantfile resides in /home/user/MyProject then setting up path as "Sync" will create share from /home/user/MyProject/Sync.

Ref: http://docs.vagrantup.com/v2/synced-folders/basic_usage.html

Farthermost answered 9/8, 2015 at 9:11 Comment(0)
B
1

In my case it was a space at the end of the path in config.yaml:

 source: '/Users/h/Packt/Code '

I've deleted this space and it's working now.

Biconvex answered 5/7, 2017 at 10:9 Comment(0)
D
1

If you are using Vagrant and Windows Subsystem for Linux then you can solve the issue creating a symlink

ln -s /mnt/c/Users/user/project ~/project
  • /mnt/c/Users/user/project should match the Vagrant project in your Windows machine.
  • ~/project should match the path that is missing.

Note, that you may need to create any intermediary directories.

Defluxion answered 1/8, 2018 at 16:8 Comment(1)
i had a space in the folder name in windows (no WSL) - symlinking solved my issueAristate
W
1

I assumed you are in linux or mac. Type in "pwd" and enter in the terminal where Homestead.yml is.

Mine is "/home/idhamhafidz/Code/opp190-ama"

Then go to your Homestead.yml and edit the folders section like in the image below: enter image description here

Then quit edit Homesteady.yml and re-run vagrant up again.

Warila answered 8/4, 2019 at 10:7 Comment(0)
W
1

I know this is an old question, but for anyone just encountering this issue and having a hard time finding a conclusion the answer by @megawebmaster would be the correct approach in giving the relative path to the folder: "/home/(your-pc-username)/Sync/".

Also with a Vagrantfile being ruby-based I personally use ruby's ENV object: #{ENV["HOME"]}/Sync should resolve the issue.

Wizardly answered 5/8, 2022 at 2:34 Comment(0)
M
1

I came across the same problem and mkdir ~/Sync help me solve it.

Marenmarena answered 15/8, 2022 at 6:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.