Varying Vagrant Vagrants or VVV is an open source project for creating a WordPress development environment using virtualisation based on VirtualBox and Vagrant. Firstly we will look at the advantages of using virtualisation rather than developing WordPress projects directly on your server.
Next we will briefly describe VirtualBox, an open source virtualisation application, and Vagrant, a now mature tool for managing virtual machines.
Finally we will describe VVV, and provide enough information for you to download it and get started with using it. We think that you will agree that VVV is just about the best way to develop WordPress projects, especially in a team environment.
Virtualisation and VirtualBox
There are no good reasons to develop your WordPress sites directly on the server; doing so is courting possible disaster and makes team development work difficult. Of course you might have been doing it for years without any problems, but we have learned from experience that Murphy’s Law really does work; with so many things that can go wrong at least one of them will certainly do so. A trusted alternative is virtualisation, for instance using a tool such as VirtualBox.
VirtualBox (VB) is an open source cross platform virtualisation application that allows you to run just about any operating system (guest OS) on your existing operating system (host OS) without the need to create additional partitions. Essentially it creates a virtual machine (VM) or virtual machines as you can create as many as your resources will allow, each one with either the same or a different OS; each VM is an instanceof VB. Guest VB operating systems include most Windows OS, most Linux OS, Solaris, Mac OS X, and others.
What is Vagrant?
Vagrant is a wrapper for virtualisation tools such as VB. It allows you to set up and manage your virtual machines through a command line interface. With Vagrant it is easy to create portable reproducible development environments that can be shared by each member of a development team. As each team member, regardless of their own OS, is working within identical environments, and system specific events are avoided; if a development works on one machine, then it will work on all machines.
Using Vagrant is easy. You create a Vagrantfile which defines your base box containing the OS you will be using in your repository root. The file includes the IP address, the shared project folder, and other information; then you just run “vagrant up”
What is VVV?
While there many tools that are useful for managing vagrant, Varying Vagrant Vagrants (or VVV) is a vagrant environment that is particularly suitable for WordPress development projects and teams. While still evolving, the system is highly flexible and suitable for high traffic environments. Originally launched in December 2012 for internal project use by 10up, it was introduced to the WordPress Community in April 2013 and was spun off into its own organisation in 2014. VVV is now one of the best starting points for building WordPress sites, themes, and plug-ins, for local development and for teams.
Downloading and installing VVV is straight forward. It is necessary to install it after first installing both VirtualBox and Vagrant along with a couple of plug-ins; you will find all the details in the text box.
Once you have installed VVV all you need do to create a virtual Ubuntu server which includes all you need for your WordPress project is to type “vagrant up”. You can work on multiple projects in the same environment and you can use shared directories so that changes appear in both your local files and your virtualised server.
When you are done for the day, just type “vagrant halt” to turn the environment off; and when the project has been completed just type “vagrant destroy” to kill the environment and clean up your files.
Nearly all interactions are carried out through the command line interface. Commands begin with “vagrant” which is followed by a sub-command. Here is a list of the more important VVV commands and what they do:
vagrant up – starts the VVV virtual machine. It sets up the hosts file with local domain names; updates Word Press local versions; runs custom init scripts.
vagrant halt – shuts down VVV virtual machine gracefully and frees up resources when VVV isn’t being used.
vagrant suspend – suspends the virtual machine in a precise point of time state.
vagrant resume – resumes the suspended virtual machine.
vagrant provision – runs configured provisioners to install software automatically and change configurations. Enables you to modify provisioning scripts and check that you get the required result.
vagrant ssh – connects to VVV via SSH (secure shell) allowing commands to be run inside the virtual machine.
vagrant destroy – stops the virtual machine and removes all resources created during machine creation; leaves your computer in a clean state.
Varying Vagrant Vagrants is free to download and use. It is easy to install and not too difficult to use. It allows you to work on your WordPress projects in a realistic production environment including high traffic websites. It lets you standardise your development environment so that every member of your team is singing from the same song sheet.