Sign inSign up

boxcutter/ubuntu-autoinstall

By boxcutter

•Updated 13 days ago

Ubuntu Autoinstall ISO generator.

Image
0

2.9K

boxcutter/ubuntu-autoinstall repository overview

⁠ubuntu-autoinstall

This image can be used to generate Ubuntu custom autoinstall ISOs - standard Ubuntu boot images that have some additional text files providing answers to all installation prompts/inputs. This script is based on cloudymax/pxeless⁠ which is in turn based on covertsh/ubuntu-autoinstall-generator⁠.

Creating a bootable ISO requires extracting the original image, embedding special boot sectors and reassembling it with tools like xorriso and fdisk. It's easier to assemble a temporary filesystem with all the necessary tooling within a container image, and then discard it once the ISO has been created.

You'll need to create an autoinstall.yaml⁠ file that contains your answers to all installation configuration prompts ahead of time. A good way to create a starter version of this file is to run through the Ubuntu install process manually on the desired equipment. The Ubuntu installer will create an autoinstall for repeating the installation in /var/log/installer/autoinstall-user-data. You can use this file as a starting point, then edit the file as needed.

Once you have an autoinstall.yaml file, download the ubuntu install ISO you wish to customize, and run this script to copy the autoinstall.yaml file to the ISO and modify the boot config so the autoinstall will be run in zero touch mode.

⁠Autoinstall on the root of the installation media

By default, this script uses the --config-root mode for configuring the autoinstall. The autoinstall.yaml is copied to the root of the install media. This is the recommended way to create a zero-touch install for Ubuntu 24.04 (or higher):

⁠Ubuntu Desktop
$ curl -LO https://releases.ubuntu.com/26.04/ubuntu-26.04.1-desktop-amd64.iso
$ docker run -it --rm \
  --mount type=bind,source="$(pwd)",target=/data \
  docker.io/boxcutter/ubuntu-autoinstall \
    --source ubuntu-26.04.1-desktop-amd64.iso \
    --autoinstall autoinstall.yaml \
    --config-root
⁠Ubuntu Server
$ curl -LO https://releases.ubuntu.com/26.04/ubuntu-26.04.1-live-server-amd64.iso
$ docker run -it --rm \
  --mount type=bind,source="$(pwd)",target=/data \
  docker.io/boxcutter/ubuntu-autoinstall \
    --source ubuntu-26.04.1-live-server-amd64.iso \
    --autoinstall autoinstall.yaml \
    --config-root

⁠Autoinstall by way of cloud-config

⁠Running as a non-root user

The container runs as root by default, so on Linux hosts the generated ISO will be owned by root. To have the ISO owned by your user instead, pass --user:

$ docker run -it --rm \
  --user "$(id -u):$(id -g)" \
  --mount type=bind,source="$(pwd)",target=/data \
  docker.io/boxcutter/ubuntu-autoinstall \
    --source ubuntu-26.04.1-live-server-amd64.iso \
    --autoinstall autoinstall.yaml \
    --config-root

⁠CLI

% docker run -it --rm \
  --mount type=bind,source="$(pwd)",target=/data \
  docker.io/boxcutter/ubuntu-autoinstall -h
Usage:  /app/image-create.sh [options]

Ubuntu Autoinstall ISO generator

  -h, --help                Print help
  -s, --source PATH         Source ISO path
  -d, --destination PATH    Destination ISO path
  -a, --autoinstall PATH    Autoinstall config file
  -g, --grub PATH           Grub.cfg file
  -l, --loopback PATH       Loopback.cfg file
  -m, --metadata PATH       meta-data config file
  -N, --config-nocloud      Copy autoinstall config as NoCloud provider
  -R, --config-root         Copy autoinstall to ISO root

Tag summary

Content type

Image

Digest

sha256:81f3dd107…

Size

41.8 MB

Last updated

13 days ago

docker pull boxcutter/ubuntu-autoinstall