This project simplifies the creation of:
- A custom Ubuntu Autoinstall ISO for fully automated installations
- A VFAT-formatted "cidata" floppy image with cloud-init configuration (NoCloud data source)
All processes are managed through a single Makefile.
- Automatic dependency checks for ISO builds and required-file checks
- Customizable GRUB menu
- Non-interactive scripts: controlled entirely via
make - VFAT floppy image production using a temporary mount point
- Provisioning multiple Ubuntu servers quickly and consistently in a datacenter or virtualized environment
- Automated lab or testbed setup
- Infrastructure as Code (IaC) deployments
Install the following packages on your Ubuntu host:
sudo apt install curl p7zip-full xorriso dosfstoolsNote: sudo is required for make cidata to create and mount the
floppy image as a loop device.
You also need roughly 8 GB free on the build host: about 3 GB for the downloaded ISO, the same again for the extracted tree, and the rebuilt ISO on top.
Provide the following files in your project directory:
| File | Purpose |
|---|---|
meta-data.yml |
Cloud-init meta-data file (used by both ISO and |
| floppy targets) | |
user-data.yml |
Cloud-init user-data file (used by both ISO and |
| floppy targets) | |
grub-autoinstall.menu |
GRUB menu entries for the autoinstall ISO |
The repo includes three user-data variants to choose from:
user-data-bios.yml— BIOS-only installsuser-data-efi.yml— EFI-only installsuser-data-bios+efi.yml— dual BIOS/EFI installs
Copy the appropriate one to user-data.yml before building:
cp user-data-bios+efi.yml user-data.ymlThe ubuntu user's password is ubuntu. This is deliberately a bootstrap
credential: these hosts are handed to configuration management immediately
after install, and the first pass rotates it. Treat the window between first
boot and that pass as the exposure, and keep provisioning on a trusted
segment.
If you are not following that workflow, change the hash in the identity
section before deploying — generate a replacement with openssl passwd -6.
The fixed logical volumes total 27 GiB before lvm_part (size: -1) claims
anything, so the install disk must be at least 28 GiB — 27 GiB of
volumes plus a 1 GiB boot partition and the 1 MiB BIOS grub reserve.
A 20 GB VM disk — a natural default — fails during partitioning. This is
separate from the build-host space noted above. Shrink the lvm_partition
sizes if you want a smaller target.
menuentry "Ubuntu Server Autoinstall" {
set gfxpayload=keep
linux /casper/vmlinuz autoinstall ds=nocloud\;s=/cdrom/server/ ---
initrd /casper/initrd
}
Run:
makeThis command:
- Downloads the Ubuntu server ISO
- Extracts it
- Adds autoinstall files
- Patches GRUB
- Creates
ubuntu-26.04-autoinstall.isoby default
You can boot this ISO in a virtual machine or on physical hardware for an unattended installation.
Run (requires root privileges):
sudo make cidataOutput: cidata.img (1.44MB VFAT-formatted floppy image)
Contents:
meta-datauser-data
Use this image as a secondary disk ("cidata") in your hypervisor for NoCloud-based installs. For example:
- Proxmox: Add as a "floppy" to the VM
- QEMU: Use with
-drive file=cidata.img,if=floppy,format=raw,readonly=on
Run:
make cleanclean deliberately keeps the downloaded ISO so you do not have to re-fetch
several GB. Use make distclean to remove that as well.
kernel-extractor.sh mounts an Ubuntu ISO (loopback) and copies out the
kernel, initrd, and every root filesystem image — useful for iPXE or other
netboot setups where the kernel and initrd are served directly rather than
booted from an ISO. This script is standalone and not wired into the
Makefile.
It copies all .squashfs images, not just one. Since roughly 23.04 the
live-server ISO no longer ships a single filesystem.squashfs; it carries a
layered set (ubuntu-server-minimal.squashfs, then
ubuntu-server-minimal.ubuntu-server.squashfs, and so on) that is stacked at
boot and is useless a layer at a time.
sudo ./kernel-extractor.sh <path-to.iso> <output-dir>Requires root (or equivalent loopback-mount privileges) to mount the ISO.
- Ubuntu Release: Edit
VERSIONin theMakefileto change the Ubuntu release. The current default is26.04. - GRUB Menu: Modify
grub-autoinstall.menuto add or edit GRUB menu entries, including different kernel arguments for multiple install modes. Rename the entries freely — the patch rule brackets whatever it inserts betweenUBUNTU-AUTOINSTALL-MENU-BEGIN/-ENDcomment markers and rewrites that block on every build, so menu edits are picked up and the entries never accumulate. Do not hand-edit between those markers; the next build discards it. The patch rule also setsset default="0"so the autoinstall entry is the one that boots unattended. - Cloud-Init Configuration: Use valid cloud-init syntax in
meta-data.ymlanduser-data.yml.
menuentry "Ubuntu Server Autoinstall" {
set gfxpayload=keep
linux /casper/vmlinuz autoinstall ds=nocloud ---
initrd /casper/initrd
}
When the cloud-init files are on a floppy, some documentation recommends setting the nocloud device:
linux /casper/vmlinuz autoinstall ds=nocloud\;s=/dev/fd0/ ---
The Ubuntu Autoinstall ISO can be used in a iPXE setup. Use
kernel-extractor.sh to pull vmlinuz and initrd out of the ISO built
above. The following iPXE menu uses the cloud-init user-data file in the uai
directory on an iPXE server:
/tftpboot/uai
├── /tftpboot/uai/initrd
├── /tftpboot/uai/server
│ ├── /tftpboot/uai/server/meta-data
│ └── /tftpboot/uai/server/user-data
├── /tftpboot/uai/uai.iso
└── /tftpboot/uai/vmlinuz
:uai
kernel http://10.0.0.6/uai/vmlinuz
initrd http://10.0.0.6/uai/initrd
imgargs vmlinuz initrd=initrd ip=dhcp \
url=http://10.0.0.6/uai/uai.iso autoinstall \
cloud-config-url=http://10.0.0.6/uai/server/user-data ---
boot
- Missing Dependencies: The default
maketarget checks for required commands before building the ISO. Thecidatatarget checks its own (mkfs.vfat,fsck.fat,mount,umount,dd). - Root Privileges: If you see "must be run as root" when building
cidata, usesudo make cidata. - Autoinstall Issues: If the VM does not detect the autoinstall from
the ISO, try attaching
cidata.imgas a floppy or secondary disk.
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
https://askubuntu.com/q/1403546
- Author: Copyright (c) 2023-2026 Jack Bailey
- License: MIT
- Disclaimer: Use at your own risk!