subscribe

Posts Tagged ‘Testing’

When it comes to acceptance testing your app or repository. It’s good to be able to run through different scenarios, on different operating systems using different boxee versions (alpha/beta). A common scenario is releasing a new version of an existing an app to users, some of whom already have it and some that don’t. Using virtualisation you can mimick those with v1.0 and those without, with a clean Boxee install just like your users customers will be using.

As always there’s more than one way to do this. This is how I did it for free, installing Sun’s Virtual Box v3 onto WinXP box (the host machine) and running Ubuntu as a virtual machine (the guest machine). If you want a more robust testing environment, the legal way, costs money for OS licenses and you’ll need something besides Virtual Box if you want Mac OS as a guest machine. It’s a balance between time/cost and risk. For me, I was moving my repository sub-domain to a different location at my hosts and I needed to be able to check that the repository was up and running OK. The best way to do this was on a boxee install that didn’t already have my repository and apps added.

1. Download and install Virtual Box

Download the edition of Virtual Box for your OS. http://www.virtualbox.org/wiki/Downloads and install it. It will disconnect your network connection for a few seconds and reconnect again.

2. Download Ubuntu

Download the ubuntu iso from http://www.ubuntu.com/getubuntu/download The latest 32-bit desktop version is fine. I’m using 9.10 Karmic Koala.

3. Setup the Virtual Machine

Open Virtual Box and click ‘New’ to launch the new virtual machine wizard.

Step 1 – OS Type

Give the virtual machine a name, choose Linux as the Operating System and Ubuntu as the version.

Virtual Box - New Virtual Machine Step 1

Step 2 – Memory

Go for 512MB of RAM. This is Boxee minimum system requirements. It can also be changed later if it’s too slow

Virtual Box - New Virtual Machine Step 2

Step 3 – Hard Drive

Go with the defaults.

Virtual Box - New Virtual Machine Step 3

Next it takes you through the ‘Create New Virtual Disk Wizard’

Step 4a

I wasn’t sure how much space I’d need for the virtual machines harddrive, so I opted for Dynamically expanding storage.

Virtual Box - New Virtual Machine Step 4

Step 4b

Next you need to tell it where you want the hard disk to be stored and it’s size. The default size of 8GB is fine, this is the Ubuntu’s recommended system requirements.

Virtual Box - New Virtual Machine Step 4b

Then click though the rest of the confirmation screens until you come to the end. You should now see the following.

Virtual Box - New Virtual Machine Final

4. Prepare the Virtual Machine for Ubuntu & Boxee

Open up ‘Settings’ and choose ‘Display’. Up the video memory, I only have a small cheap graphics card so I went for 100MB of Video Memory, although less might also be acceptable. Enable 3D accelaration, this is needed for OpenGL that the Boxee clients uses.

Virtual Box - Settings - Display

Now Choose ‘Storage’ to mount the Ubuntu iso you downloaded earlier. Select the CD image, under IDE Controller node, that’s  labelled Empty. Use the folder button to add/browse to the previously downloaded Ubuntu iso file. This is the virtual equivalent to inserting the Ubuntu install CD into your drive.

Virtual Box is quite good here as it remembers what you’ve mounted before and you can mount these, plus any other iso, whilst inside the Virtual Machine (the virtual way of changing changing the CD in your CD drive).

Virtual Box - Settings - Storage

You’re now ready to install Ubuntu. Click ‘Start’ to boot-up the virtual machine. NB You can tweak anything in the Settings dialog at anytime later on.

5. Install Ubuntu

The Ubuntu installation is really simple and well documented elsewhere, so I wont repeat the steps here. If in doubt with any option go with the default, they’re just fine. Official Ubuntu Installation Guide

6. Install Guest Additions

Amongst providing other useful features (copy and paste between host and guest, higher resolution, prevents capturing and keeping the mouse), this package will get OpenGL up and working properly for the Boxee client. The first time round I forgot this step and Boxee just hung.

With the guest OS running, from the Devices menu select Install Guest Additions… Ignoring any prompts from Ubuntu about applications to launch.

Virtual Box - Install Guest Additions

This will put the a disk called VBoxAdditions_3. on your desktop. Open it and run autorun.sh and this will install guest additions. Reboot for changes to take effect.

Virtual Box - Guest Additions Disk

If this doesn’t work, you can manually mount the Guest Additions iso. In the same way that you mounted the Ubuntu iso in Step 4, mount the C:\Program Files\Sun\VirtualBox\VBoxGuestAdditions.iso. Now when you start your Ubuntu VM you will see the disk on the desktop, open it and run autorun.sh and this will install guest additions.

7. Install Boxee

Login into the Boxee Website on the guest machine and follow the installation/download instructions. Once installed it’s worthing logging into Boxee (to check all is cool) and adding your accounts, so you don’t have to do this step each time you want a clean boxee install.

8. Take a Snapshot

At this point you should take a snapshot of your Virtual Machine, so that you can always rollback to this point and run test after test. Also at any point you can take a snapshot. The first time I did this, I took one just after Ubuntu had installed so I had a clean Ubuntu installation too.

Virtual Box - Snapshot

You can now test stuff on the Boxee client, trash it and always go back to the point where you have just Ubuntu and Boxee installed and do it all over again and again. You can also take snapshots so you can run the common scenarios mentioned at the beginning of the post.

Versions used
  • Virtual Box – 3.1.2 r56127
  • Ubuntu – 9.10 Karmic Koala
  • Boxee – Beta 0.9.20.10356M
Other VM Choices
2 Feb 2010

Testing Boxee Apps Using Virtual Box

Author: Tom Philip | Filed under: tutorial