Search code examples
vagrantvirtualboxvirtualization

Vagrant vs VBox folder share


I have been using Vagrant for few months. Also I have started using Virtual box without Vagrant with sharing folders from host OS and it works well so far.

My question is why is Vagrant needed if Virtual Box can share folders without Vagrant?

Maybe I don't use Vagrant's other features so I don't need them so far.


Solution

  • Just a few things, but will probably not be exhaustive:

    • Vagrant operates multiple provider, not only Virtualbox, you can run vagrant with Virtualbox, VMWare, HyperV ... (docker as well even if there are different pros and cons) so vagrant abstracts this for you

    • vagrant can setup shared folders as you experienced, but can easily set different shared folder types (nfs, rsync ..) depending your setup

    • vagrant will manage all the networking of the VM, if you need a static IP, it will associate hostname and static IP and setup all the routes for you.

    • vagrant works well with many provisioning tools (puppet, chef, ansible ...) so you can easily create and re-created multiple times the same environment

    On top of all this, why is vagrant good to use ? In team. If you work in team, you share a vagrant file (just a ruby script file) and "magically" all your team members share the same environment to work.