Vagrant: First notes

Install

Install Vagrant and Virtualbox on Windows

  • Latest Vagrant 
    • Installer will add vagrant to windows path. So it is available in the console
  • Latest VirtualBox

Choose a box

Some recommended boxes for WordPress:

  • Variable Vagrant Vagrants (stable ): an open source Vagrant configuration focused on WordPress
    • And this addition: Variable VVV – a VVV Site Creation Wizard
      supports site creation with many different options; site blueprints to set up all your plugins, themes, and more; deployments; and lots more features.vagrant
  • Bedrock ansible
    Trellis is an end-to-end solution for WordPress environment management.
  • Scotch Box (not specifically catered to WordPress)
    a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.

    • The manual which is also useful for getting started with vagrant in general

 

Install optional plugins

For VVV, we can install vagrant-hostsupdater (easy add entries to machine’s hosts file) and vagrant-triggers (automatic db backups)

vagrant plugin install vagrant-hostsupdater
vagrant plugin install vagrant-triggers

If installing triggers is problematic you might want to skip it.

 

Clone the box

Clone the box, and then run vagrant up.
Make sure you are running the command prompt as administrator!

git clone https://github.com/scotch-io/scotch-box.git my-project
cd my-project
vagrant up

Note: if you get an error something like ‘vt-x AMD-V hardwareacceleration not available’ , you can fix it by enabling hardware virtualization in BIOS

Note 2: if you get a network error when Vagrant is booting up VB, make sure you restarted your computer after installing the latest version of VB. Or check if there are still VB processes running (Windows task manager) and kill them.

Note 3: if the hosts-updater complains about permissions, run the windows command prompt as administrator, then run vagrant up again