BoxGrinder is a JBoss Community project to build appliances based on Fedora, Red Hat and/or CentOS. It appears to build on an earlier project called ThinCrust. It takes a simple BoxGrinder appliance configuration (‘.appl’) file and uses it to generate a Red Hat kickstart file, which it then uses to build a KVM VM. Additional plugins can then convert the VM to other formats like Amazon EC2 AMI. BoxGrinder itself is supported on Fedora only, though it can create CentOS 5 appliances. As of writing a critical bug stops BoxGrinder from building CentOS 6.x images.
The best way to build appliances for Amazon EC2 is to use the provided BoxGrinder meta-appliance AMI to create an EC2 instance: BoxGrinder meta works best with at least 2G RAM to build i386 appliances.
I created a basic appliance with the Chef client preinstalled by using an appliance definition file as follows:
name: CentOS-chef summary: "CentOS RBEL Chef" version: 1 release: 1 hardware: partitions: "/": size: 4 os: name: centos version: 5 packages: - ruby-devel - rubygem-chef repos: - name: "rbel5" baseurl: "http://rbel.frameos.org/stable/el5/#BASE_ARCH#/" ephemeral: true - name: "epel" baseurl: "http://download.fedoraproject.org/pub/epel/#OS_VERSION#/#BASE_ARCH#/"
Having gems pre-converted to RPMs is better than trying to use gem install during build post-processing.
Configuring the EC2 plugin is done in ~/.boxgrinder/config after which the appliance can be built with
export LIBGUESTFS_MEMSIZE=2048 boxgrinder-build CentOS-chef.appl -p ec2 -d ebs -b --debug