Sharing a directory from a virtual machine to a host

I use config.vm.synced_folder to synchronize folders from the host to the VM, but I would like to sync it in the other direction. Can I use a firewall / virtual box?

+6
source share
2 answers

By default, Vagrant uses VirtualBox vboxsf to synchronize folders between the host and the guest.

These are two ways, so if you make changes to the files in /vagrant_data on the guest system, it changes the corresponding files in the host directory. You do not need to do it again the other way around.

Other options for synchronizing files:

  • Rsync
  • Sshfs
  • Nfs

Details => Synchronized Folders

+2
source

If I understand correctly, you want to create a shared folder for Vagrant, where files are added from the guest machine and should be displayed on the main machine?

If this happens, you still have to create a host folder. I'm afraid that Vagrant will not create a directory for you from the config.vm.synced_folder line in your Vagrantfile, but it will work fantastically after the host directory exists.

+1
source

Source: https://habr.com/ru/post/950845/


All Articles