1

I am on macOS and have installed virtualbox, vagrant & laravel homestead following the setup at https://laravel.com/docs/5.6/homestead.

My versions are:

  • macOS 10.14.4
  • vagrant 2.2.4
  • vagrant box : laravel/homestead 7.2.1
  • virtualbox 5.2.28r130011

When I run vagrant up I get the error:

homestead-7: Unable to mount one of your folders. Please check your folders in Homestead.yaml

My Homestead.yaml file is

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

sites:
    - map: firstproject.test
      to: /home/vagrant/code/public

When I go onto the virtual machine using vagrant ssh I can see that the files from my local have been synced on the virtual box to:

/vagrant/code

and not to

/home/vagrant/code

Why is this happening and how can I fix it?

0

Problem was caused by adding the code folder to the wrong place in the file system.

Folder was added to ~/Homestead/code instead of ~/code as per the Homestead.yaml file

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

Why did it sync to /vagrant on the VM?

from https://www.vagrantup.com/docs/synced-folders/index.html

"By default, Vagrant will share your project directory (the directory with the Vagrantfile) to /vagrant."

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.