How to enable two-way folder sync in Vagrant with VirtualBox?

Anton Belonovich

I haven't used Vagrant on Linux for a while. When I started using the new version (Vagrant 1.8), I was faced with a problem: files created inside the guest VM didn't appear on the host machine's synced folder.

How do I force Vagrant to sync files from the guest OS to the host OS?

Anton Belonovich

According to documentation, when type option config.vm.synced_folder parameter in Vagrantfile is not specified, Vagrant tries to choose best available option:

type (string) - The type of synced folder. If this is not specified, Vagrant will automatically choose the best synced folder option for your environment. Otherwise, you can specify a specific type such as "nfs".

Starting with version 1.5 Vagrant introduced new "rsync synced folders" feature.

So in my case type rsync was automatically chosen, which is one-way sync: from host to guest.

To make folders sync in two-way I added explicit definition in my Vagrantfile:

config.vm.synced_folder ".", "/vagrant", type: "virtualbox"

Of course, this will work only for VirtualBox.

Two way sync is useful for workflows, where apllication on guest machine creating files, for example, database migration files in modern web frameworks.

Note: virtualbox synced folders have known performance issues when your project has large amount of files.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How can I create a VM in Vagrant with VirtualBox with two CPUs?

From Dev

Vagrant / Virtualbox, shared folder out of sync when there are many file-related operation

From Dev

Vagrant sync folder not working after OSX Mavericks upgrade

From Dev

Vagrant, VirtualBox, Supervisord: When is synced folder mounted?

From Dev

How to set vagrant virtualbox video memory

From Dev

Vagrant 2 way folder sync

From Dev

How do I sync two folders using bash so a change in one folder gets reflected in a different folder?

From Dev

Vagrant: How to sync folder from guest back to host?

From Dev

Ignore synced folder files/directories with NFS as sync system for Vagrant

From Dev

Vagrant nfs sync folder issue with Ubuntu Host

From Dev

Vagrant Rsync does not sync the folder between host and guest

From Dev

Vagrant attempted to execute the capability 'mount_virtualbox_shared_folder' error

From Dev

Vagrant sync folder doesn't work on windows 10

From Dev

How to access a shared folder in VirtualBox?

From Dev

how to sync ftp folder with local folder?

From Dev

how to sync ftp folder with local folder?

From Dev

How to use ipv6 with Vagrant and VirtualBox?

From Dev

Vagrant / Virtualbox, shared folder out of sync when there are many file-related operation

From Dev

Vagrant sync folder not working after OSX Mavericks upgrade

From Dev

How to enable USB in VirtualBox

From Dev

Vagrant 2 way folder sync

From Dev

How do I sync two folders using bash so a change in one folder gets reflected in a different folder?

From Dev

How to use nfs for vagrant sync specific folders?

From Dev

How do I sync Vagrant sync folder with VirtualBox and CentOS/Windows?

From Dev

How to one way sync two folders on startup

From Dev

Enable to write in Virtualbox's shared folder

From Dev

How to respond with multiple messages in a sync (two-way) camel route?

From Dev

How to sync two textareas?

From Dev

How to connect to Mysql VirtualBox Vagrant from another VirtualBox Vagrant?

Related Related

  1. 1

    How can I create a VM in Vagrant with VirtualBox with two CPUs?

  2. 2

    Vagrant / Virtualbox, shared folder out of sync when there are many file-related operation

  3. 3

    Vagrant sync folder not working after OSX Mavericks upgrade

  4. 4

    Vagrant, VirtualBox, Supervisord: When is synced folder mounted?

  5. 5

    How to set vagrant virtualbox video memory

  6. 6

    Vagrant 2 way folder sync

  7. 7

    How do I sync two folders using bash so a change in one folder gets reflected in a different folder?

  8. 8

    Vagrant: How to sync folder from guest back to host?

  9. 9

    Ignore synced folder files/directories with NFS as sync system for Vagrant

  10. 10

    Vagrant nfs sync folder issue with Ubuntu Host

  11. 11

    Vagrant Rsync does not sync the folder between host and guest

  12. 12

    Vagrant attempted to execute the capability 'mount_virtualbox_shared_folder' error

  13. 13

    Vagrant sync folder doesn't work on windows 10

  14. 14

    How to access a shared folder in VirtualBox?

  15. 15

    how to sync ftp folder with local folder?

  16. 16

    how to sync ftp folder with local folder?

  17. 17

    How to use ipv6 with Vagrant and VirtualBox?

  18. 18

    Vagrant / Virtualbox, shared folder out of sync when there are many file-related operation

  19. 19

    Vagrant sync folder not working after OSX Mavericks upgrade

  20. 20

    How to enable USB in VirtualBox

  21. 21

    Vagrant 2 way folder sync

  22. 22

    How do I sync two folders using bash so a change in one folder gets reflected in a different folder?

  23. 23

    How to use nfs for vagrant sync specific folders?

  24. 24

    How do I sync Vagrant sync folder with VirtualBox and CentOS/Windows?

  25. 25

    How to one way sync two folders on startup

  26. 26

    Enable to write in Virtualbox's shared folder

  27. 27

    How to respond with multiple messages in a sync (two-way) camel route?

  28. 28

    How to sync two textareas?

  29. 29

    How to connect to Mysql VirtualBox Vagrant from another VirtualBox Vagrant?

HotTag

Archive