securecurve
securecurve

Reputation: 5817

Vagrant shared folders wipes all the contents in my folders

In VagrantFile configuration file: config.vm.synced_folder "../nginx_config/", "/etc/nginx"

Once I add it my configuration file and reload vagrant instance, it gets the directory on guest empty I tried different possibilities to change the location of the folder nginx_config on host (my computer) but I always get the same result.

When I disable sharing, the contents of /etc/nginx on guest (vagrant)is back again.

What can be the problem here??

Upvotes: 0

Views: 97

Answers (1)

m1keil
m1keil

Reputation: 4575

When you use Vagrant's synced folders mechanism, it actually use VirtualBox's Shared Folders feature. (I assume here you use VirtualBox as provider)

Shared Folders is implemented by mounting your folder in the location you specified in similar manner as it's being done with a network shares.

In Linux if you use a mount point with existing files in it, the original files will become invisible after the mount, and reappear after unmount. See similar question.

Upvotes: 1

Related Questions