

A Better Development Workflow with Vagrant - taylorlapeyre
http://taylorlapeyre.me/2013/04/better-workflow-with-vagrant/

======
bti
Don't know if I understand. You have the one develop box with all the
languages/server/databases on there. Then when you decide to start a PHP
project, you keep a copy of that box in with the project files? Doesn't this
result in multiple boxes sitting around?

Or does the Vagrantfile specify the environment and when you vagrant init
develop it recreates it?

I've never used Vagrant but am interested in starting to do something like
this.

~~~
tunesmith
I'm still a bit confused - what if you are simultaneously working on two
projects that each require a different version of Ruby? Do you have two
different vagrant boxes lying around?

~~~
chewxy
You start off with the same baseVM (I used to use Precise32, switched to
Precise64 for the first time yesterday). You specify the boxes which is based
off your base VM.

From there, the path of evolution for each box will take place individually.
If you have a Vagrantfile that specify for one project to use Ruby2.0beta and
another Vagrantfile for another project to use Ruby1.9, you essentially have
two boxes, two execution environments, but you still code on the same machine.

------
jtreminio
I haven't used Vagrant, and I believe I now know why.My daily driver is Win8.I
have a Debian VM I do my development on.All files are on the VM because
Windows sets all file and folder permissions to 755. This means that if I were
to delete the vagrant VM I would also be deleting my files. I am exploring
possible solutions to this problem.

~~~
AjithAntony
Are you saying that when you share a filesystem between your windows 8 host
and the Debian guest, that files written from windows have bad perms?

~~~
jtreminio
If the files reside on the NTFS Win8 partition, they show up as 755 on Debian.

If the files reside on the ext3 partition on the Debian VM, the permissions
are fine and even editing the files from Windows, on a Windows IDE does not
change the permissions.

~~~
AjithAntony
Just to clear up my expectations, if I were to try a similar set-up... When
you are using NTFS I'm expecting that you are using virtualbox to mount the
filesystem on the guest.

When you use etx3, how are you sharing the files? Like a samba share? or does
the virtualbox drive mount work in the other direction, somehow?

FWIW, I do all of my virtualization on ESX, but every time one of these
vagrant article comes up I'm tempted to try something local (win 8), to take
advantage of the shared filesystem that most of vagrant's magic relies on (as
I understand).

~~~
jtreminio
I actually wrote a tutorial on this: [https://jtreminio.com/2012/07/setting-
up-a-debian-vm-step-by...](https://jtreminio.com/2012/07/setting-up-a-debian-
vm-step-by-step)

I'll be re-doing it to use apt-get for everything, but for now PHP is
compiled.

I use samba to share files from the VM to my network, and Windows mounts the
share as a local drive.

------
thecodemonkey
I recently built out a base LAMP stack for Vagrant, using Chef for
provisioning if anybody's interested in getting up and running quickly.
<https://github.com/MiniCodeMonkey/Vagrant-LAMP-Stack>

------
zjmichen
Pretty similar to my workflow, but why do you destroy the box after every
session? `vagrant up` on my laptop takes a few minutes at least to build and
provision a vagrant machine.

Usually I just use `vagrant suspend`. Seconds vs minutes. Time > organization
IMHO.

~~~
brokenparser
Of course, but if you do that please also use a CI tool (such as Jenkins) to
ensure the Vagrantfile stays valid. It's actually good to rebuild that VM
regularly, especially when it's almost time to deploy.

~~~
zjmichen
Yeah, close to deploy is different. What does a CI tool do in this case? I'm
somewhat unfamiliar with the concept.

~~~
jmcqk6
If you run your tests in a pristine and isolated environment, then you can be
more confident in the lack of side-effects.

Basically, by integrating this into your CI tool, you ensure that all your
tests / deploys run through a standardized and pristine environment.

------
pibefision
Anyone has experience using Vagrant with VMWARE?

~~~
tjbiddle
They just released support for this the other week I believe (Or at least very
recently) - And that is specifically why I've been catching up on everything
Vagrant lately, as I was specifically waiting on VMWare support. I asked about
it in the freenode #vagrant channel the other day and everyone said it should
work the exact same as using the VirtualBox provider - except with VMWare.

~~~
dave1010uk
Does VMware do anything VirtualBox doesn't?

~~~
mitchellh
It does everything better.

NOTE: I'm biased, I created Vagrant + VMware. But go ahead and ask VMware
users.

~~~
rschmitty
+1 for VMWare, havent crashed yet after a year and a half since switching

thanks for your Vagrant + VMware work, that was the biggest thing keeping me
from vagrant

------
juliendsv-mbm
If you have a mac I recommend to have a look at the boxen project from github.

~~~
taylorlapeyre
I did actually look into that, but it kind of did the exact opposite of what I
wanted. There's a few reasons I'm not too impressed with Boxen:

\- Its goal is to install a whole bunch of binaries and development utilities
onto my local machine. I want to keep those segregated.

\- It only works with Macs. My only computer at the moment is a mac, but it's
not always what I use. I use computers at work that are linux based.

\- I found that it was buggy. I wasn't very easy to get it actually working.
It required a lot of effort and installation.

So, Boxen isn't for me.

------
artur_roszczyk
I would go even further and store tmux+vim config inside

~~~
lojack
I would go even further and use the same provisioning on vagrant as on my
production servers so I could set up a mini production environment with
whatever dev tools are necessary with just a single command. Recently they
added the ability to have multiple machines as well, so all it takes to load
up a simulation of my cluster is a single command.

