iPXE in Amazon EC2

You can use iPXE to boot Amazon (AWS) EC2 instances using a public iPXE AMI. You can use an iPXE script to direct the EC2 instance to boot via any means supported by iPXE. For example, you could boot a set of diskless EC2 instances using HTTPS or iSCSI from a single server hosted in the same AWS region.

Launching

The EC2 iPXE images are published outside of the AWS Marketplace and are shared directly from account 833372943033.

Launch the latest iPXE AMI for your AWS region and CPU architecture from the table below:

AWS region CPU architecture AMI ID
af-south-1 x86_64 ami-0024bbcbb7c7278c8
af-south-1 arm64 ami-038fcc9fe6bbbfa96
ap-east-1 x86_64 ami-088c46783b9676056
ap-east-1 arm64 ami-003c929bf5b8b187e
ap-east-2 x86_64 ami-0da612069f8242c7e
ap-east-2 arm64 ami-0166ab7ea89fe3b7e
ap-northeast-1 x86_64 ami-0929e6c0d9525ea52
ap-northeast-1 arm64 ami-082ec47893929798e
ap-northeast-2 x86_64 ami-030b8c7383bfe4af0
ap-northeast-2 arm64 ami-0cc4dd33fa960d24c
ap-northeast-3 x86_64 ami-08ba0937e7ed47879
ap-northeast-3 arm64 ami-049008cab3e5ed7d3
ap-south-1 x86_64 ami-0eaa68efe947b7cf0
ap-south-1 arm64 ami-0a614a9f59d1715dd
ap-south-2 x86_64 ami-0e2d382730bf97b44
ap-south-2 arm64 ami-0fccc02441401d6c7
ap-southeast-1 x86_64 ami-0d9466a437737ecb2
ap-southeast-1 arm64 ami-0388a297b9da7eb9f
ap-southeast-2 x86_64 ami-0c491ef8892fef7d2
ap-southeast-2 arm64 ami-0a39437dcca295979
ap-southeast-3 x86_64 ami-05b068e387c8f49f0
ap-southeast-3 arm64 ami-076eb391fc0a4cc38
ap-southeast-4 x86_64 ami-09c1c7bdc13d27a0b
ap-southeast-4 arm64 ami-0193757e4f64ec2e1
ap-southeast-5 x86_64 ami-026c42ef7ad07573b
ap-southeast-5 arm64 ami-0f3ca8e4a613e6a70
ap-southeast-6 x86_64 ami-04170cf17e2b97ab6
ap-southeast-6 arm64 ami-0a985a49330ec9781
ap-southeast-7 x86_64 ami-026c702524db4eb7c
ap-southeast-7 arm64 ami-0f176862c074952b5
ca-central-1 x86_64 ami-0c6b1cd77ab2b7b66
ca-central-1 arm64 ami-0e7194836ab45c164
ca-west-1 x86_64 ami-00fadcbeb72469bc1
ca-west-1 arm64 ami-03c8665c6159ad6a7
eu-central-1 x86_64 ami-0b643a2deecc91b46
eu-central-1 arm64 ami-0ca8b559f91e13f4a
eu-central-2 x86_64 ami-090c6822b495b3baf
eu-central-2 arm64 ami-037b46c3c4a4323e5
eu-north-1 x86_64 ami-0b36b63c379cc7a7d
eu-north-1 arm64 ami-01201b46849d32e72
eu-south-1 x86_64 ami-06359305e2554819a
eu-south-1 arm64 ami-036e7c1acf546bfc1
eu-south-2 x86_64 ami-0303e53e515f77da7
eu-south-2 arm64 ami-02631acdd762d2f72
eu-west-1 x86_64 ami-07f39c88d85d5d1c9
eu-west-1 arm64 ami-06eaa7f2f946e048e
eu-west-2 x86_64 ami-046ead60ba1a68b2f
eu-west-2 arm64 ami-0184d445ce5657aac
eu-west-3 x86_64 ami-0257ad2f018de0a61
eu-west-3 arm64 ami-0fbb6136e9da7263d
il-central-1 x86_64 ami-0c845475f2ad4b382
il-central-1 arm64 ami-05ea4cc14a541ef6f
me-central-1 x86_64 ami-03aaf737703028567
me-central-1 arm64 ami-0acd3cc657d1aa32a
me-south-1 x86_64 ami-0a26d9f59ee632f59
me-south-1 arm64 ami-08af8f46bb5dda216
mx-central-1 x86_64 ami-0176246173bc208b2
mx-central-1 arm64 ami-06f891f7fb63919a0
sa-east-1 x86_64 ami-0a82714f1bb7fac9e
sa-east-1 arm64 ami-08c52cb66a1d2e59e
us-east-1 x86_64 ami-091bc4c3cad0acba8
us-east-1 arm64 ami-0c842833957110d67
us-east-2 x86_64 ami-0a43cbccceeab9ba4
us-east-2 arm64 ami-006d62b278cbb7de0
us-west-1 x86_64 ami-0f13ab77b59ea66c9
us-west-1 arm64 ami-019f9be1d8d72acba
us-west-2 x86_64 ami-071babe86db606f9f
us-west-2 arm64 ami-03da96a649b8bdafc

You can use any compatible EC2 instance type (including instance types with Enhanced or SR-IOV networking).

Configuring

iPXE EC2 instances are controlled via an iPXE script stored as the instance user-data. The iPXE AMI includes an embedded script that will automatically obtain an IP address via DHCP, print out some useful diagnostic information, and then download and execute http://169.254.169.254/latest/user-data.

You can use this user-data iPXE script to direct the remainder of the network boot process. For example, to download and boot Tiny Core Linux, you could set your instance's user data to contain:

  #!ipxe
  set base http://tinycorelinux.net/12.x/x86/release/distribution_files/
  kernel ${base}/vmlinuz64 initrd=rootfs.gz initrd=modules64.gz
  initrd ${base}/rootfs.gz
  initrd ${base}/modules64.gz
  boot

EC2 iPXE boot

Congratulations on successfully booting an EC2 instance using iPXE!

Success

iSCSI

You can use your user-data script to direct iPXE to boot from an iSCSI target. For example: to boot from an iSCSI target hosted on another EC2 instance 172.16.0.1 within the same VPC, you could set your instance's user data to contain:

  #!ipxe
  sanboot iscsi:172.16.0.1::::iqn.1995-08.org.example.iscsitarget:disk1

Note that the operating system on the iSCSI target disk will need to include the appropriate software and configuration to allow it to identify its own iSCSI root disk. You can install software such as sanbootable to help set up the required configuration.

IPv6

The iPXE AMI will include support for both IPv4 and IPv6. You should enable IPv6 in your VPC to speed up the boot, since otherwise iPXE will spend several seconds attempting to obtain an IPv6 address.

Troubleshooting

You can view the iPXE output via the EC2 system log or instance screenshot. For example:

  aws ec2 get-console-output --query Output --output text \
          --instance-id i-04549ed5e420eae6e

You should see output similar to:

  iPXE 1.21.1+ (gfa012) -- Open Source Network Boot Firmware -- http://ipxe.org
  Features: DNS HTTP HTTPS iSCSI TFTP SRP AoE ELF MBOOT PXE bzImage Menu PXEXT
  Amazon EC2 - iPXE boot via user-data
  CPU: GenuineIntel Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
  net0: 06:ee:8d:98:cc:67 using netfront on vif/0 (Ethernet) [closed]
    [Link:up TX:0 TXE:0 RX:0 RXE:0]
  Configuring (net0 06:ee:8d:98:cc:67)...... ok
  net0: 172.31.41.104/255.255.240.0 gw 172.31.32.1
  net0: fe80::4ee:8dff:fe98:cc67/64
  http://169.254.169.254/latest/user-data... ok

Warning

Note that there is often a time delay of several minutes in obtaining system logs or instance screenshots from EC2 - this is a longstanding problem with EC2 itself and is not related to iPXE. You may need to retry the command several times (or possibly stop the instance) in order to obtain any output.

Building from source

You can build your own version of the public iPXE AMIs using:

  make CONFIG=cloud EMBED=config/cloud/aws.ipxe \
       bin-x86_64-pcbios/ipxe.usb bin-arm64-efi/ipxe.usb

and import them using the aws-import tool (found in the contrib directory in the iPXE source tree).

howto/ec2.txt ยท Last modified: 2025/10/13 16:33 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL https://ipxe.org
References to "iPXE" may not be altered or removed.