Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between shared folder and synced folder in Vagrant?

Tags:

vagrant

While going through Vagrant tutorials, I have seen two options for sharing folders between host and guest machines - shared folders and synced folders. What are the difference between them?

Or, is synced folder the new name for shared folder, in Vagrant 2?

like image 826
Joyce Babu Avatar asked Jul 23 '13 17:07

Joyce Babu


People also ask

Which is the default shared folder created on the guest machines by vagrant?

By default, Vagrant shares your project directory (the one containing the Vagrantfile) to the /vagrant directory in your guest machine.

Where is .vagrant folder?

vagrant on the other hand is in you environment/project directory and holds individual projects settings i.e. your current VM settings. Whenever you create and execute a vagrantfile, a . vagrant directory is created with VM specific data.

What is vagrant Vagrantfile?

A Basic Vagrantfile A Vagrantfile is a Ruby file that instructs Vagrant to create, depending on how it is executed, new Vagrant machines or boxes. You can see a box as a compiled Vagrantfile. It describes a type of Vagrant machines. From a box, we can create new Vagrant machines.

What is NFS in vagrant?

NFS is a faster way of sharing your project's files between host and guests that sync the files instantly. To use NFS with Vagrant, nfs-utils package needs to be installed and nfs-server needs to be running. If it is not, run: $ sudo dnf install nfs-utils && sudo systemctl enable nfs-server.


2 Answers

Shared Folders is more VirtualBox specific (vboxsf) and have known performance issues as number of files grows.

Vagrant v2 (For vagrant 1.1.x and 1.2.x) docs use a more generic name Synced Folder, which includes the default vboxsf and NFS.

In addition to vboxsf and NFS, sshfs is also worth looking into if your host is running Linux.

like image 97
Terry Wang Avatar answered Oct 08 '22 22:10

Terry Wang


As you guessed, synced folder is the new, more generic name for a feature that is not only VirtualBox specific anymore as of Vagrant 1.1.

like image 33
cmur2 Avatar answered Oct 08 '22 21:10

cmur2