Virtualisation and VNC to get everything working in Plone traning

published Feb 09, 2009 08:49   by admin ( last modified Feb 09, 2009 08:49 )

I finished doing the Plone training in London last week, and the participants have gone back home via train and flights. When you hold a course like this, there is very low tolerance for technical glitches, everything must work. You cannot tell people who have flown in that the network is down, please come again tomorrow.

Most of these things you mitigate by having redundancy, e.g. two laptops and WiFi and two 3G modems on different networks +  router with both its own WiFi and Ethernet cables for all participants. But what about the software? Participants are running different operating systems and have all kinds of different Plone installs on their laptops.

It used to be that you could teach Plone with a text editor and whatever install of Plone that the participants had. You could write some example products totally from scratch in about two hours.

But now with ZCML, and XML in profiles you need to start with boiler plate code, and it is not possible to ignore buildout. With buildout you can also demonstrate the ability to build a load balancer and cache, and you can have Plone 2.5 and 3 side by side. Buildout works on Linux, has some problems on Mac and is not something I'd even attempt to get to work in Windows on a participant's machine during a course.

So how do you see to that all participants have a good working environment? Well, I have come up with two solutions and I tried one this time. Please note that if the participant wants to run everything on their laptop as they do at work, this will of course be supported at the course. But for those who don't, and in those cases when new features need to be demoed and tried, something is needed.

Option 1: Portable VirtualBox on a memory stick

One solution is to give each participant a virtual server running VMWare, VirtualBox or any similar environment.  Ideally the software should be able to run completely from a USB memory stick, to avoid installation problems on the participant's computer. After some scouring of the Internet I managed to find a French project that bundled a slightly older version of VirtualBox made for USB memory stick use.  Applications that can run directly from e.g. a memory stick are called portable. These applications need not be installed on to the participant's computer.

Each participant was offered a 4GB memory stick with a self contained VirtualBox, running Ubuntu 8.10 preconfigured with:

  • Python 2.4
  • VirtualEnv
  • Kate Text Editor
  • svn
  • Firefox
  • A working buildout already built with virtualenv

Next time I'll add cached eggs and FireBug for Firefox.

On Windows, you just stick the USB stick into a port, double click the VirtualBox icon, select the virtual machine and start it. You could even pre-save the state of the machine in such a way that the participant is immediately presented with a shell in the right directory with the command ./bin/instance fg already typed in :-)  .

For those who use Macs, there is a free VirtualBox available. In this case you need to copy the contents of the memory stick to the hard drive and install the VirtualBox application to run it. I am not aware of a portable VirtualBox for Mac. The format of the VirtualBox xml has changed in the newer version, but here is a guide that shows how to get the old style image to work on a Mac.

 

So how did it go?

Some participants on Mac and Linux had flawless installations of buildout already when they came to the course, so they did not need it.

On Windows the USB stick worked like a charm, but with one unforeseen glitch: It turned out that by using a ready made VirtualBox image of Ubuntu and then decking it out with KDE (for Kate), we hit the 4GB limit of the memory stick during a new buildout! This will easily be rectified by e.g. using Kubuntu the next time or just remove unnecessary packages like OpenOffice.

On Mac, it took a while to edit the xml files to work with the newer VirtualBox (and you must keep glitches to a minimum when training). Next time I will just supply an alternative xml virtual machine specification for the newer Mac VirtualBox already on the memory stick.

Another unforeseen problem was that one of the Windows machines lacked a bit in memory and CPU power.

Option 2: VNC

Next time I am pondering to try to host a number of VNC sessions on one of my laptops. In this way all that needs to be run on the participants' machines are VNC clients. They will get different ports on the server and get their own Linux environments and I can even make live changes to it. Memory and CPU specs of the participants' computers become irrelevant.

For this to work a number of demands need to be met

  • The VNC clients must be compatible with the server
  • The clients should ideally be run from a USB stick
  • The server must have enough power to run all the sessions with GUI environments

I'd probably go for CentOS since I know how to add VNC sessions easily on that distribution, and I would need to do some load testing to see what server performance is needed. It might be  good idea to use a more resource friendly desktop environment than KDE Or Gnome. However, everybody likes KDE:s Kate, so I would prefer to use it.

I have been looking for a good laptop and found HP 2230s. It has a core 2 duo processor, weighs in at 1.7 kilos and can take 8GB of RAM. However, reviews of it say that it is flimsily built, so maybe it is better to get something else.

Option 3: Why not use both?

If I do go with CentOS 5.2 on a laptop I may get problems with  sleep and hibernation, since CentOS is not made primarily with laptops in mind. So why not virtualise it? And if I do that, I could also put it on the participants' memory sticks. So I could use the exact same image for options 1 and 2 above