Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Vagrant
Vagrant

4.5K
3.2K
+ 1
1.5K
VirtualBox
VirtualBox

7.8K
6.1K
+ 1
1.1K
Add tool

Vagrant vs VirtualBox: What are the differences?

What is Vagrant? A tool for building and distributing development environments. Vagrant provides the framework and configuration format to create and manage complete portable development environments. These development environments can live on your computer or in the cloud, and are portable between Windows, Mac OS X, and Linux.

What is VirtualBox? Run nearly any operating system on a single machine and to freely switch between OS instances running simultaneously. VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2.

Vagrant can be classified as a tool in the "Virtual Machine Management" category, while VirtualBox is grouped under "Virtualization Platform".

Some of the features offered by Vagrant are:

  • Boxes
  • Up And SSH
  • Synced Folders

On the other hand, VirtualBox provides the following key features:

  • Portability
  • No hardware virtualization required
  • Guest Additions: shared folders, seamless windows, 3D virtualization

"Development environments", "Simple bootstraping" and "Free" are the key factors why developers consider Vagrant; whereas "Free", "Easy" and "Default for vagrant" are the primary reasons why VirtualBox is favored.

Vagrant is an open source tool with 18.6K GitHub stars and 3.74K GitHub forks. Here's a link to Vagrant's open source repository on GitHub.

According to the StackShare community, VirtualBox has a broader approval, being mentioned in 721 company stacks & 944 developers stacks; compared to Vagrant, which is listed in 802 company stacks and 475 developer stacks.

- No public GitHub repository available -

What is Vagrant?

Vagrant provides the framework and configuration format to create and manage complete portable development environments. These development environments can live on your computer or in the cloud, and are portable between Windows, Mac OS X, and Linux.

What is VirtualBox?

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose Vagrant?
Why do developers choose VirtualBox?

Sign up to add, upvote and see more prosMake informed product decisions

    Be the first to leave a con
    What companies use Vagrant?
    What companies use VirtualBox?

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Vagrant?
    What tools integrate with VirtualBox?

    Sign up to get full access to all the tool integrationsMake informed product decisions

    What are some alternatives to Vagrant and VirtualBox?
    Ansible
    Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s goals are foremost those of simplicity and maximum ease of use.
    Packer
    Packer automates the creation of any type of machine image. It embraces modern configuration management by encouraging you to use automated scripts to install and configure the software within your Packer-made images.
    Terraform
    With Terraform, you describe your complete infrastructure as code, even as it spans multiple service providers. Your servers may come from AWS, your DNS may come from CloudFlare, and your database may come from Heroku. Terraform will build all these resources across all these providers in parallel.
    OpenStack
    OpenStack is a cloud operating system that controls large pools of compute, storage, and networking resources throughout a datacenter, all managed through a dashboard that gives administrators control while empowering their users to provision resources through a web interface.
    Docker
    The Docker Platform is the industry-leading container platform for continuous, high-velocity innovation, enabling organizations to seamlessly build and share any application — from legacy to what comes next — and securely run them anywhere
    See all alternatives
    Decisions about Vagrant and VirtualBox
    Tymoteusz Paul
    Tymoteusz Paul
    Devops guy at X20X Development LTD · | 13 upvotes · 281.9K views
    Amazon EC2
    Amazon EC2
    LXC
    LXC
    CircleCI
    CircleCI
    Docker
    Docker
    Git
    Git
    Vault
    Vault
    Apache Maven
    Apache Maven
    Slack
    Slack
    Jenkins
    Jenkins
    TeamCity
    TeamCity
    Logstash
    Logstash
    Kibana
    Kibana
    Elasticsearch
    Elasticsearch
    Ansible
    Ansible
    VirtualBox
    VirtualBox
    Vagrant
    Vagrant

    Often enough I have to explain my way of going about setting up a CI/CD pipeline with multiple deployment platforms. Since I am a bit tired of yapping the same every single time, I've decided to write it up and share with the world this way, and send people to read it instead ;). I will explain it on "live-example" of how the Rome got built, basing that current methodology exists only of readme.md and wishes of good luck (as it usually is ;)).

    It always starts with an app, whatever it may be and reading the readmes available while Vagrant and VirtualBox is installing and updating. Following that is the first hurdle to go over - convert all the instruction/scripts into Ansible playbook(s), and only stopping when doing a clear vagrant up or vagrant reload we will have a fully working environment. As our Vagrant environment is now functional, it's time to break it! This is the moment to look for how things can be done better (too rigid/too lose versioning? Sloppy environment setup?) and replace them with the right way to do stuff, one that won't bite us in the backside. This is the point, and the best opportunity, to upcycle the existing way of doing dev environment to produce a proper, production-grade product.

    I should probably digress here for a moment and explain why. I firmly believe that the way you deploy production is the same way you should deploy develop, shy of few debugging-friendly setting. This way you avoid the discrepancy between how production work vs how development works, which almost always causes major pains in the back of the neck, and with use of proper tools should mean no more work for the developers. That's why we start with Vagrant as developer boxes should be as easy as vagrant up, but the meat of our product lies in Ansible which will do meat of the work and can be applied to almost anything: AWS, bare metal, docker, LXC, in open net, behind vpn - you name it.

    We must also give proper consideration to monitoring and logging hoovering at this point. My generic answer here is to grab Elasticsearch, Kibana, and Logstash. While for different use cases there may be better solutions, this one is well battle-tested, performs reasonably and is very easy to scale both vertically (within some limits) and horizontally. Logstash rules are easy to write and are well supported in maintenance through Ansible, which as I've mentioned earlier, are at the very core of things, and creating triggers/reports and alerts based on Elastic and Kibana is generally a breeze, including some quite complex aggregations.

    If we are happy with the state of the Ansible it's time to move on and put all those roles and playbooks to work. Namely, we need something to manage our CI/CD pipelines. For me, the choice is obvious: TeamCity. It's modern, robust and unlike most of the light-weight alternatives, it's transparent. What I mean by that is that it doesn't tell you how to do things, doesn't limit your ways to deploy, or test, or package for that matter. Instead, it provides a developer-friendly and rich playground for your pipelines. You can do most the same with Jenkins, but it has a quite dated look and feel to it, while also missing some key functionality that must be brought in via plugins (like quality REST API which comes built-in with TeamCity). It also comes with all the common-handy plugins like Slack or Apache Maven integration.

    The exact flow between CI and CD varies too greatly from one application to another to describe, so I will outline a few rules that guide me in it: 1. Make build steps as small as possible. This way when something breaks, we know exactly where, without needing to dig and root around. 2. All security credentials besides development environment must be sources from individual Vault instances. Keys to those containers should exist only on the CI/CD box and accessible by a few people (the less the better). This is pretty self-explanatory, as anything besides dev may contain sensitive data and, at times, be public-facing. Because of that appropriate security must be present. TeamCity shines in this department with excellent secrets-management. 3. Every part of the build chain shall consume and produce artifacts. If it creates nothing, it likely shouldn't be its own build. This way if any issue shows up with any environment or version, all developer has to do it is grab appropriate artifacts to reproduce the issue locally. 4. Deployment builds should be directly tied to specific Git branches/tags. This enables much easier tracking of what caused an issue, including automated identifying and tagging the author (nothing like automated regression testing!).

    Speaking of deployments, I generally try to keep it simple but also with a close eye on the wallet. Because of that, I am more than happy with AWS or another cloud provider, but also constantly peeking at the loads and do we get the value of what we are paying for. Often enough the pattern of use is not constantly erratic, but rather has a firm baseline which could be migrated away from the cloud and into bare metal boxes. That is another part where this approach strongly triumphs over the common Docker and CircleCI setup, where you are very much tied in to use cloud providers and getting out is expensive. Here to embrace bare-metal hosting all you need is a help of some container-based self-hosting software, my personal preference is with Proxmox and LXC. Following that all you must write are ansible scripts to manage hardware of Proxmox, similar way as you do for Amazon EC2 (ansible supports both greatly) and you are good to go. One does not exclude another, quite the opposite, as they can live in great synergy and cut your costs dramatically (the heavier your base load, the bigger the savings) while providing production-grade resiliency.

    See more
    Tim Abbott
    Tim Abbott
    Founder at Zulip · | 2 upvotes · 7.7K views
    atZulipZulip
    Zulip
    Zulip
    Vagrant
    Vagrant
    VirtualBox
    VirtualBox

    We use VirtualBox primarily as a Vagrant provider for macOS for the Zulip development environment. It's totally reasonable software for providing a convenient virtual machine setup on macOS (and for debugging when things go wrong, which is mostly how we use it since the Vagrant provider for macOS just works).

    See more
    Interest over time
    Reviews of Vagrant and VirtualBox
    Avatar of SauloNunes
    Business Analyst with skills in FullStack Development Desktop Web and Mobile at LeanWork
    Review ofVirtualBoxVirtualBox

    Sometimes you will need to customize your virtualbox and you can easily add virtualbox commands inside your vagrantfile

    Example of USB connection Share Between Host and VM

    #Use $VBoxManage list usbhost To list Usb Ports and Get Your Device VENDORID and PRODUCTID
    
    v.customize ["modifyvm", :id, "--usb", "on"]
    
    v.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'ESP', '--vendorid', '0x22b8', '--productid', '0x2e76']
    
    How developers use Vagrant and VirtualBox
    Avatar of Airbnb
    Airbnb uses VagrantVagrant

    "The best way to ensure that local testing was possible was to normalize people’s dev environments. For this we chose Vagrant. This, combined with Chef, allows us to do our local dev in sandboxed Linux instances running locally via VirtualBox in a configuration as similar to production as possible. In addition to making dev environment setup much easier than it used to be, this ensures that each engineer has a consistent environment that is ready to run tests out of the box. The user SSHs into the local linux server and runs spec commands like they would on their host OS, and generally everything Just Works. Most people on our team combine this with Zeus, which allows the Rails environment to be preloaded for lightning fast (relatively speaking) test runs. Both Vagrant and Zeus have their share of issues, but in practice we’ve found them to be a huge time saver."

    Avatar of Ana Phi Sancho
    Ana Phi Sancho uses VirtualBoxVirtualBox

    Network and security programs. install and run multiple operating systems. Good to understand computer networks - internet and multiple services, such as the world wide web; and the opportunities they offer for communication (combine a variety of software and services)

    Avatar of GHA Technologies
    GHA Technologies uses VagrantVagrant

    Not blazing fast but we pick Vagrant for all our projects because the console mode without gui leads to a low consumption of ram memory making it the best way for DevOps ready environment requiring less configuration.

    Avatar of Cyrus Stoller
    Cyrus Stoller uses VagrantVagrant

    Vagrant allows me to ensure that anyone I'm collaborating with will be able to test my web application in the same environment. I also use Vagrant to setup VMs that I can use to refine my Capistrano recipes.

    Avatar of Dynamictivity
    Dynamictivity uses VagrantVagrant

    We use Virtualbox in combination with Vagrant during development to ensure a consistent test/development environment. This helps to reduce the number of defects when our software goes to production.

    Avatar of Dynamictivity
    Dynamictivity uses VirtualBoxVirtualBox

    We use Virtualbox in combination with Vagrant during development to ensure a consistent test/development environment. This helps to reduce the number of defects when our software goes to production.

    Avatar of Cyrus Stoller
    Cyrus Stoller uses VirtualBoxVirtualBox

    For running a VM locally with Vagrant. It can be a little irritable, but it's open source and free, so I'm not complaining. I would probably use VMWare, but I don't want to pay for it right now.

    Avatar of davidk01
    davidk01 uses VirtualBoxVirtualBox

    Virtualbox is managed by Vagrant and it sets up a local development environment so that anyone can test their changes before pushing the changes upstream.

    Avatar of Software Antelope
    Software Antelope uses VagrantVagrant

    Building development environments that closely match real world web environments, enabling more rapid and accurate testing and development.

    Avatar of Tim De Lange
    Tim De Lange uses VirtualBoxVirtualBox

    Development test boxes. I dont like virtualbox that much - but for a while it was the only free vmware alternative.

    How much does Vagrant cost?
    How much does VirtualBox cost?
    Pricing unavailable
    Pricing unavailable