Vagrant Synced Folder Defaults: Transitioning Between Providers in Version 2
0 reputation · 17 Dec 2020, 06:51 UTC
Goal
To understand how the default synced‑folder type in Vagrant 2.x changes when switching providers and what explicit configuration is required to maintain consistent behavior.
Constraints
- Vagrantfile must use config version 2 – mixing version 1 and 2 is unsupported.
- Different providers (VirtualBox, NFS, SMB, rsync) apply distinct default sync mechanisms.
- Bidirectional sync is not guaranteed by default; rsync is one‑way host‑to‑guest.
Unresolved Decision
When a project moves from VirtualBox to, say, VMware or a non‑VirtualBox provider, the default synced‑folder type switches from VirtualBox shared folders to either rsync or NFS (depending on provider support). This shift can break expected file visibility and edit flow, especially on Windows hosts where NFS is unavailable.
Questions
- What explicit config entries are needed in a Vagrantfile to force a specific synced‑folder type (e.g., rsync, nfs, smb) across all supported providers?
- How does the bidirectional sync behavior differ between VirtualBox shared folders and rsync‑based folders, and what are the best practices to keep guest and host files in sync?
- Are there provider‑specific limitations (e.g., Windows host constraints) that require conditional logic in the Vagrantfile to avoid runtime failures?