+1-757-461-3022 x124

Start Developing for the xTuple Mobile Web with One Command

Monday, February 10, 2014

Setting up enterprise software can be complicated, especially considering all the unknown variables that can exist in different operating systems and with software installed on that operating system. At xTuple, we've determined the best way to ensure a successful and consistent setup is to make sure every installation is configured the same way, regardless of the local operating system. The easiest way to provide an isolated, reproducible “sandbox” for software development is through the creation of a virtual environment. Virtualization software, such as Oracle’s open-source VirtualBox, allow users to host “guest” operating systems within a virtual machine on their native operating system. This means even Windows and Mac users can run an instance of Ubuntu Linux on their machine. Standardizing on a single environment can prevent many software problems by eliminating operating system inconsistencies. Project-specific versions of development tools can also then be installed without the concern of dependency conflicts, or contaminating any installations on the the native Operating System, because it is truly an isolated environment.

Although creating and maintaining virtual environments is relatively straightforward, provisioning more complex software projects can make the process much more complicated. Even the most systematic processes involving installation scripts and detailed documentation can still leave some room for small inconsistencies in setup and require more work overall. The solution to providing a process for creating an effortless virtual development environment, and that which has been adopted by the xTuple development team, is Vagrant.

Vagrant is an open-source project that acts as a “wrapper” for virtualization software like VirtualBox. Vagrant can create, configure, provision, and destroy virtual machines with the use of its own terminal commands. Not only does this simplify the configuration of virtual environments, but it make it so that the user never has to access VirtualBox directly. Vagrant also manages shared folders so that files edited on the native operating system are then automatically synchronized to the location on the virtual machine. This allows developers to use Sublime Text on OSX or Visual Studio on Windows 7 and immediately see their changes inside of the virtual machine running Ubuntu 12.04.

Using Vagrant for the first time is as simple as placing the Vagrantfile, the configuration file which describes how a virtual environment should be set up, in a folder and using the one command, “vagrant up.” We have standardized our development environment on the 64-bit Ubuntu 12.04 operating system and have built install scripts and to set up the entire development environment. In order to use Vagrant to manage the creation of this required environment, we also created a Vagrantfile in a dedicated public Github repository that contains the correct Ubuntu machine image and the path of the provisioning scripts for the virtual machine. Now all developers who contribute to the project can use this same Vagrantfile and thus create identical development environments, containing identical software configurations. Regardless of their host operating system, this process allows them to create a development environment and begin coding in the time it would normally take to read through the environment setup documentation.

More information on getting started with Vagrant, or why Vagrant would be a good solution for you, there is also a wealth of documentation available on the Vagrant website.

XTUPLE FOR EVALUATION: How to set up xTuple.

DEVELOPERS: Start here to install the xTuple virtual development environment.

Linda Nichols

Software Development at xTuple, October 2012 – January 2015
Mobile/Web Development Team: JavaScript, Enyo, React, Backbone, Express, Node, Vagrant, Less/Css, Postgres