Getting started with the uoWeb Vagrant build (Windows)

Our Vagrant build allows you to work with a copy of the uoWeb distribution, in an environment similar to our servers. Learn how to work with it on Windows.

These instructions are written for a user with intermediate knowledge of their operating system and is comfortable installing software, editing system files, and using both the Windows command line tool as well as a Linux-style command line tool. These steps were written for the University of Ottawa's Windows 7 (64 bit edition) image and may require some modification on other versions.

You will require administrative rights on your computer in order to perform these actions. Please call the Service Desk at x6555 if you do not have the access rights you require to perform these actions.


Note for Windows 10 users:

You should be able to follow the instructions below, while using the latest 64-bit versions of all the tools and applications listed (keep PHP 5.3, however) -- some exceptions apply below. If doing so, note that the Cygwin directory changes from "C:\cygwin" to "C:\cygwin64".

  • NOTE 1: Install either:
    • Vagrant 2.2.4 and VirtualBox 6.0;
    • OR Vagrant 1.9.5 and VirtualBox 5.1.3.
    • Other pairs / versions of these may not work properly.
  • NOTE 2: If, when running "vagrant up", you get an E_FAIL error saying "Failed to create the host-only adapter. Could not find Host Interface Networking driver! Please reinstall.", follow the solution mentioned by user panchalkalpesh in this Github thread.
  • NOTE 3: If Vagrant up causes Blue Screen of Death after latest Windows 10 update you may have to disable HyperV. You can do it with this command line: bcdedit /set hypervisorlaunchtype off

Installation

  1. Install the Java Runtime Environment (JRE) and the Java SE Development Kit (JDK). These tools are necessary to run our recommended editor, Netbeans.
  2. If you don't already have PHP installed, install PHP 5.3 for Windows, using the Microsoft installer. You can skip the IIS components.
  3. Next, you will need to add PHP to your path system variable, if it is not already added.
    1. Find the install directory for PHP (on our test system, this was C:\Program Files (x86)\PHP\v5.3). There should be a "php.exe" file within the directory.
    2. Using the Start Menu, open the Control Panel.
    3. Click on System and Security, then System.
    4. Click "Advanced system settings" on the left.
    5. Click the "Advanced" tab, if not already selected.
    6. Click "Environment Variables".
    7. Find the "Path" variable underneath System variables.
    8. Add a semi-colon to the end of the value, if not already present.
    9. Copy and paste the PHP installation directory after the semi-colon.
    10. Click "Ok" three times to exit out of all the dialogs.
  4. Install NetBeans, our recommended editor, and configure it to the uoWeb coding standards. You can use another editor if you like, but you are responsible for ensuring you meet the coding standards.
  5. Install MySQL Workbench (version 6.3). You may also need to install the Visual Studio 2013 Distributables for some versions of MySQL Workbench.
  6. Install Oracle VirtualBox 4.3.
  7. Download the 32-bit version of Cygwin. This is a Linux-friendly version of Command Prompt. We do not recommend the 64-bit version, even if you have a 64-bit machine, as some errors have been reported due to missing packages.
  8. Run Cygwin's setup.exe program that you just downloaded, and follow these instructions:
    1. Keep the default settings, unless otherwise noted.
    2. For a mirror, pick a mirror that looks like it resides in Canada or the US. If you experience slow download speeds, you can stop the process, close setup.exe and re-run it to choose a different mirror.
    3. When selecting packages, you will need the following ones:
      • bsdtar (under Archive)
      • unzip (under Archive)
      • mysql (under Databases)
      • git (under Devel)
      • patch (under Devel)
      • patchutils (under Devel)
      • nano (under Editors) - we do not recommend using vim on Windows machines
      • connect-proxy (under Net)
      • curl (under Net)
      • openssh (under Net)
      • rsync (under Net)
      • rxvt-unicode (under Shells)
      • dos2unix (under Utils)
      • ncurses (under Utils)
      • wget (under Web)
  9. Install the version 1.6.5 of Vagrant (for Windows, select the file vagrant_1.6.5.msi). Version 1.7.0 is known to be buggy with Cygwin.
  10. Restart your system at this point.
  11. Open the Windows shell as an administrator (right-click, "Run as Administrator"), and execute the following commands. Replace "yname" with your Windows username, and accept any security dialogs that come up. mkdir C:\cygwin\home\yname mklink C:\cygwin\home\yname\VirtualBox C:\Users\yname\.VirtualBox mklink "C:\cygwin\home\yname\VirtualBox VMs" "C:\Users\yname\Virtual Box VMs" vagrant plugin install vagrant-rsync-back # You may need to change "Local Area Connection" to something else. This helps with # occasional network timeout errors on Windows. netsh interface ipv4 set subinterface "Local Area Connection" mtu=1200 store=persistent
  12. Next, open the Cygwin Shell as an administrator, and execute the following commands. This will install drush and prepare your sites root folder. If you want to store your sites in a different location, change ~/sites to that location throughout this documentation (note that you have to use Cygwin paths for locations outside of the Cygwin directory, e.g. "/cygdrive/c/Users/yname/sites"). mkdir -p /usr/local/src/php cd /usr/local/src/php git clone https://github.com/demonz/drush cd drush git checkout 6.x-win mkdir /etc/drush mkdir ~/sites
  13. You are now ready to follow the steps for creating sites using Vagrant. Here is some useful information:
    • Your host file is located at C:\Windows\system32\drivers\etc\hosts and must be opened using administrative rights.
    • When setting up a NetBeans project, the sites directory should be C:\cygwin\home\yname\sites, unless you changed it above.
» Envoyer vos commentaires
    Public cible: 
  • Développeurs
    Sujets: 
  • Démarrage
  • Outils
Haut de page