You can now use the Linux kernel of your choice when you boot up an Amazon EC2 instance.
We have created a set of AKIs (Amazon Kernel Images) which contain the PV-Grub loader. This loader simply chain-boots the kernel provided in the associated AMI (Amazon Machine Image). Net-net, your instance ends up running the kernel in the AMI instead of the kernel specified in the boot process.
You need to install an "EC2 compatible" kernel and create an initrd (initial RAM disk) as part of your AMI. You also need to create a menu (/boot/grub/menu.lst) for the Grub boot loader. Once you've done this you can create the AMI and then launch instances by using one of the PV-Grub "kernels" as described above. You may find this document to be helpful if you want to learn more about the Linux boot process.
To be compatible with EC2, a Linux kernel must support Xen's pv_ops (paravirtual ops) infrastructure with XSAVE disabled or the Xen 3.0.2 interface. The following kernels have been tested and/or have vendor support:
- Fedora 8-12 Xen kernels
- SLES/openSUSE 10x, 11.0, and 11.1 Xen kernels
- SLES/openSUSE 11.x EC2 Variant
- Ubuntu EC2 Variant
- RHEL 5.x
- CentOS 5.x
Other kernels may not start reliably within EC2. We're working with the providers of popular AMIs to make sure that they will start to use PV-Grub in the near future.
You can read more about this in our "Enabling User Provided Kernels in Amazon EC2" document.
-- Jeff;
PS - You could (if you are sufficiently adept) use this facility to launch an operating system that we don't support directly (e.g. FreeBSD). If you manage to do this, please feel free to let me know.


I'd like to note that the Official Ubuntu Images for 10.10 will use this functionality.
Our daily builds [1] will soon begin registering with the pv-grub aki by default. For now, starting with 20100417.1 you can simply launch with the appropriate --kernel to get boot with grub.
For example:
ec2-run-instances --kernel aki-407d9529 ami-dc957eb5 --key mykey
That is for us-east-1 i386 grub loader, and ebs/ubuntu-maverick-daily-i386-server-20100714.1 .
To use other arch/regions you'll need to specify the appropriate aki.
Posted by: Smoser | July 15, 2010 at 08:05 AM
I forgot to add a link for '1' above:
http://uec-images.ubuntu.com/maverick/current/
Posted by: Smoser | July 15, 2010 at 08:31 AM
This is also working with upcoming Debian 6.0 and it should be working with current Debian stable 5.0. You just have to:
* Indicate in /boot/grub/menu.lst root=/dev/xvda1 as the root device of the instance.
* Bundle your image with linux-image-2.6-686-bigmem and grub-legacy packages installed.
Posted by: Miguel Landaeta | July 19, 2010 at 10:10 AM
Since opensolaris is competely dead Amazon really should provide a solution to run FreeBSD systems. This shouldn't be that hard to work on !
Posted by: zladivliba | October 24, 2010 at 06:20 AM
What about running JFS on /root is that possible? It seems that if you run ext3 on /root then you very quickly run out of inodes. I guess this is a ext3 problem. So I would love to know how to put a JFS on /root - boot can have an ext2, 3 or 4 no problem. But root should really get a JFS.
Posted by: Zeno Davatz | October 29, 2010 at 01:48 AM
A lot of ppl out there are trying to make FreeBSD run on EC2 (I thought that Amazon valued customer input, on that one we've been waiting for 2 years now to run FreeBSD on EC2, a move from the team on this subject would really be appreciated...).
But it fails ; you can check this article (I'm not the author), a the end he describes fails attempts using FreeBSD on EC2 http://www.ioncannon.net/system-administration/1205/installing-cent-os-5-5-on-ec2-with-the-cent-os-5-5-kernel/
Posted by: Zladivliba | October 31, 2010 at 02:34 AM
We have been successful in booting a custom patched kernel (cluster filesystem patches)for centos 5.5. PVgrub based kernels are damn useful !!
Here is the link talking about the steps we followed: http://clogeny.com/index.php/clogeny-blog/2011/01/21/12-booting-a-custom-kernel-ec2
Posted by: chirag | January 27, 2011 at 03:39 AM
Hi,
1. I have installed slackware14.0 (64bit) in my local machine.
2. I have created the 10 gb image space in slackware machine using below command.
(dd if=/dev/zero of=slack14.img bs=1M count=10075). and mount the image in slack14.img.
mount -o loop slack14.img /mnt/slack1464.
3. I have format the image (slack14.img)
4. I have installed the custom package through ruby script. The custom package for
installed without any error.
After that While login the mounting image (/mnt/slack1464).
root@slack1464bit:~# chroot /mnt/slack1464
chroot: failed to run command ‘/bin/bash’: No such file or directory
root@slack1464bit:~#
earlier I have created the .img image in (slackware13.1 & 13.37) without any error.
But I am getting the error in Slackware14.0 64bit only.
Thanks for advance.
BY
DAVID
Posted by: david | October 30, 2012 at 10:58 PM