Ec2-unikernel: One step unikernel -> Amazon EC2 AMI


While there have been a bunch of scripts to do this, they’ve all been a bit delicate against oddities in Amazon’s tools. They’ve also required you to have Amazon’s tools, have root access, and/or have another Amazon instance running. ec2-unikernel doesn’t require any of those, and should work for any PV Xen unikernel.

Binaries available for Fedora and Ubuntu; see the README on GitHub for more information.

What this will do, for those who like a summary, is:

  1. Find Amazon’s PV-GRUB AKI for your region.
  2. Make an S3 bucket for storing unikernels, if you don’t already have one. (You can optionally choose what this bucket is called, by the way.)
  3. Use the ‘guestfish’ tools to build a disk for your unikernel, by:
    1. Making a blank disk.
    2. Adding an ext3 file system to it.
    3. Adding your unikernel and any initrds/initramfs’s you’d like
    4. Creating a grub.conf that references all this, and putting it in the right place.
  4. Uploads this image to S3.
  5. Imports it from S3 into an EC2 Snapshot.
  6. Creates an AMI from said Snapshot and the AKI found in the first step.


Haskellers can just use cabal-install to get it, as I’ve just installed it to Hackage. Beware that the dependency chain is long, which means it takes awhile to build and may cause cabal pain. Consider a sandbox or new-build and friends.

Please leave any bugs or feature requests at the GitHub page. Have fun!

  • Adam