The Vagrant tagline says, “Development environments made easy.” Install a couple of programs and run a few commands on the console. Maybe it’s just me, but once I type out DOS-like
commands, it never seems to go as advertised.
Vagrant is overkill for occasional development of WordPress sites. InstantWP is probably the software tool of choice for causal developers.
Ingredients (Downloads)
- Git (2.5.0) – is software that allows groups of people to work on the same documents (or code) at the same time without stepping on each other. The fancy definition is it’s a “distributed version control system.” We want a piece of this called OpenSSH, Secure Shell, a program that will connect our local system to the Virtual Machine.
- VirtualBox (4.3.12) – software that creates virtual OS closed sandbox environments called a virtual machines on top of the existing operating system. Some of the newer VirtualBox versions cause errors.
- Vagrant (1.7.4) – is software that wraps around virtualization programs like VirtualBox to create a virtual development environments.
- Varying Vagrant Vagrants (VVV 1.2) – is an evolving Vagrant configuration file that’s focused on WordPress development. In this set up, VVV is is the base configuration file to launch Vagrant.
Instructions
- Install Git. Remember, what we need is the command-line tools. When you’re installing, a scary dialog is going to come up with a warning. That’s the one you want.
- Install VirtualBox. Remember that the latest version may not be the greatest. If you get error messages in Vagrant, that might be the problem. Version 4.3.12 worked like a champ for me.
- Install Vagrant.
- Download Varying Vagrant Vagrants (VVV). I downloaded the zip file and unzipped the VVV-develop in I:\_PROJECTS. This is my projects folders. Yours may be different.
- Run “vagrant up” in GIT Bash. Go to the VVV-develop directory in Explorer. You should see a file that is named Vagrantfile. If it’s there, you’re in the right place.
Right Click anywhere in the Explorer pane and select
Git Bash Here. The window below should pop open.
On the command line, enter vagrant up and hit return.This might take awhile. If the Ubuntu Server VM doesn’t exist, Vagrant will go and fetch it.
If you see all sorts of : Warning: Connection time out. Retrying… messages, it’s most likely a problem with the version of VirtualBox. You may need to downgrade.
If the last line says … done., you’re in good shape. - Run “vagrant status” in GIT Bash.
On the command line, enter vagrant status and hit return.
It should say that it is running (virtualbox). -
Run “vagrant ssh” in GIT Bash.
On the command line, enter vagrant ssh and hit return.
If you have successfully run the ssh command, the prompt will have ~$ -
Confirm Connection. Remember that Vagrantfile? That’s where the IP address is setup when you run the up command. The file has: 192.168.50.4
Enter that address into the browser. If this is what you see… - When you want to quit, just go back to the Git Bash box and enter:
~$ exit to get out of ssh
$ vagrant halt to shutdown the VM.There are other useful commands and information for Vagrant in documentation the site.