AWS News Blog

Use Your Own Kernel with Amazon EC2

Voiced by Polly

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.

Modified 3/12/2021 – In an effort to ensure a great experience, expired links in this post have been updated or removed from the original post.
Jeff Barr

Jeff Barr

Jeff Barr is Chief Evangelist for AWS. He started this blog in 2004 and has been writing posts just about non-stop ever since.