This is really a post for Google’s crawlers on getting AWS’s EC2 AMI tools working under Ubuntu (I’m currently on Gutsy 7.10). Despite any bitching I may do below, EC2 and S3 are cool services.
The first problem is that AWS only distribute the tools as an RPM (really guys? I mean FFS). Convert and install with
# apt-get install alien # alien -k ec2-ami-tools.noarch.rpm # dpkg -i ec2-ami-tools_1.3-15283_all.deb
Make sure you also install
Set your Ruby path as the RPM places them where RedHat expects to find them:
# export RUBYLIB="/usr/lib/site_ruby"
Now when you run the utility, you’ll probably get:
$ ec2-bundle-image -r ... -i ... -k ... -c ... -u ... sh: Syntax error: Bad substitution
Aparently Ubuntu switched from invoking
sh somewhere along the line. Just relink it (temporarily or permanently as suits):
# rm /bin/sh # ln -s /bin/bash /bin/sh
And you should be good to go.
One other issue I encountered was that the permissions of the directories were for root only (i.e.
/etc/aes). A very sloppy
chmod a+rX on each of these will resolve that. Although I suspect it’s more to do with the fact that I used
cpio rather than
alien the first time around.