Virtualization: Placing a SugarCRM site on a laptop

We have set up a SugarCRM server on a cloud service for a client. This is great for the client, as they have offices around the world. The problem is that some of the locations they wanted to access the site were out in the jungle – quite literally in the jungle with not so much as a banana tree Internet access point.

Luckily they could get away with read-only access at these locations, so the trick is being able to take the live SugarCRM application with all its data, and running it on a PC.

The path of least resistance was to run the CRM application in a virtual machine (VM) on the laptops. The live application is about 1 GByte in size, runs on Linux, uses PHP 5.3 and MySQL.

The VM would be cloned and copied to the PC, so there would be no application porting issues.

 

So, we have an application that runs on a cloud-based virtual server, and also want to run that same server on a PC under Windows. My first thought was that the cloud-based virtual server could simply be picked up, i.e. cloned, and dropped onto the PC. That was the first hurdle – finding a cloud service where we could clone the server and download the clone. We could not find one, however.

Although cloud servers use virtualisation and servers can be cloned in the cloud, those clones were not something we could download and run locally. I suspect it has more to do with client lock-in than with the technology. We could install our own virtualisation layer on top of our cloud server, but that would mean a whole new level to manage – another operating system, with all its upgrade, configuration and security issues to handle. So that, unfortunately, was out.

So as far as cloning the application is concerned, we would be copying the scripts (using rcync) and exporting the database, then loading it all up on a local machine. That is not too much of a hassle as it can all be scripted.

The cloud and laptop may be running different operarting systems; just the application is copied acress as needed.

 

So that takes us to the target machine: Linux on a PC. If we are not cloning the production VM, then the VM running on the PC can be any version of Linux that works and is convenient to set up. We don’t want to through the effort of installing from scratch, because that is, a lot of effort that we really don’t want to waste time on.

I looked at VirtualBox, with is true Open Source, free and runs on just about anything. It works impressively, and can be installed on just about any host operating system, so will work in the field on Windows laptops or Macs. I did find it was a bit of a resource hog, however, so not sure how it would work on an older PC.

I did not want to get involved in setting up and configuring an OS to host the SugarCRM application from scratch, so looked around for ready-built virtual servers. VirtualBoxImages.com had a tidy array of virtual servers to download, and I tried a couple. None quite hit the mark though: PHP5.3, simple to install a PHP application, and no need for a GUI. Most provided a full GUI, which was just overkill. I want a virtual machine I can send to an end user, get them to run the machine, then access the application through a web browser on their machines. It needed to be simple, and just work without any messing around in the GUIs of the guest operating system.

Given this, and my concern about resources, I kept looking around at other virtual machine solutions. I eventually stumbled on VMware. This has been around for a long time, and due to its commercial nature I kind of dismissed it for cost reasons. However, the VMware Player is free to install and use. If you have a VMware image of a machine, then you can run it up on a PC with little bother.

So where to get a suitable VMware image? This is where I stumbled on Bitnami. This service provides ready-made Operating System images, and additional “stacks” that sit on top of them. The OSs are stripped down to just what is necessary to run the stacks. The stacks are applications set up to install on the OSs with the minimum of effort.

In my case I had the “stack” – a live SugarCRM application, and just needed the base OS. There is a nice one called LampStack, which is a Ubuntu OS with PHP 5.3, MySQL, and a collection of other goodies ready to run most PHP applications. It is all bundled up into a VMware image so it can be dropped in and just works – and it really does. It took a couple of hours (with some excellent help from the Bitnami community) to get the full production copy of SugarCRM running on the LampStack virtual machine on my laptop.

Resource-wise it works great too, and is no slower then the production application on the cloud server, while just ticking over on the CPU. It is eating about 4Gbyte of disk space so far, but that is not an issue – everything these days is massive.

I’m going to roll this out to the client this week, as they are going to be flying out to the jungles (Honduras, Mexico, Cuba, and other far-flung locations) within the next few weeks. Taking the CRM with them, so they can manage the day-to-day business while out there, is now going to be possible.

In all, a lovely solution using some fantastic work from the Open Source community.

Update

Since writing this, I attended a presentation of Vagrant at PHNE. Vagrant provides a command-line wrapper for VirtualBox to make management a little easier, and also provides some ready-built virtual server images. I have yet to try this, but it looks like it could provide a neat solution.

Vagrant is designed to allow duplicate servers, i.e. servers will all the same software versions and settings, to be quickly set up for development teams. The idea is that the teams will always get an environment set up just like the production server. It is not clear to me how easy that makes it to clone a server with the production application already installed and ready to go, but that is something to look into.

No comments yet.

Leave a Reply