zurik
zurik

Reputation: 513

Vagrant shared folders on El Capitan

Whenever I start my vagrant box and check with virtual box on listed boxes, it does not recognize the virtual machine. More to that, the shared folders mounts well but does not actually work. I created a folder in the host machine that cannot be seen in the guest VM.

This is what I did:

  1. I installed vagrant
  2. I initialized and added a box from hashicorp/trust64
  3. Using the vb-guest plugin, my virtual guest additions were updated automatically

Running vagrant up and ssh runs my virtual box well, syncs my shared folders however, I cannot see any shared files in either the host or guest. Each has its own files

enter image description here

enter image description here

Upvotes: 0

Views: 350

Answers (2)

Railslide
Railslide

Reputation: 5564

You should run vagrant run and any other vagrant command without sudo.

In this case you probably have to destroy the virtual machine first with sudo vagrant destroy (this time with sudo since you created with it), and delete the Vagrantfile in your project root folder. Then run again

vagrant init
vagrant up

Last but not least, if you are using NFS for shared folder (although that shouldn't be your case) you might have to adjust your sudoers. See Vagrant docs https://docs.vagrantup.com/v2/synced-folders/nfs.html

Upvotes: 0

Frederic Henri
Frederic Henri

Reputation: 53793

As @Railslide mentioned, the fact you run the command with sudo gets you an issue with permission, your sudo user will not be able to write into the directory (owned by your user) you could workaround by setting specific permission in the Vagrantfile for the synced_folder part but really run the command with your user and everything will go normal.

Upvotes: 1

Related Questions