0
votes

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

2
Can you show the synced folders portion of your Vagrantfile?Railslide
I have added the screenshot in the questionzurik
That's not the Vagrantfile @zurik - anyway, you shouldn't run vagrant up (or any vagrant command) with sudoRailslide
@Railslide Oh sorry. I have added a small aspect of it showing the shared folder. However, as you can see, it is all about default settings. I did not see the need to change them from that yet as vagrant automatically picked it upzurik

2 Answers

1
votes

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.

0
votes

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