MediaWiki-Vagrant/Installation details
Vagrant and VirtualBox are both prerequisite. Both are free and open-source and available on Mac, Windows, and GNU/Linux.
- Download and install VirtualBox.
If you do not want your virtual machines stored under your user home directory, start VirtualBox and change it in the preferences. Moving existing virtual machines later is complicated. - Download and install the latest version of Vagrant from vagrantup.com (v1.2.2 or higher).
You may want to set the environment variableVAGRANT_HOME
to the directory where you are going to keep your virtual boxes. If you don't, the Windows version will use drive C: for temporary stuff. - Download a copy of mediawiki-vagrant:
- - Either -
- Download one of the individual files:
- Extract the zip file or tarball to a directory of your choice.
- Up a terminal or a command-prompt, and set your working directory to to the location of the extracted files.
- - Or -
- From a terminal or a command-prompt use
Git
:git clone https://gerrit.wikimedia.org/r/mediawiki/vagrant.git
- Change your working directory to the git-cloned directory.
- From a terminal or a command-prompt use
- - Either -
- From there, run
vagrant up
to provision and boot the virtual machine.
You'll now have to wait a bit, as Vagrant needs to retrieve the base image from Canonical, retrieve some additional packages, and install and configure each of them in turn. Our Vagrant configuration relies on Puppet to provision and configure software. See MediaWiki-Vagrant/Initial run for what an initial run should look like (the output you see may differ slightly).
Caution about download size
editIf your internet connection is slow or if you're doing this in a large group, you might want to change the source of the image file to something close by. Edit the file named Vagrantfile
in your vagrant directory and change the config.vm.box_url variable to whatever URL is appropriate - a webserver on a local IP address with a copy of the file works particularly well.
Alternatively if you have the .box file you can do the following to make vagrant not download it again, due to the fact that a .box file is just a TAR file in disguise:
$ mkdir -p ~/.vagrant.d/boxes/precise-cloud/virtualbox
$ tar xf /path/to/vagrant.box -C ~/.vagrant.d/boxes/precise-cloud/virtualbox/
$ echo -n '{"provider":"virtualbox"}' > ~/.vagrant.d/boxes/precise-cloud/virtualbox/metadata.json
Windows
edit- Go to the directory
C:\Users\<User>\.vagrant.d\boxes\
- Create the two nested directories
C:\Users\<User>\.vagrant.d\boxes\precise-cloud\virtualbox\
- Extract the .box file to this new directory. The .box file is just a TAR file. If you don't have a tool to extract TAR files you can get a
tar.exe
here. - Create a text file with the line
{"provider":"virtualbox"}
and save it asC:\Users\<User>\.vagrant.d\boxes\precise-cloud\virtualbox\metadata.json