Varying Vagrant Vagrants logo Varying Vagrant Vagrants

  1. Start with any local operating system such as Mac OS X, Linux, or Windows.
    • For Windows 8 or higher it is recommended that you run the cmd window as Administrator
  2. Install VirtualBox 5.x
  3. Install Vagrant 1.x
    • vagrant will now be available as a command in your terminal, try it out.
    • Note: If Vagrant is already installed, use vagrant -v to check the version. You may want to consider upgrading if a much older version is in use.
  4. Install some these Vagrant plugins:
    1. Install the vagrant-hostsupdater plugin with vagrant plugin install vagrant-hostsupdater
      • Note: This step is not a requirement, though it does make the process of starting up a virtual machine nicer by automating the entries needed in your local machine’s hosts file to access the provisioned VVV domains in your browser.
      • If you choose not to install this plugin, a manual entry should be added to your local hosts file that looks like this: 192.168.50.4 vvv.dev local.wordpress.dev src.wordpress-develop.dev build.wordpress-develop.dev
    2. Install the vagrant-triggers plugin with vagrant plugin install vagrant-triggers
      • Note: This step is not a requirement. When installed, it allows for various scripts to fire when issuing commands such as vagrant halt and vagrant destroy.
      • By default, if vagrant-triggers is installed, a db_backup script will run on halt, suspend, and destroy that backs up each database to a dbname.sql file in the {vvv}/database/backups/ directory. These will then be imported automatically if starting from scratch. Custom scripts can be added to override this default behavior.
      • If vagrant-triggers is not installed, VVV will not provide automated database backups.
    3. Install the vagrant-vbguest plugin with vagrant plugin install vagrant-vbguest.
      • Note: This step is not a requirement. When installed, it keeps the VirtualBox Guest Additions kernel modules of your guest synchronized with the version of your host whenever you do vagrant up. This can prevent some subtle shared folder errors.
  5. Clone or extract the Varying Vagrant Vagrants project into a local directory
    • git clone -b master git://github.com/Varying-Vagrant-Vagrants/VVV.git vagrant-local
    • OR download and extract the repository develop branch zip file to a vagrant-local directory on your computer.
    • OR download and extract a stable release zip file if you’d like some extra comfort.
  6. In a command prompt, change into the new directory with cd vagrant-local
  7. Start the Vagrant environment with vagrant up
    • Be patient as the magic happens. This could take a while on the first run as your local machine downloads the required files.
    • Watch as the script ends, as an administrator or su password may be required to properly modify the hosts file on your local machine.
  8. Visit any of the built in WordPress sites or the VVV Dashboard at http://vvv.dev

Fancy, yeah?

What Did That Do?

The first time you run vagrant up, a packaged box containing a basic virtual machine is downloaded to your local machine and cached for future use. The file used by Varying Vagrant Vagrants contains an installation of Ubuntu 14.04 and is about 332MB.

After this box is downloaded, it begins to boot as a sandboxed virtual machine using VirtualBox. Once booted, it runs the provisioning script included with VVV. This initiates the download and installation of around 100MB of packages on the new virtual machine.

The time for all of this to happen depends a lot on the speed of your Internet connection. If you are on a fast cable connection, it will likely only take several minutes.

On future runs of vagrant up, the packaged box will be cached on your local machine and Vagrant will only need to apply the requested provisioning.

Now What?

Now that you’re up and running, start poking around and modifying things.

  1. Access the server via the command line with vagrant ssh from your vagrant-local directory. You can do almost anything you would do with a standard Ubuntu installation on a full server.
    • MS Windows users: An SSH client is generally not distributed with Windows PCs by default. However, a terminal emulator such as PuTTY will provide access immediately. For detailed instructions on connecting with PuTTY, consult the VVV Wiki.
  2. Power off the box with vagrant halt and turn it back on with vagrant up.
  3. Suspend the box’s state in memory with vagrant suspend and bring it right back with vagrant resume.
  4. Reapply provisioning to a running box with vagrant provision.
  5. Destroy the box with vagrant destroy. Files added in the www directory will persist on the next vagrant up.
  6. Start modifying and adding local files to fit your needs. Take a look at Adding a Site for tips on adding new projects.