Varying Vagrant Vagrants Setup

By: Ryan Kienstra on: November 14, 2014  in: Programming

As a development environment for WordPress, Varying Vagrant Vagrants has many tools. It also has the latest branches of the WordPress core.

To get started, install VirtualBox and Vagrant if you need to. Even if your host machine runs Ubuntu, it’s best to install them from their websites. Ubuntu’s apt-get doesn’t have the most recent version of Vagrant.

If you’d like, execute this script in the directory where you want “Varying Vagrant Vagrants”. You’ll have an option to install an Emacs editor.


echo “Set up Emacs editor and bash aliases in Vagrant? y/n”
read do_install_emacs 
vagrant plugin install vagrant-hostsupdater
vagrant plugin install vagrant-triggers
git clone git:// vagrant-local
cd vagrant-local
vagrant up

if [ $do_install_emacs = 'y'  ];
   	then vagrant ssh
	cd $HOME
	git clone
  	echo “Type ‘em ~/.bashrc_custom’ to edit your bash aliases, or ‘em ~/emacs.d/init.el’ to edit your Emacs shortcuts”;

echo “Enjoy your new Vagrant install. See your sites at ‘'.”
echo “Pause the machine with ‘vagrant suspend’, or shut it down with ‘vagrant halt’.”

This may take 10 to 20 minutes. You’ll probably be prompted for a password so it can edit the hosts file.

Then, enter in your browser:

Vagrant Site

You can see the different versions of WordPress. For example, will show you the trunk. You can edit in the /srv/www/wordpress-trunk/wp-content directory of the Vagrant install.

The setup script above will start the machine for you. But to start it on you own, enter vagrant up

Vagrant up

vagrant suspend pauses the machine, while vagrant halt shuts it down. Both will save its state.

You can ssh into the machine with vagrant ssh

If you chose to install the Emacs editor, you can edit its shortcuts by typing emacs ~/.emacs.d/init.el
Emacs shortcuts

You can still edit files on your host machine, though.

TroubleshootingVagrant browser error

If your browser shows an error when you enter, there’s probably a problem with your hosts file.

The vagrant-hostsupdater plugin should update your hosts file. If you haven’t installed it, cd to your vagrant directory, and type vagrant plugin install vagrant-hostsupdater.

If that doesn’t work, enter in your browser, or curl in your terminal.

The next step is to check your hosts file. In OSX, type emacs /private/etc/hosts, and in Ubuntu systems, type emacs /etc/hosts.

You should see

Hosts file

If you don’t see that IP address, add this line to the file:

You’ll have to edit this file as root, so use sudo emacs /private/etc/hosts on OSX.

This is a complex system, but its features are well worth the setup.

Leave a comment