VirtualBox

Revision 1 as of 2007-03-16 23:34:47

Clear message

ISO testing with VirtualBox

VirtualBox is a useful tool in testing ISO images since you can create imaginative disk configurations, erase or resize disks without concern for your system and test images while working normally on your machine. You can do the same thing with VMware Workstation but VirtualBox has a GPL version and can be used without a serial number.

Installing VirtualBox

You'll need to build a kernel module at the end of the install, so you should install the build tools if you don't have them:

sudo apt-get install build-essential

Get the .deb package from the [http://www.virtualbox.org/wiki/Downloads InnoTek website]. Just get the Edgy Eft version; that will work on Feisty as well. Save it to your desktop and click it to install.

You'll have to accept the license terms (the downloadable version is not the GPLed one) and otherwise agree to the defaults. Agree to let the installer build the kernel module for you.

Missing: shots of the install.

Should something go wrong with the setup and you have to repeat the module build, type:

sudo /etc/init.d/vboxdrv setup

You'll need to do this after updating your kernel as well, until Feisty gets out-of-the-box VirtualBox support. The installer should load the module after it's compiled.

In order to get access to the kernel module you have to add your user to the vboxusers group (created by the installer). Go to System -> Administration -> Users and Groups. Click Manage Groups and scroll down to the vboxusers group. Click Preferences and add your user to it. Log out and back in for the group settings to take effect.

attachment:vbox-groups-2.png

Setting up a virtual machine

Click New to create a new Virtual Machine (VM). Follow the instructions on the [http://www.virtualbox.org/wiki/End-user_documentation VirtualBox site].

attachment:vbox-main-screen.png

Setting up VM hardware

attachment:vbox-new-machine-2.png

Give the VM a name and select Linux 2.6 as the OS. If you don't already have a virtual disk defined you need to create one.

attachment:vbox-new-disk-2.png

Select a dynamically expanding image. 3 GB is probably a good size. Less for Xubuntu or Ubuntu-server.

Mounting an ISO

You could burn the ISO to a CD and mount that in VirtualBox, but it's more conveniant to simply mount the ISO directly.

attachment:vbox-mounting-iso.png

Starting your VM

Click start to boot into your new VM. You should see the boot screen from the CD. Boot and install as normal. When installation is complete, reboot from within Ubuntu and the virtual CD should be automatically unmounted. If not, press F12 when VirtuLBox restarts the VM and select booting from the hard drive.

attachment:vbox-ubuntu-boot.png

Streamlining

You can set up the VMs as you test, but you can also set several machines up ahead of time. That way you can set up several machines, each with its own hardware configuration, linked to a virtual disk and an ISO image. Giving each VM it's own disk will require a good deal of free space on your test system, so you may want to share a generic disk for installs (just connect to it before starting a given VM).

If you have an rsync script on a cron job you can have the ISOs you intend to test downloaded overnight (or while you are away). The links from VirtualBox the the 'CD drive' (which you point to the rsync target) will stay mounted. When you want to test a given ISO you just start the pre-defined VM and VirtualBox will boot the freshly rsynced image. This is useful when testing the same case repeatedly and when time gets short closer to release.