Amazon Linux 2 and 2023

2 and 2023 for users

image-garden finds the newest Amazon Linux 2 and 2023 KVM images with a small program that reads Amazon's SHA256SUMS list, on x86_64 (Amazon Linux 2 with BIOS) and aarch64 (Fedora's EDK2 and -cpu neoverse-n1); Amazon Linux 2 powers off by hand after provisioning, and guests have an amazonlinux user.

On the map: systems

▶ Watch this deck — 6 scenes, ~5 min

Worth seeing first

01 Amazon Linux outside Amazon

AMAZON LINUX Amazon's own distribution: test on it before you pay for an instance KVM images from cdn.amazonlinux.com x86_64 aarch64 Amazon Linux 2 the older one amazonlinux-cloud-2.x86_64 amazonlinux-cloud-2.aarch64 Amazon Linux 2023 its successor amazonlinux-cloud-2023.x86_64 amazonlinux-cloud-2023.aarch64 ubuntu-cloud-24.04.x86_64 https://cloud-images.ubuntu.com/noble/current/… amazonlinux-cloud-2023.x86_64 found when make runs: curl …/SHA256SUMS | awk … finding the URL how they boot the first boot worth knowing
Amazon Linux, Amazon's own distribution, published as KVM images on cdn.amazonlinux.com: Amazon Linux 2, the older generation, and 2023, its successor, each on x86_64 and aarch64, four systems; ubuntu-cloud-24.04.x86_64 has a fixed URL, amazonlinux-cloud-2023.x86_64 one found when make runs; the deck covers finding the URL, booting, the first boot and what to keep in mind

Four systems: amazonlinux-cloud-2 and amazonlinux-cloud-2023, each on x86_64 and aarch64, from cdn.amazonlinux.com.

If your software runs on AWS, sooner or later it meets Amazon Linux, Amazon's own distribution. It's worth testing there before you pay for an instance, and you can: Amazon publishes it as images for KVM too, and image-garden uses those. There are two generations. Amazon Linux 2 is the older one, and Amazon Linux 2023 its successor. Each runs on x86_64 and 64-bit Arm, which makes four systems, such as amazonlinux-cloud-2023.x86_64. Unlike ubuntu-cloud-24.04.x86_64, none of them has a fixed URL. This deck shows how image-garden finds them, how they boot, what their first boot does differently, and what to keep in mind.

Details and sources

Details

  • data/amazonlinux.ini has Group=amazonlinux, Variant=cloud and four sections: amazonlinux-cloud-2 and amazonlinux-cloud-2023, each .x86_64 and .aarch64, all with URLProgram instead of URL (amazonlinux.ini:4-42).
  • The images come from Amazon's KVM directories, https://cdn.amazonlinux.com/os-images/latest/kvm/ and …/kvm-arm64/ for 2, https://cdn.amazonlinux.com/al2023/os-images/latest/kvm/ and …/kvm-arm64/ for 2023.
  • The README: versions 2 and 2023 on x86_64 and aarch64, with neoverse-n1 for aarch64 (README.md:621-625).
  • ubuntu-cloud-24.04.x86_64 names its image with a fixed URL (ubuntu.ini:237-242).
  • That Amazon Linux is AWS's own distribution and that 2023 succeeds 2 is Amazon's description (derived, not in the source).

02 The URL is found at build time

FOUND AT BUILD TIME a version in every file name, and a new one with every build al2023-kvm-2023.12.20261120.0-kernel-6.1-x86_64.xfs.gpt.qcow2 curl https://cdn.amazonlinux.com/al2023/os-images/latest/kvm/SHA256SUMS | awk '$2 ~ /^al2023-kvm-[^ ]*-x86_64\.xfs\.gpt\.qcow2$/ { print …$2; exit }' SHA256SUMS awk …/al2023-kvm-2023.12.20261120.0-kernel-6.1-x86_64.xfs.gpt.qcow2 written to the system's .url file also checks the download the version, into the cached name amazonlinux-cloud-2023-2023.12.20261120.0.x86_64.qcow2
Amazon's file names carry a version, such as al2023-kvm-2023.12.20261120.0-kernel-6.1-x86_64.xfs.gpt.qcow2; the first make fetches the SHA256SUMS list with curl and awk prints the URL of the KVM qcow2 into the .url file; the same list checks the download; the version in the URL goes into the cached name amazonlinux-cloud-2023-2023.12.20261120.0.x86_64.qcow2

The first make fetches Amazon's SHA256SUMS list with curl, and awk prints the KVM image's URL; the same list checks the download. The version in the URL goes into the cached name, such as amazonlinux-cloud-2023-2023.12.20261120.0.x86_64.qcow2.

Amazon puts a version number in every file name, and a new build replaces the old one as it's published, so a URL written down today would go stale. So image-garden finds the URL itself, the first time you build the system: curl fetches Amazon's SHA256SUMS list for that generation and architecture, and awk prints the URL of the one KVM qcow2 file it names. The same list then checks the download. And the version in that URL goes into the cached file's name, so the image is saved as amazonlinux-cloud-2023, then the version, then the architecture.

Details and sources

Details

  • The program fetches Amazon's SHA256SUMS list with curl, and awk prints the first KVM qcow2 for the architecture; the same list checks the download, and the version becomes part of the cached name (amazonlinux.ini:26-33).
  • The names on the slide are what Amazon's lists held on 21 November 2026: al2023-kvm-2023.12.20261120.0-kernel-6.1-x86_64.xfs.gpt.qcow2 and amzn2-kvm-2.0.20261120.0-x86_64.xfs.gpt.qcow2 ("run"), and the local name the template gives the first.
  • Downloads are cached in $GARDEN_DL_DIR/amazonlinux/.

for contributors

In the data

  • Amazon Linux 2023 on x86_64: URLProgram=$(CURL) https://cdn.amazonlinux.com/al2023/os-images/latest/kvm/SHA256SUMS | awk '$$2 ~ /^al2023-kvm-[^ ]*-x86_64\.xfs\.gpt\.qcow2$$/ { print "https://cdn.amazonlinux.com/al2023/os-images/latest/kvm/"$$2; exit }', with URLPattern, LocalFilenameTemplate=amazonlinux-cloud-2023-@1.x86_64.qcow2 and SHA256SUMS pointing at the same list (amazonlinux.ini:26-33). The other three sections differ only in directory, prefix (amzn2-kvm- for 2) and architecture (arm64 in Amazon's names).
  • make runs the program as the recipe of the system's .url file (rulegen.py:526-530); the .filename rule applies URLPattern and LocalFilenameTemplate (rulegen.py:546-591); the download is checked with download-with-sha256sums against SHA256SUMS (rulegen.py:496-517), which looks up the local name and falls back to the URL's basename (image-garden:508-515).

Read more

03 How they boot

BOOT AND CPU x86_64 aarch64 Amazon Linux 2 Amazon Linux 2023 bios: QEMU's own BIOS efi efi: Fedora's EDK2 efi: Fedora's EDK2 boot loaders too old for newer EDK2 amazonlinux-cloud-2.aarch64.run, amazonlinux-cloud-2023.aarch64.run: qemu-system-aarch64 … -cpu neoverse-n1 … x86 host QEMU emulates the model: it boots 64-bit Arm host with KVM, your CPU must be recent enough to offer it a Raspberry Pi 5 is too old: run both emulated, on an x86_64 machine
On x86_64 Amazon Linux 2 boots with BIOS and 2023 with UEFI; on aarch64 both boot with UEFI from Fedora's EDK2 and the CPU model neoverse-n1 instead of max; QEMU emulates that model on an x86 host, a 64-bit Arm host needs a CPU recent enough to offer it, and on a Raspberry Pi 5 you run the two emulated on an x86_64 machine instead

amazonlinux-cloud-2.x86_64 boots with BIOS, the rest with UEFI. Both aarch64 systems use Fedora's EDK2 and -cpu neoverse-n1.

On x86_64, Amazon Linux 2 boots the old way, so QEMU's own BIOS starts it, while 2023 boots with UEFI. On 64-bit Arm both use UEFI, but not the EDK2 your distribution ships: their boot loaders predate what newer EDK2 enforces, so they're on the list that boots with Fedora's build. Arm needs one more change. image-garden sets the CPU model for both aarch64 systems to neoverse-n1 instead of max, and with that they boot. QEMU emulates that model happily on an x86 host. On a 64-bit Arm host, your CPU has to be recent enough to offer it. A Raspberry Pi 5's isn't, so there you'd run these two emulated, on an x86_64 machine.

Details and sources

Details

  • amazonlinux-cloud-2.x86_64 has Boot=bios; the other three Boot=efi (amazonlinux.ini:8-42). With bios, the .run script has no firmware files and QEMU uses its default BIOS (sys-boot; SeaBIOS is derived).
  • amazonlinux-cloud-2 and amazonlinux-cloud-2023 are in GARDEN_AARCH64_FEDORA_EDK2_SYSTEMS, the aarch64 systems "whose shim or grub predate what newer EDK2 enforces" (mk/010-qemu-aarch64.mk:114-145).
  • mk/050-amazonlinux-2.mk sets QEMU_CPU_AARCH64=neoverse-n1 for the .qcow2 and .run of both aarch64 systems (mk/050-amazonlinux-2.mk:10-11); the default is max (mk/010-qemu-aarch64.mk:5). The commit that added it, 3477e1a, says it "fixes booting for both" and "requires sufficiently new ARM CPU if used natively".
  • image-garden's CI: "Amazon Linux on aarch64, emulated on x86_64" (.gitlab-ci.yml:907-917); commit 422add9 moved it there to emulate "more recent ARM instruction set than is supported on Raspberry Pi 5". The slide's advice for a Raspberry Pi 5 host is derived from that commit.

04 A first boot with one more line

THE FIRST BOOT power_state: poweroff how every other system switches off Amazon Linux 2: not supported, the boot would never end define AMAZONLINUX_2_CLOUD_INIT_USER_DATA_TEMPLATE $(BASE_CLOUD_INIT_USER_DATA_TEMPLATE) - shutdown --poweroff now endef Amazon Linux 2023: the common template root password root amazonlinux password amazonlinux, sudo not ec2-user yum, dnf not through pkgproxy
Other systems power off with cloud-init's power_state module, which Amazon Linux 2 does not support; AMAZONLINUX_2_CLOUD_INIT_USER_DATA_TEMPLATE is the common template plus shutdown --poweroff now at the end of runcmd; Amazon Linux 2023 uses the common template; the users are root and amazonlinux, not ec2-user; yum and dnf do not go through pkgproxy

AMAZONLINUX_2_CLOUD_INIT_USER_DATA_TEMPLATE adds shutdown --poweroff now; 2023 uses the common template. Users root/root and amazonlinux/amazonlinux.

Every other system switches itself off after the provisioning boot with cloud-init's power state module. Amazon Linux 2's cloud-init doesn't support it, so without help that boot would never end. So a small make file defines a template just for group amazonlinux, release 2: the common template, plus shutdown --poweroff now at the end of runcmd. Amazon Linux 2023 uses the common template. Either way you get root and a user called amazonlinux, each with its own name as password, not the ec2-user you may know from AWS. And as on the other RPM families, yum and dnf don't go through pkgproxy.

Details and sources

Details

  • "Amazon Linux 2 does not support the power_state module so power off by hand": AMAZONLINUX_2_CLOUD_INIT_USER_DATA_TEMPLATE is $(BASE_CLOUD_INIT_USER_DATA_TEMPLATE) plus - shutdown --poweroff now (mk/050-amazonlinux-2.mk:4-8). The picker tries the group-and-release name first (mk/010-qemu.mk:285-298); for 2023 there is none, so the common template applies.
  • The common template asks cloud-init to power off with power_state (mk/010-qemu.mk:187-195).
  • Users: root/root and amazonlinux/amazonlinux with passwordless sudo; the group is the user's name (rulegen.py:467, mk/010-qemu.mk:200-211). Host names amazonlinux-2 and amazonlinux-2023. ec2-user is the default user of Amazon's images on EC2, which a users: list without default does not create (derived).
  • pkgproxy: the snap setup script and GOPROXY, no script for yum or dnf (mk/010-qemu.mk:127-180).
  • Known discrepancy: Quirk templates start from the base template. Amazon Linux 2's template builds on BASE_CLOUD_INIT_USER_DATA_TEMPLATE, so a project that redefines CLOUD_INIT_USER_DATA_TEMPLATE in .image-garden.mk changes every system but Amazon Linux 2 (and Gentoo); define AMAZONLINUX_2_CLOUD_INIT_USER_DATA_TEMPLATE too, keeping its shutdown line.

05 Worth knowing before you test

WORTH KNOWING Amazon Linux 2 end of support announced by Amazon new builds still published 2 and 2023 differ 2: yum 2023: dnf, based on Fedora one build per cache kept until a makefile changes or you clear the cache two machines may test two builds under one name Arm host no neoverse-n1 in your CPU? emulate: $ QEMU_ACCEL_MACHINE_PROP=,accel=tcg ./amazonlinux-cloud-2023.aarch64.run
Worth knowing: Amazon has announced an end of support for Amazon Linux 2, though builds were still published; 2 uses yum, 2023 uses dnf and is based on Fedora; the build found first is kept until a makefile changes or the cache is cleared; on a 64-bit Arm host whose CPU cannot offer neoverse-n1, run the system emulated with QEMU_ACCEL_MACHINE_PROP=,accel=tcg

Amazon Linux 2 has an announced end of support; 2023 is based on Fedora and uses dnf. The build found first is kept until a makefile changes. On Arm hosts, neoverse-n1 needs a recent CPU.

A few things set Amazon Linux apart. Amazon Linux 2 is the older generation, and Amazon has announced an end of support for it. New builds still appeared when this deck was written, but plan your move to 2023. The two differ inside, too: 2 uses yum and 2023 uses dnf, and 2023 is based on Fedora. image-garden keeps the build it found until a makefile changes or you clear the cache, so two machines can test different builds under the same system name. And on a 64-bit Arm host, remember the CPU model: if your CPU can't offer neoverse-n1, run these systems emulated.

Details and sources

Details

  • Amazon's announced end of support for Amazon Linux 2, the package managers (yum on 2, dnf on 2023) and 2023's Fedora base are Amazon's own descriptions (derived, not in the source). Amazon's list still named a new Amazon Linux 2 build, amzn2-kvm-2.0.20261120.0, on 21 November 2026 ("run").
  • The .url file depends only on the makefiles, so the program runs again only when image-garden.mk or .image-garden.mk changes or the file is removed (rulegen.py:526-530); see when upstream moves on.
  • QEMU_ACCEL_MACHINE_PROP is read by the .run script; its default is ,accel=kvm:tcg when QEMU supports KVM (README.md:943-945, mk/010-qemu-aarch64.mk:34-63). With ,accel=tcg QEMU emulates the CPU. The provisioning boot reads it from the environment as well (mk/010-qemu-aarch64.mk:15).

06 Where to go from here

ROADS Amazon Linux Finding the URL URL and local name, step by step Per-distro quirks the power-off and the others Enterprise Linux the RHEL family UEFI firmware Fedora's EDK2 Six architectures the Arm machine and CPU The users root and amazonlinux The support matrix every family
Roads from Amazon Linux: how the URL is found, per-distro quirks, Enterprise Linux, UEFI firmware, six architectures, the users and the support matrix

Next: how the URL is found, per-distro quirks, Enterprise Linux, UEFI firmware, the six architectures, the users and the support matrix.

So Amazon Linux is four systems found by a program, a CPU model of their own on Arm, and one extra line to switch Amazon Linux 2 off. From here, a deck for contributors explains, step by step, how the URL and the local name are found, and the quirks deck sets the power-off beside the other per-distribution changes. The Enterprise Linux deck covers the RHEL family, and the firmware deck Fedora's EDK2. The architecture deck shows the Arm machine and its CPU options, the users deck the users, and the support matrix every family side by side.

Details and sources

Read more

Basis of the statements on this page

The tables are read from data/amazonlinux.ini, mk/050-amazonlinux-2.mk, mk/010-qemu-aarch64.mk, mk/010-qemu.mk and rulegen.py at the commit in garden.commit ("code"). The current file names were fetched from Amazon's SHA256SUMS lists on 21 November 2026 ("run"). Amazon Linux's support dates, package managers and default user are Amazon's own descriptions ("derived").

The four systems

SystemArchBootImage directoryAmazon's file nameLocal file nameCPUaarch64 firmwareSection
amazonlinux-cloud-2.x86_64x86_64bioshttps://cdn.amazonlinux.com/os-images/latest/kvm/amzn2-kvm-VERSION-x86_64.xfs.gpt.qcow2amazonlinux-cloud-2-VERSION.x86_64.qcow2max—amazonlinux.ini:8-15
amazonlinux-cloud-2.aarch64aarch64efihttps://cdn.amazonlinux.com/os-images/latest/kvm-arm64/amzn2-kvm-VERSION-arm64.xfs.gpt.qcow2amazonlinux-cloud-2-VERSION.aarch64.qcow2neoverse-n1Fedora's EDK2amazonlinux.ini:17-24
amazonlinux-cloud-2023.x86_64x86_64efihttps://cdn.amazonlinux.com/al2023/os-images/latest/kvm/al2023-kvm-VERSION-kernel-K-x86_64.xfs.gpt.qcow2amazonlinux-cloud-2023-VERSION.x86_64.qcow2max—amazonlinux.ini:26-33
amazonlinux-cloud-2023.aarch64aarch64efihttps://cdn.amazonlinux.com/al2023/os-images/latest/kvm-arm64/al2023-kvm-VERSION-kernel-K-arm64.xfs.gpt.qcow2amazonlinux-cloud-2023-VERSION.aarch64.qcow2neoverse-n1Fedora's EDK2amazonlinux.ini:35-42
  • Checksum source: SHA256SUMS in the image directory, the same list the URLProgram reads; HASH NAME lines (rulegen.py:496-517).
  • On 21 November 2026 the lists named amzn2-kvm-2.0.20261120.0-x86_64.xfs.gpt.qcow2 and al2023-kvm-2023.12.20261120.0-kernel-6.1-x86_64.xfs.gpt.qcow2.
  • A new build is found when the .url file is made again: after a change to image-garden.mk or .image-garden.mk, or once it is deleted. Older builds stay in $GARDEN_DL_DIR/amazonlinux/ until removed (bt-urlprogram).

First boot

  • Template: AMAZONLINUX_2_CLOUD_INIT_USER_DATA_TEMPLATE for release 2, the base template plus - shutdown --poweroff now (mk/050-amazonlinux-2.mk:4-8); the common template for 2023.
  • Users: root/root and amazonlinux/amazonlinux with passwordless sudo, not ec2-user (mk/010-qemu.mk:200-211). Host names amazonlinux-2 and amazonlinux-2023.
  • pkgproxy: the snap setup script and GOPROXY only; yum and dnf are not proxied (mk/010-qemu.mk:127-180).

QEMU on aarch64

Roads from here

SYSTEMS · distributions

ARCHITECTURES · machines and firmware

FIRST BOOT · cloud-init changes

BUILD TIME · data and rules