How to sync folder with vagrant in windows?

Member

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

How to sync folder with vagrant in windows?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by jasen , 10 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.

Related Threads:

How to use yaml files with vagrant?
How to set up a vagrant working directory?
How to run a vagrant task on "vagrant destroy"?
How to download pdf file from public folder in symfony?
How to sync branches in git?
How to sync with the original repository in bitbucket?