
Why Vagrant? - shawndumas
http://docs.vagrantup.com/v2/why-vagrant/index.html
======
mitchellh
Creator of Vagrant here. Pleasantly surprised to see Vagrant on top of HN!
Vagrant has matured a lot in the past year (since it has been on HN) both in
the core but also in the community. There are now tons of plugins available,
there is an O'Reilly book out, and much more. Most importantly, I think, is
that the project has added 3 more core committers in the past few months.

And Vagrant 1.4 is also under heavy development with tons of great new
features and bug fixes upcoming. See my Twitter stream for more info.

If you have any questions, feel free to ask. And thanks for the support!

~~~
codelust
Hey Mitchell,

Thank you for producing such an awesome piece of software. I have been doing
my local development on a Vagrant box for about a year now and in that time I
have been able to move from OS X to Linux almost seamlessly thanks to Vagrant.

The only problem I have with it is the slowness of the default shared folders
mechanism. Guess I need to bite the bullet one of these days switch to NFS.

~~~
steveax
Are you using Virtualbox VMs, or VMware VMs? My seat-of-the-pants experience
is that VMware shares are more performant.

~~~
codelust
Virtualbox VMs. Never tried the VMware ones.

The performance is acceptable most of the times, other than when I am running
one of those PHP frameworks that includes a million files to process each
request.

------
chewxy
I recently acquired a Macbook as my laptop. Vagrant had been a ridiculous
blessing. Instead of fiddling around with Macports and Brew and all that
nonsense[0], I just Vagrant Up a Ubuntu instance and tadah!

[0] Seriously, developing in R and Python in a OS X environment where you need
stuff like Gtk and CairoDevice, it can drive you to tears. Go on OS X was a
pleasure.

~~~
aroman
How do you use Vagrant, exactly? Are these Ubuntu instances VirtualBox
instances, or are you interacting over SSH, or what?

~~~
chewxy
[https://github.com/AnthonyNystrom/python-dev-
bootstrap](https://github.com/AnthonyNystrom/python-dev-bootstrap) ;

Also check out Rove.io (formerly called Hospice.io)

Basically, I code in OS X (sublime text), but the environment the code is run
in is essentially Ubuntu (or whatever nonsensical CentOS slow ass thing that I
may have to deploy for)

~~~
aroman
Ah I see, very cool. You mentioned something about Gtk and Cairo — do you ever
interact with the VM graphically, or do you only use it as (what amounts to, I
suppose) a networked Linux sandbox running inside OS X.

Also, how do you push code to the instance to run/deploy the code?

~~~
aethr
Vagrant mounts a filesystem at /vagrant on the guest vm with the contents of
the folder where your Vagrantfile is. Typically this means you include a
Vagrantfile in the root dir of your project, and then your entire project
folder is available on the guest box.

I strongly suggest investigating the NFS mount option for this feature if
you're using Virtualbox, as the performance difference is substantial over
Virtualbox shared folders (which is the default for the /vagrant mount).

Edit: typo

------
mmgutz
I still don't get vagrant. I create an image in VirtualBox. clone it, then
provision with Ansible. The thing that has always bothered me about vagrant
boxes is it has stuff baked into the image. I want state EXACTLY like I get on
a bare VPS, which is just SSH and root account.

Reverting to a snapshot is faster than using vagrant command line and
rerunning all scripts.

~~~
tszming
You are not the only one.

I also can't get why people are so excited about vagrant. To start a VM from a
base image and invoke Ansible to deploy just require a few commands - The good
thing is you can make sure the deployment procedures is the same no matter in
development or production environments, as the only dependency is Ansible.

~~~
jvoorhis
Have you tried scaling that to a team of at least ten, including a designer? I
find Vagrant to be a big help for collaboration.

~~~
tbranyen
Unfortunately even that's not enough. Vagrant has a lot of dependencies for
designers on OS X, and if you bring in NFS (instead of the nearly unusable
folder sharing), becomes insanely complicated to explain. Prebuilt Vagrant
package with reasonable OOTB folder sharing speed would be perfect IMO.

~~~
lotsofcows
You can sort of hide the dependencies (while making them easy to clear out)
using Homebrew...

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

...and brew-cask...

brew tap phinze/homebrew-cask && brew install brew-cask

...Just...

brew cask install virtualbox brew cask install vagrant

Also... brew install ansible

------
mooreds
One of my coworkers turned me on to vagrant. I set up virtualbox manually
once, and vagrant seems far superior.

The biggest issue for me is that I have some largish databases I need to be
loaded as part of the vagrant install, and these are a pain to distribute.

The best solution I have come up with is an external drive.

~~~
sehrope
You can also make your own images with the data pre loaded. At one point I was
creating/updating/destroying a lot of VMs via Vagrant so to speed things up I
made my own images. Then instead of fetching the base precise-64 image and
provisioning atop it I could start off with an up to date fully baked VM.

As a bonus you can put them on a local http server and your whole team can
download them. Just update the URL in your Vagrantfile.

~~~
jsmeaton
This is actually what I'm attempting to do right now. Our prod database is
Oracle, and trying to automate the installation of Oracle is a huge PITA. So
I'm doing it once manually (or somewhat manually at least), and I'll just
freeze that vm into my own box that other devs can use at work.

I'm really really enjoying working with Vagrant.

------
dmunoz
I don't use Vagrant, but it is on my radar. I have a manual virtualbox setup
and a few shell aliases that enable me to quickly boot/shutdown virtual
environments I need. To anyone who wants to do the same, read a bit about
VBoxManage [0]. You can do a lot to manage virtual machines on virtualbox
through it.

That said, the nice thing Vagrant brings to the table is it supports multiple
providers. I can't seem to see a solid listing of which in their
documentation, but they mention by name at least virtualbox, vmware, and AWS.
The use of a Vagrant file to configure a new machine is also nice. You can get
similar behaviour with Chef/Puppet, or as I do scp in a shell script file and
run it.

So, what excites me most about projects like Vagrant and Docker getting
popular is that I hate flailing around with build dependencies. I was amazed
with apt-get build-dep the first time I used it, but even that has let me down
a few times in the past. It's much better than it used to be, but all I want
for Christmas is every project to provide a easy to access environment I can
grab and build their project with. We seem to be getting closer and closer to
this being provided by default, instead of an exceptional circumstance.

[0]
[http://www.virtualbox.org/manual/ch08.html](http://www.virtualbox.org/manual/ch08.html)

------
616c
Check out Mitchell's sister project, packer, on Github. Vagrant and packer are
an unstoppable in any Unix-geek toolkit.

I also saw Mitchell's videos on middleware-style coding in Ruby, also posted
here, and that was a really insightful view on programming libraries.

I greatly respect this guys work. He is a definite role-model to me.

------
saryant
We use Vagrant/Chef as part of our production and development workflows at
Conspire. Anyone can trivially spin up a complete dev environment—DB, frontend
and backend—on their local machine or log in to our staging machine (an EC2
instance) and interact with our production cluster using Vagrant.

Plus, deploying to production is just a matter of a quick "git pull &&
./build.sh && vagrant provision" and checking that everything came back up
correctly.

Setting all this up took a long time but it was worth it in the end. At the
moment we're just using Chef Solo because we only have four machines to deal
with. I imagine we'll move to Chef Server at some point in the future.

~~~
jsmeaton
I'm unsure how exactly chef does its thing, but I found that using puppet
apply (similar to Chef Solo), was far superior to using puppet server (which
we use for production).

Maintaining usable certificates, sharing them with other devs, synchronising
puppet plugins etc was just far too much work, and very time consuming. I also
found it a lot nicer to have the explicit puppet configuration right next to
the code that runs on it.

I don't know if these kind of setbacks will be similar with Chef Server or
not.

~~~
saryant
After spending two weeks getting Chef Solo set up for our requirements, we
aren't exactly giddy about running into Chef Server's open arms.

~~~
colbyolson
Check out salt. Simple and amazing.

~~~
jsmeaton
I've tried looking into salt a couple of times, but I find the documentation
really lacking. The information is too spread out. I just took another look at
the docs and it appears to do just about everything puppet does, but is much
easier to configure (puppet-db/mcollective salt-alternatives are default).

Is there a canonical tutorial that's worth reading?

------
beagle3
Anyone with experience setting up a win7 under vagrant? All the instructions I
found online were cumbersome to the point of not offering much above a basic
VirtuaBox setup (E.g. They require you to activate your windows and then re-
image).

------
needcaffeine
I think there are two big deterrents for our development team in switching to
Vagrant. The team currently works on a single m1.xlarge development server so
that they don't have to download the mysql databases to their laptops. That's
one. The second one is that they frequently send links to their sites for
client review.

I love the concept and would love to make it work for us if we could somehow
overcome these.

------
awblocker
Beautiful package. I use it on my personal 13" MBP for R, Python, Go, and C++
development, and I'm impressed. No seams so far and low overhead :)

------
Kiro
What kind of dependencies do you usually have in a web app that would lead to
the configuration problems described in the designer part? Our designer only
needs to to check out the code and make an ssh tunnel for the database for it
to work (PHP and webserver already installed on Macs) so not sure what good
Vagrant would do.

------
jmspring
I've had vagrant pop up, but have yet to explore it. That said, I have many
fabric scripts for setting environments up. The link has little detail (first
page) on how it would benefit me with an existing toolset.

Are there examples where vagrant compares to something like an existing fabric
script?

~~~
jsmeaton
Vagrant is great if you want to share VMs with co-workers. If you're using
Windows and I'm using OSX and we're working on the same project that will be
deployed to an Ubuntu machine, we can each `vagrant up` our own virtual
machine and they will be exactly the same. Puppet or Chef provisioning of that
vagrant VM will be very similar to using fabric to fully configure everything,
with the added nicety that there are a tonne of puppet and chef configs that
can be reused (not so much with fabric I've found).

So vagrant doesn't give you anything you don't already have if you're just
configuring a VM, except maybe the networking and shared folders. But being
able to share that VM, destroy it, and rebuild it is where vagrant makes a lot
of sense.

~~~
jmspring
Thanks. I wish links where X will solve Y addressed related w/o digging.
Sometimes mobile clients aren't the best to search for the related comparison.

Btw, I find the unrelated downvote on my original comment amusing. I wish we
could see those doing up/down votes.

~~~
jsmeaton
On my comment or yours? I haven't got enough rep to see.

------
oakaz
I have a Linode. It's available anywhere. e.g During I code, my brother asks
me to watch his soccer game, and I keep working from a soccer field with my
IPad; [http://instagram.com/p/dNcNfREmwT/](http://instagram.com/p/dNcNfREmwT/)

~~~
shirro
I live on a big island in the southern hemisphere. Working remotely on a
Linode is painful due to latency even with mosh. I tied Fremont for ages but
the latency was too much so I moved to Tokyo which is a little better but I
still prefer to work with a VM locally. Vagrant gets the job done but I would
prefer an alternative.

I don't like Ruby. I don't like running virtualbox when I could be running an
lxc jail with something like docker. I think I will be ditching OS X and
moving back to a Linux desktop as soon as I find the right laptop.

~~~
oakaz
My VPS is in London, never noticed any latency in Turkey and US. I guess
Linode now has bunch of more cities, check them out.

For laptop, I recommend Macbook Air. The design, is a master piece of
minimalism. As a guy who used Xmonad for years, I think OSX and a Linux VPS is
the zen combo.

~~~
shirro
Turkey is really close to London. Domestic traffic in Australia travels
further than that. It is quite a different matter round tripping packets
across the pacific to another continent. I can do minor edits on a Linode but
I much prefer using a local solution like vagrant. I would like to ditch OSX
but the hardware/os combo is hard to beat.

------
shurcooL
Vagrant is extremely useful. It basically allows to automate builds/deploys
that require a non-host-OS setup.

By doing that, you also make your builds/deploys reproducible, by making all
the dependencies explicit (in a human- and machine-readable way).

------
creack
Docker or Vagrant? [http://stackoverflow.com/questions/16647069/should-i-use-
vag...](http://stackoverflow.com/questions/16647069/should-i-use-vagrant-or-
docker-io-for-creating-an-isolated-envinronment)

------
tempestn
Great timing! Getting a virtualbox dev environment set up with Vagrant was
literally on tomorrow's to-do list. Now I know where to start. :)

------
ksec
Naive questions. Doesn't VirtualBox create overhead? i.e You will be a lot
slower using it then running something on Barebone?

~~~
jamesbritt
From another comment: [http://stackoverflow.com/questions/16647069/should-i-
use-vag...](http://stackoverflow.com/questions/16647069/should-i-use-vagrant-
or-docker-io-for-creating-an-isolated-envinronment)

Mentions the overhead of running VirtualBox.

~~~
Estragon
This clojure code takes six seconds to run in an ubuntu 12.04 vbox guest, two
seconds on the ubuntu 12.04 host.

[http://clojure.org/agents#Agents](http://clojure.org/agents#Agents) and
Asynchronous Actions--Example

------
kayoone
i really like the concept of vagrant and have been using it for all my
development for a couple of months, sadly even with using NFS(on OSX) its
quite slow when working with larger frameworks.

So i might be going back to local servers and just put DB server and services
inside a VM.

------
anon_d
I do all of my coding in Virtualbox, and Virtualbox will not run within
itself. Frustrating!

------
danso
I love vagrant but I'd be interested to know if any _pure_ designers really
get much use out of it. It seems a shop that is so well-run as to provide a
great vagrant setup for designers would also be a shop that creates project
separations/workflows that don't require designers to have a running
environment to do their job.

(yes, only in unicorn-land are code-bases separated so cleanly that developers
are far-away from application logic...but I'm just speculating that a scenario
in which it's more beneficial than time-consuming to setup a turnkey Vagrant
solution for a _pure_ designer is also a rare scenario)

~~~
waitingkuo
I think most designer even don't know how to install vagrant or virtualbox and
how to use command-line. In my opinion, it might be better to provide another
tutorial for pure designers.

------
taternuts
I vagrant because windows

