Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharing a directory from the VM to the host

I use config.vm.synced_folder to sync folders from the host to the VM, but I'd like to sync it in the other direction. Is this possible using vagrant/virtualbox?

like image 818
Vlad the Impala Avatar asked Aug 01 '13 18:08

Vlad the Impala


People also ask

How do I map a drive to a VM to host?

From the VMWare Player menu: VM / Settings / Options Tab / Shared Folders. Click Add and enter the drive lettter (D:) as the host path. Enable the share. From a Windows Explorer Window in the guest OS, map the desired drive letter to the VMWare share.

How do I share a folder between guest and host in VirtualBox?

To share a host folder with a virtual machine in Oracle VM VirtualBox, you must specify the path of the folder and choose a share name that the guest can use to access the shared folder. This happens on the host. In the guest you can then use the share name to connect to it and access files.


1 Answers

By default Vagrant uses VirtualBox's vboxsf to sync folders between host and guest.

It is two way, so if you make changes to the files in /vagrant_data in the guest, it changes the corresponding files in the host's directory. You don't need to do it again the other way around.

Other options to sync files:

  1. rsync
  2. sshfs
  3. NFS

See more => Synced Folders

like image 194
Terry Wang Avatar answered Sep 30 '22 21:09

Terry Wang