
Vagrant: A tool for building and distributing virtual development environments - mitchellh
http://vagrantup.com
======
mitchellh
This project has been the love child of myself and John Bender
(nickelcode.com) for the past 6 weeks. We're both daily HN readers and would
like to use this as a starting point to show Vagrant to the public.
Specifically, I'd like to open up to any questions and feedback, so that the
HN community can get to know Vagrant. Your feedback is extremely valued.
Thanks!

A bit of background on this project: I work at a development company
(citrusbyte.com) in LA. I see new projects almost every couple months, and I'm
often working on multiple projects simultaneously due to work, freelance, and
personal projects. Managing the development environments between many projects
on a local machine became a huge burden and a coworker once mentioned
developing in a virtual machine. I thought this was a great idea, and Vagrant
was eventually born from it.

Like I said before, feel free to ask any questions. If no questions, I value
your feedback very highly, so please let me know what you think!

Thanks, Mitchell

~~~
coconutrandom
This is so useful!!! I've been doing this manually for a select number of
important projects. However, I'm not a Rails dev.

What would it take to work with [language/framework]?

I've skimmed over the docs and here [<http://vagrantup.com/docs/getting-
started/setup.html>] it seems like instead of

    
    
      rails init
    

I could run

    
    
      django-admin startproject

~~~
mitchellh
Of course! Vagrant is not specific to rails at all!

The getting started screencast I made shows how to setup a LAMP environment:
<http://vimeo.com/9976342>

And the getting started guide shows a rails environment.

Those should get you started on the path to python as well =]

Mitchell

~~~
dlib
Any plans for a repository of boxes? One with a LAMP stack, Rails stack,
Django stack etc. I know I can roll my own and use chef there could be a
community maintained repository of often used configurations.

Also, in the screencast you use localhost to address the vm. Any way to assign
another ip to the vm? In my current setup my vm's have altenative ips.

~~~
mitchellh
Yes, there are plans for a central repository of boxes, but its not an
"immediate future" plan. We'd first like to focus on getting Vagrant as stable
as possible on the common-case systems.

Hm, changing the IP of the VM. This can't be done via the Vagrantfile at the
moment no. But if you do change it manually, you can configure Vagrant to use
that VM with "config.ssh.host"

Mitchell

------
a-priori
I had to read through most of the site before I had a good idea of what
exactly this was, but it does sound very interesting.

What about deployment? On the site, you only talk about local development
environments. Could you perhaps turn convert a Vagrant project into an EC2
instance for deployment?

~~~
keyist
"Could you perhaps turn convert a Vagrant project into an EC2 instance for
deployment?"

That's where Chef comes in. Vagrant uses Chef
(<http://wiki.opscode.com/display/chef/Home>) for provisioning VMs. It's
basically software configuration management (same category as cfengine or
Puppet) -- you write cookbooks that specify how a system should be set up (see
[http://github.com/opscode/cookbooks/raw/master/nginx/recipes...](http://github.com/opscode/cookbooks/raw/master/nginx/recipes/source.rb)
for an example).

If you write your Chef configuration the right way (ie not hardcoding anything
to a set of system specifications), you can take the same set of Chef
cookbooks you write and deploy to EC2 or any other Linux box, virtual or no.

So with Vagrant you can essentially pass around a virtual machine
configuration amongst your team and be confident that the entire team is
coding and testing in a near-exact replica of the production environment. Not
that this was impossible before, but Vagrant streamlines the process.

I've provisioned 20+ servers with Chef and once you have a solid base
configuration you can take your attended time on a full server stack (nginx,
memcached, post{gres,fix}, munin... the works, essentially) to less than 10
minutes.

~~~
carbon8
It looks like it generates solo.rb and dna.json files based on what's in the
Vagrant file, which is pretty cool, and I see there is a single cookbook path
relative to the project directory. Is there a way to specify a site-cookbooks
path, too?

~~~
mitchellh
Not at the moment. There will be extensive work on the chef provisioning
system in Vagrant before the next minor release (0.2), I'll add this to the
list.

Mitchell

~~~
carbon8
Awesome. This is a very interesting project.

------
helwr
This seems to be a very useful tool, one question though, what was the
rationale behind choosing VirtualBox, have you done any benchmarks against Xen
or Kvm or other hypervisors

~~~
mitchellh
VirtualBox was chosen since it is an open source, free choice which is
available on Windows, Mac, Linux, and Solaris. It is simply the easiest way
for developers to get started with a virtualized development environment.

Neither John nor I are familiar with any other virtualization platform, but
making Vagrant modular enough such that this is possible is definitely a good
idea for the future.

Thanks!

~~~
mtrimpe
Yes please! I would love to have Xen support included ...

