Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Creating a Vagrant Virtual Environment on a Windows Host

lynnaloo edited this page Sep 4, 2014 · 1 revision

Vagrant is open-source software used to create lightweight and portable virtual development environments. Vagrant works like a "wrapper" for VirtualBox that can create, configure, and destroy virtual machines with the use of its own terminal commands. Vagrant facilitates the setup of environments without any direct interaction with VirtualBox and allows developers to use preferred editors and browsers in their native operating system.

Note: This document is for setting up a virtual environment on a Windows host. This setup requires Windows Vista or greater and at least 8G of memory. If you are using a Unix host, please use these instructions.

Install Vagrant

  • Download and install VirtualBox 4.3.12
    • Do not open VirtualBox or create a virtual machine. This will be handled by Vagrant.
  • Download and install Vagrant 1.6.4
    • Package managers like apt-get and gem install will install an older version of Vagrant so it is required to use the download page.

Fork the xtuple, fork the xtuple-extensions, and fork the xtuple-vagrant repositories on Github.

  • Download Git for Windows

  • Run the installer and "next" through the wizard until the step: "Adjusting your PATH environment."

    • Choose the third option, "Run Git and included tools from within the Windows Command prompt." This will allow the Windows command prompt to access both git and ssh commands.

    step-1

    • On the next step: "Configuring the line ending conversions", choose the second option: "Checkout as-is, commit Unix-style line endings".

    step-2

    • Choose "next" through any additional steps to complete the Git for Windows install.

    • Open the Windows Command Prompt as Administrator (Administrator access is required to create symlinks on Windows). The Adjusting your PATH environment" step above will allow you to run git and unix commands in your Windows Command Prompt.

Clone your forks of the xtuple and xtuple-extensions repositories to a directory on your host machine and get the latest code from the xTuple repository:

host $ mkdir dev
host $ cd dev
host $ git clone --recursive https://github.com/<your-github-username-here>/xtuple.git
host $ git clone --recursive https://github.com/<your-github-username-here>/xtuple-extensions.git

Clone your fork of the xtuple-vagrant repository in a separate directory adjacent to your development folder:

host $ cd ..
host $ mkdir vagrant
host $ cd vagrant
host $ git clone https://github.com/<your-github-username-here>/xtuple-vagrant.git
host $ cd xtuple-vagrant

Important: If you have previously forked these repositories, please ensure that you update your fork and update your dependencies.

Setup Vagrant

  • In the Vagrantfile, ensure that the sourceDir variable to matches the location of the cloned xTuple source code: sourceDir = "../../dev"
    • This path should be relative to the location of the Vagrantfile

Install VirtualBox Guest Additions Plugin

vagrant plugin install vagrant-vbguest

Connect to the Virtual Machine

Start the virtual machine:

Note: Before starting Vagrant, ensure that VirtualBox is not already running.

host $ vagrant up
  • Vagrant will automatically run a shell script to install git and the xTuple development environment

Connect to the virtual machine via ssh:

host $ vagrant ssh
  • The xTuple source code is synced to the folder ~/dev

Start the datasource:

vagant $ cd dev/xtuple/node-datasource
vagrant $ node main.js

Launch your local browser and navigate to application using localhost http://localhost:8888 or the static IP Address of the virtual machine http://192.168.33.10:8888

Default username and password to your local application are admin

Additional Information

Accessing the Vagrant Postgres Database from the Host:

Allow host access

Shutting down, restarting, and destroying your VM:

Basic commands