Why Vagrant?

Video loading...

  • 0:04
    Vagrant Why Vagrant?
  • 0:07
    with Emma Jane Westby
  • 0:17
    In this series, we're
  • 0:18
    going to be talking about how to use Vagrant to set up
  • 0:21
    a consistent developer environment.
  • 0:24
    In this lesson, we're going to look at an introduction
  • 0:26
    of virtualization; the software used in this series;
  • 0:30
    and the minimum hardware requirements for virtualization,
  • 0:34
    so that you don't get started down a learning path
  • 0:36
    you can't actually implement on your own computer
  • 0:40
    You've probably heard of virtualization before,
  • 0:42
    and you probably have a pretty good understanding of what it means.
  • 0:46
    But I'm going to start from the very beginning,
  • 0:47
    just to make sure you've got all the vocabulary in place
  • 0:50
    as we move forward.
  • 0:52
    Sometimes I use multiple terms to mean the same thing,
  • 0:55
    so I want to make sure that we're at least starting with some
  • 0:58
    of the same concepts and terms in place.
  • 1:02
    Virtualization allows multiple operating systems
  • 1:06
    to simultaneously share processor resources
  • 1:09
    in a safe and efficient manner.
  • 1:12
    The term was originally created for mainframe computers that were going
  • 1:16
    to share different resources or different applications
  • 1:19
    on the same computer.
  • 1:21
    Obviously we've grown hugely since then in our computing capacity,
  • 1:25
    and we can now put multiple computers onto the same machine.
  • 1:31
    Now you may be asking yourself, why would I even want
  • 1:33
    to bother putting another machine on top of my machine?
  • 1:37
    I'll be honest-- it probably will slow you down a tiny little bit
  • 1:41
    in page refresh, and just general system resources.
  • 1:45
    So why would you even want to do this?
  • 1:47
    Well, the first one-- and this is the reason
  • 1:50
    I got into it-- is a desire to use Linux on a non-Linux host machine,
  • 1:56
    such as a Mac OSX or Windows.
  • 1:59
    I've been using Linux as my primary operating system for almost
  • 2:02
    a decade, but the industry standards have moved to OSX.
  • 2:07
    And it's just become increasingly difficult for me to share work
  • 2:11
    with my co-workers when on a different platform.
  • 2:14
    So virtualization gives me the best of both worlds.
  • 2:18
    It's easier for me to interact with my co-workers
  • 2:21
    from my Mac base or host machine.
  • 2:24
    But I can also have the familiarity of working with Linux.
  • 2:28
    And for those of you who are used to working on a Linux server,
  • 2:31
    you may be really anxious to get back inside that operating system
  • 2:34
    you know and love.
  • 2:36
    The second reason is a desire to improve consistency
  • 2:40
    between developer environments and deployed servers.
  • 2:43
    If you're getting sick and tired of a developer saying,
  • 2:46
    well it worked on my machine, then you
  • 2:48
    may want to pay special attention to this learning series.
  • 2:52
    Because we're going to look at some of the ways
  • 2:55
    that we can standardize that developer environment so that if it
  • 2:59
    works for one, it should work for all
  • 3:01
    because you're using the same provisioning
  • 3:04
    scripts to set up those machines.
  • 3:07
    What if some of the reasons you may not want to use this, though?
  • 3:11
    First and foremost, hardware requirements.
  • 3:14
    You need to be using at least four gigs of RAM.
  • 3:17
    More is better.
  • 3:18
    I've got eight gigs on my laptop, and I'd say that even that would be
  • 3:22
    the bare minimum for a positive experience
  • 3:25
    of running a virtual machine.
  • 3:28
    You're also going to need a fair amount of hard drive space,
  • 3:31
    not for the Vagrant and VirtualBox software, but the fact
  • 3:34
    that you're putting in a whole extra operating
  • 3:37
    system on top of your existing operating system.
  • 3:41
    I probably run about five gigs for each of the virtual machines
  • 3:47
    that I have on my host machine.
  • 3:50
    So if I have two Vagrant instances, as I'll be referring to later on,
  • 3:55
    I would want to have 5 to 10 gigs for each of those.
  • 3:59
    Now you can destroy those machines, so you can recover space
  • 4:02
    in between different uses of different Vagrant instances,
  • 4:07
    but then you're going to be looking at a bit more time
  • 4:10
    to set up the machine if you've destroyed the box previously.
  • 4:14
    So if you don't have the minimum hardware requirements,
  • 4:17
    I encourage you to watch through to the end of this lesson, which talks
  • 4:20
    about some of the terms and software that are used for virtualization.
  • 4:24
    But you may not want to proceed with the actual hands-on components
  • 4:28
    in later lessons.
  • 4:29
    You may also not want to proceed with Vagrant
  • 4:32
    if standardization is not important to you.
  • 4:35
    Or in more specific terms, if you love your current developer
  • 4:40
    platform, don't bother with Vagrant.
  • 4:43
    This really is something that you can add to your tool kit
  • 4:47
    if you're having a problem getting software working
  • 4:50
    on your local environment, but you know that it works on the server.
  • 4:53
    Maybe you want to manage multiple versions of PHP,
  • 4:56
    and you don't like the way Mac does it.
  • 4:58
    Or you don't like the way Windows does it.
  • 5:00
    Maybe you're just on a Windows machine,
  • 5:03
    and you've decided that you really are not finding that the tools are
  • 5:06
    very helpful on Windows-- for example, Drush--
  • 5:09
    or don't feel like getting Cygwin working,
  • 5:11
    or any number of different reasons.
  • 5:14
    So hopefully I've explained some of my enthusiasm behind using Vagrant.
  • 5:20
    Again, it's not for everyone.
  • 5:21
    And if it's not for you, I'm OK with that.
  • 5:24
    But just to be aware, there are lots of different ways
  • 5:28
    to set up a developer environment.
  • 5:30
    And this is one that I've gotten a lot of use out of.
  • 5:34
    Let's take a look now at each of the different pieces
  • 5:37
    we'll be working with throughout this learning series.
  • 5:40
    The first one is Vagrant.
  • 5:42
    Vagrant is a tool for building complete development environments.
  • 5:46
    It supports a range of virtualization providers
  • 5:49
    and provisioning frameworks for configuration management.
  • 5:53
    You can read more about it at vagrantup.com.
  • 5:57
    If you do you go to the site, you'll see that it is an open source
  • 6:01
    product, and it's been around since 2010.
  • 6:04
    The original developer, Mitchell Hashimoto,
  • 6:06
    is now working on Vagrant as his primary job, which is really great.
  • 6:11
    I love to see when open source products
  • 6:13
    are able to support someone like this.
  • 6:17
    The next piece that we'll be taking a look at is VirtualBox.
  • 6:21
    VirtualBox is a provider for virtualization.
  • 6:24
    It allows an unmodified operating system,
  • 6:27
    with all of its installed software, to run in a special guest
  • 6:31
    environment on top of your existing host operating system.
  • 6:36
    Note those three bold words-- provider, guest, and host.
  • 6:40
    You'll be hearing those again throughout the learning series.
  • 6:43
    If you want to know more about VirtualBox,
  • 6:46
    you can go to virtualbox.org.
  • 6:50
    Next is the actual operating system that we install as a base box.
  • 6:55
    We'll be using Ubuntu.
  • 6:57
    Ubuntu is an open source operating system.
  • 7:01
    It's a derivative of Debian, and based on the Linux kernel.
  • 7:05
    We'll be using Ubuntu as our base box
  • 7:07
    when we create our virtual machine.
  • 7:11
    Finally Chef.
  • 7:13
    Chef is a provisioning framework used to deploy software
  • 7:16
    in a consistent manner to a single, or many, machines.
  • 7:20
    It ensures each machine is working with an identical environment,
  • 7:25
    or has identical software installed.
  • 7:28
    When I refer to a single, or many, machines,
  • 7:31
    I'm referring to the different ways that Chef can be used.
  • 7:34
    We're going to be using Chef solo.
  • 7:38
    Chef can also be used in a network environment
  • 7:40
    where you're using it to provision many, many nodes.
  • 7:44
    Perhaps one is a database server, perhaps
  • 7:46
    you've got some which are responsible for load balancing,
  • 7:49
    some which are responsible for the actual installation of Drupal.
  • 7:54
    We're not going to be doing anything that complicated.
  • 7:56
    We're just going to have Chef provision a solo, or single,
  • 8:00
    machine on our local environment, using the provisioning scripts
  • 8:04
    which are available from the host machine.
  • 8:08
    Let's review all of those terms.
  • 8:11
    Vagrant is installed on a host machine
  • 8:14
    to create a guest virtual machine from a base box, such as Ubuntu.
  • 8:19
    Vagrant acts as a wrapper around a provider, such as VirtualBox.
  • 8:25
    Vagrant supports provisioning of guest machines with configuration
  • 8:29
    management software, such as Chef.
  • 8:34
    To summarize quickly what we've talked about in this lesson,
  • 8:37
    we've done an introduction to virtualization.
  • 8:40
    We've talked about the software we'll be using in this series.
  • 8:43
    And I've also talked about the minimum hardware
  • 8:45
    requirements for virtualization.
Loading ...

Why Vagrant?

Loading...

Virtualization allows multiple operating systems to simultaneously share processor resources in a safe and efficient manner. One tool we can use to create a virtual environment is Vagrant. By the end of this video, you will be able to describe the advantages, and disadvantages for creating a local development environment with Vagrant, and you should be able to answer the following questions:

  • Do you want to proceed with Vagrant?
  • Does it sound like it will solve your problems? [yes | no]
  • Do you have the necessary hardware to proceed with the lessons? Or should you stick with WAMP/MAMP?

Note: Another common tool for creating development environments today is Docker, which is becoming very popular with Drupal (and other) developers. Take a look at our Drupal Development with Docker series to learn more.

Additional resources: