1
1
Still learning a bit about Vagrant, but here it goes. I have a pretty standard guest vm that has some software installed. I would like to access a few directories within the guest in a read/write fashion. So I added the config for a shared folder as follows:
config.vm.share_folder "test", "/home/vagrant/test", "./test"
Keep in mind I have content in my test folder. I need to be able to view and update that from the host. However, when I 'vagrant reload' with the empty host directory called test, all of the content on my guest is removed.
Is it possible to create a shared folder in which I can access content on the guest without destroying existing content?
If you want to share from guest to host, you can still do it one of the standard ways e.g. with a Samba share, or fuse-ssh. One of the advantages of vagrant mapping a host folder to the VM is you can easily share files between VMs via the host. This way round also makes it easier to edit files on the host but test on the guest, a common development pattern. – Ben XO – 2014-11-24T17:24:26.907
1Shared folders share a folder on the host machine with the guest machine, not the other way around. – heavyd – 2013-03-02T00:04:43.733
Thats what I was afraid of, thanks for the response. – DocWatson – 2013-03-04T17:13:18.260