How to sync folder with vagrant in windows?

Member

by adan , in category: Third Party Scripts , 4 months ago

How to sync folder with vagrant in windows?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by jasen , 4 months ago

@adan 

To sync a folder with Vagrant in Windows, you can use the config.vm.synced_folder option in your Vagrantfile. Here's how you can do it:

  1. Open your Vagrantfile in a text editor.
  2. Add a line like the following to sync a folder from your host machine to the guest machine: config.vm.synced_folder "path/to/host/folder", "/path/to/guest/folder"
  3. Replace "path/to/host/folder" with the path to the folder on your host machine that you want to sync with the guest machine, and "/path/to/guest/folder" with the path where you want to sync the folder on the guest machine.
  4. Save the Vagrantfile and run vagrant reload to apply the changes.


Now, the specified folder on your host machine will be synced with the specified folder on the guest machine every time you start or reload the Vagrant environment. Any changes made in the synced folder on either the host or the guest machine will be automatically reflected in the other.