
Vagrant 2.0 - nikolay
https://www.hashicorp.com/blog/hashicorp-vagrant-2-0/
======
geerlingguy
Since many people are still not too familiar with Vagrant (it doesn't seem to
have the cachet of Docker for local dev environments), here are a few example
Vagrant configurations that I use to build different servers for local
testing/debugging: [https://github.com/geerlingguy/ansible-vagrant-
examples](https://github.com/geerlingguy/ansible-vagrant-examples)

There are plenty of other great examples of Vagrant usage around the web, too,
from Laravel's Homestead to (disclosure, I maintain it) Drupal VM.

It seems a lot of older applications / communities migrate towards Vagrant as
some of the things they do are harder (or at least not as straightforward yet)
to implement in containers.

~~~
ArlenBales
> _Since many people are still not too familiar with Vagrant (it doesn 't seem
> to have the cachet of Docker for local dev environments)_

That's only a recent trend. Up until Docker became the standard a couple years
ago (or whenever Docker for Mac was made stable), Vagrant was the standard for
dev environments. The primary reason Docker succeeded Vagrant for dev
environments is speed. Docker can have my dev environment up from scratch in
seconds, but with Vagrant it took minutes.

~~~
aidenn0
Also the early reliance on virtualbox was a performance issue for some build
environments even once they were up. I have at least one C++ project that (for
windows) takes 8x as long to build on vbox vs. a real machine.

~~~
TwelveNights
Wow, it doesn't rely on VirtualBox anymore? I remember using it before for the
development environment of an old company, and that being a small nuisance.

Nowadays, Docker is really miles ahead in terms of usage in development
environments. Vagrant was pretty easy to set-up and use back then, but now
Docker is much, much easier.

~~~
porker
I need to get into this Docker malarkey for dev machines.

Running on Windows, how do you share files between the Docker image and the
host machine? With Vagrant I use NFS.

~~~
TwelveNights
To expand on the other commentor, check out volumes:
[https://docs.docker.com/engine/admin/volumes/volumes/](https://docs.docker.com/engine/admin/volumes/volumes/).

------
jimmar
Just from the version number I thought there'd be a few major changes, but
really it just seems like another point release that happens to increment the
major version number. (Which is totally fine by me. I rely on Vagrant a lot
and I'm glad the new version doesn't introduce breaking changes). Change log
is here:
[https://github.com/mitchellh/vagrant/blob/v2.0.0/CHANGELOG.m...](https://github.com/mitchellh/vagrant/blob/v2.0.0/CHANGELOG.md)

~~~
mitchellh
Its a focus on stability and we don't want you to be thinking about Vagrant
either when you upgrade. We just want it to work. :)

However, I want to be clear its not a marketing tactic in any way (re: hosh
below, with an excellent comment!). It ends up being that implicitly but we
waited and developed Vagrant 1.x for 5 years prior to calling it a 2.0 because
we had a lot of goals we wanted to achieve: multi-provider, fantastic Windows
support, stable installers, etc. We feel we've now achieved that in a very
stable way, so its time to call it 2.0.

This breakpoint for us allows us to begin planning and executing on larger
changes. Of course, we'll do all of this thoughtfully since Vagrant is
definitely a tool you want to "just work" today and not think about breaking
your envs. I admit this does happen from time to time though and I'm sorry
about that, but we're getting better.

~~~
SiVal
The actual nature of the product itself is what ultimately matters, of course,
and I hear your's is outstanding, so good work.

It's a less-important issue and just a convention, not a law, but normally
v1.36.12 tells me "focused on stability and just working--boring but rock-
solid", while 2.0.0 tells me "first release of great, new features--amazing
but don't put too much weight on it yet". I wouldn't ordinarily think of 2.0.0
as the most-stable version of 1.x with 2.0.1 being the less-stable
introduction of the great, new features.

~~~
anonymousDan
I would think the opposite can often be the case. Usually a major version is
where you get to remove a load of unused features since you can make breaking
changes.

~~~
derimagia
Removing features could itself cause issues, and when you put that with adding
new features/backwards 2.0.0 releases are almost never as "rock solid" as a
1.0.0 with a bunch of minor/patch versions as long as you're using semver.

------
marcosscriven
There are still times I look to Vagrant instead of, and alongside, Docker.

The reason being Docker for Mac uses a VM anyway (an xhvye machine) - it does
try to hide/abstract this away, but inevitably this leaks. The xhyve VM has
the usual parameters memory, diskspace, CPUs, and not least a kernel. There
are limited options to fiddle with these parameters, though you can log into
it and poke around there. I thus find it easier to just have setup Vagrant
machines with Docker - then I have better control over those things.

If I were on a Linux distro though, I'd probably use Vagrant a lot less.

~~~
alinspired
Vagrant with KVM/libvirt works great on Linux and doesn't stop you from using
docker. VirtualBox is inconvenience on Linux, not Vagrant

~~~
fulafel
The community is built on Vagrant-VB configs and images, so you don't really
get the main benefit of Vagrant if you want to use it with something else than
VirtualBox.

~~~
4ad
I disagree by saying that I don't think you really get the main benefit of
Vagrant if you want to use it with other people's boxes.

Also, since the rise of virtio (thank goodness), you can easily make boxes
that work on VB/VMware/KVM, and probably others too, and indeed, many boxes
work like that.

------
jitl
In the change log, I’m happy to see “improved the resilience of some
Virtualbox commands.” At Airbnb, we used to use Vagrant with Virtualbox and
the Chef provisioner to create our dev environments, but we migrated totally
away from Vagrant after struggling with Virtualbox bugs, and strangeness with
Vagrant’s internal state and locking.

Seems like this issue is finally addressed:
[https://github.com/mitchellh/vagrant/issues/8468](https://github.com/mitchellh/vagrant/issues/8468)

Vagrant is a fantastic tool because of its flexibility, but that flexibility
comes at cost: there are sometimes bugs and performance issues where the
different Vagrant components don’t quite mesh perfectly.

~~~
scrollaway
Vagrant's really falls short of its promise of "the exact same dev environment
for everyone" in my experience, especially because of VirtualBox issues such
as, for example, relative symlinks breaking if done in a shared folder on a
mismatched guest/host OS.

It's been such a source of frustration that there is no better shared folder
alternative. VirtualBox is the only usable cross-platform backend, and vbox
shared folders are the only way to have two-way syncing between guest and
host. I don't understand why it's so poorly supported :/

~~~
jitl
Shared filesystems of any sort are too slow for most application development
purposes, especially if you've got a process like NPM on one of the sides
trying to read and write 2.5gb of Javascript files.

We saw a 30% speedup in one of our apps by switching from NFS to two-way
syncing between "native" filesystems using Unison.

See mitchellh's blog post on the subject:

[http://mitchellh.com/comparing-filesystem-performance-in-
vir...](http://mitchellh.com/comparing-filesystem-performance-in-virtual-
machines)

~~~
gaius
_trying to read and write 2.5gb of Javascript files_

The technical term for this is "doing it wrong"

------
leetrout
I just realized they discontinued Otto (shows how far out of the loop I am).

Sounds like _some_ of the mission for Otto lives on...

[https://www.hashicorp.com/blog/otto/](https://www.hashicorp.com/blog/otto/)

[https://www.hashicorp.com/blog/decommissioning-
otto/](https://www.hashicorp.com/blog/decommissioning-otto/)

------
thrownhwn
Anybody know if they has code-signed their Windows and macOS binaries with
2.0?

It's a shame so many "core" developer tools are not code-signed. It makes life
hard in companies where binary whitelisting is used.

~~~
korzun
> It makes life hard in companies where binary whitelisting is used.

The application would still have to be audited, signed or not, prior to
whitelisting.

~~~
sslalready
In practise it's much easier to just trust well-known developers by
whitelisting their code-signing certificates.

You could still get owned, of course, but the benefit here is that you're
excluding everything not explicitly whitelisted, including drive-by downloads,
crap on portable devices or random programs downloaded off the internet that
someone thinks will solve their problem of the day.

When people do not code-sign their software every software update is painful.
At work, where we run
[https://github.com/google/santa](https://github.com/google/santa), it
frequently happens that companies with code-signed software forget to code-
sign their auto-updater, or random binaries that run during installation. Most
of the time the application crashes/hang during the update (because some piece
weren't allowed to run), only to remind to you update the software again when
you restart the application.

~~~
aoeuasdf1
Does santa work with brew? If not, how do you even function?

~~~
sslalready
Personally I've managaged to avoid using it so far. But yes, you can whitelist
individual binaries or even directories. The lack of code-signing doesn't
prevent whitelisting, it just makes your life harder than necessary.

------
sciurus
Does the major version bump signify any major changes? The blog post and
changelog don't seem to describe any.

~~~
randlet
"Vagrant 1.0 was released in 2013 as a stable release. Vagrant 1.0 only
supported VirtualBox as a provider, only supported a handful of Linux
operating systems as guests, and supported a simple up/destroy workflow. Since
Vagrant 1.0, we've added support for multi-providers such as VMware and
Docker, guests such as Windows, macOS, and complex workflows including
snapshots. These major changes are followed by hundreds of improvements and
bug fixes."

~~~
acranox
I think the person you replied to was asking about major changes from the last
1.x release, to v2.0. Of which, there don't appear to be any major ones.

------
Kiro
How does Vagrant work with Docker? Why do you need Vagrant if you're using
Docker?

~~~
wuunderbar
Vagrant lets you provision in a codified manner full-fledge VMs. This code can
be pulled down by your developers to deploy a development environment on their
machines. Inside of this you can choose to run containers of your apps with
proper tooling built around it.

~~~
mateuszf
Can't you do the same thing with docker, docker compose?

~~~
moondev
No, because containers are processes not vms.

------
KZeillmann
What's the use case where I'd want to use Vagrant instead of Docker?

~~~
thrownhwn
Docker is a fragmented mess network wise if you need to support developers on
both windows and macOS. Also, docker requires hyper-v and admin privs on
Windows. And you can't run VirtualBox with hyper-v active so you need to
choose either of the two options. Granted, you could run Docker in virtualbox
but it wouldn't be very clean.

~~~
spilk
The whole Hyper-V thing with the default Docker for Windows stuff has put me
off - is there a workaround to go back to using a VirtualBox VM again? I do a
fair amount of development on Windows machines along with Mac/Linux so I need
something that works consistently among all those platforms.

Vagrant is filling the void for some of those projects since it just works
with no fuss on Mac/Windows/Linux without forcing me to use Hyper-V.

~~~
yebyen
Absolutely, you can boot your preferred distribution for running Docker on[1]
(using Vagrant even! setting the provider to VirtualBox), forward the port
that Docker is running on (2376?) to your physical host/localhost[2], and set
a few variables on the client machine to get your docker client talking to
that ("remote") docker daemon[3]

[1]: [https://coreos.com/os/docs/latest/booting-on-
vagrant.html](https://coreos.com/os/docs/latest/booting-on-vagrant.html)

[2]:
[https://www.vagrantup.com/docs/networking/forwarded_ports.ht...](https://www.vagrantup.com/docs/networking/forwarded_ports.html)

[3]:
[https://docs.docker.com/machine/reference/env/](https://docs.docker.com/machine/reference/env/)

Or, as tmzt mentioned, minikube and minishift will also let you set --vm-
driver=virtualbox on start. Those are nice even if you don't want to use
Kubernetes (but there are plenty of options.)

------
digitalzombie
Sweet. I love vagrant.

I recently got to program again and set up a box and was pleasantly suprise
that it does self provisioning too.

I wrote up ansible script and self provision my box.

------
gaius
I like Vagrant as a concept but on Azure at least, it's pretty bad at clearing
up after "vagrant destroy", and people I know report similar with VirtualBox.
To the point at which you might as well just bake an image and clone it, which
is very easy.

------
erikb
Not to pull down the emotions here, but if the whole blog post is not saying
more than "Hashicorp Vagrant 2.0" I doubt that there will be some meaningful
content in that version. Was Vagrant bought by Hashicorp or something? Why not
announce that?

~~~
Goopplesoft
It is owned by Hashicorp. Hashicorp was a company built around Vagrant
initially.

~~~
erikb
I see, then I don't understand this blog post at all. Is my expectation weird
that an anouncement blog post for a major version +1 should contain some
features? Or have I just missed that part in the article?

------
swrobel
Does this incorporate any of the work that was done on Otto?

------
joshrivers
Any thoughts towards integrating Docker's VPNKit with Vagrant to provide
transparent networking services to the development VMs?

------
dmix
Does anyone find Vagrant useful for personal projects? Or is it only useful
for team settings?

~~~
amorphid
On my Mac, I tend to use Vagrant w/ Virtualbox when I want to run Linux
locally for any reason.

------
swills
Still doesn't support Ruby 2.4

~~~
bpicolo
How so? Can you not install whatever you want with Vagrant?

[https://rvm.io/integration/vagrant](https://rvm.io/integration/vagrant)

~~~
eropple
Wrong way around. Hashicorp decided to release Vagrant as an omnibus installer
that packages an embedded Ruby, which (apparently? I haven't checked, I'm
going off the earlier post) isn't Ruby 2.4.

They also killed off the gem-distributed version--which is still, to this day,
a huge pain in the rear, to the point where I build my own Vagrant so it
doesn't use its own weird out-of-the-way Ruby.

~~~
bpicolo
Ah, gotcha

------
kayoone
since i am using docker-compose locally, i have little use for vagrant
nowadays. For staging and production the docker containers run inside a
Kubernetes environment which i don't want to replicate locally. Am i missing
something ?

~~~
orev
I guess the main thing you're missing is that it you're not obligated to
comment on things that don't apply to you?

~~~
bdcravens
It seemed like a pretty legitimate question: is there a compelling reason to
give Vagrant 2 a look if Docker/Kubernetes is your current workflow? It seems
to me you took it as more of an us-vs-them comment.

~~~
emddudley
You probably wouldn't look at Vagrant if you are using Docker/Kubernetes.
Vagrant (virtual machines) and Docker (containers) fill different niches. If
you can accomplish your work with containers then you don't need to manage
virtual machines.

