Skip to content

Instantly share code, notes, and snippets.

@random-robbie
Created November 26, 2023 08:24
Show Gist options
  • Save random-robbie/214778ea16d21c4067578f666316736d to your computer and use it in GitHub Desktop.
Save random-robbie/214778ea16d21c4067578f666316736d to your computer and use it in GitHub Desktop.

Why is this not working

mkdir u22.10-autoinstall-ISO
cd u22.10-autoinstall-ISO
mkdir source-files
wget https://old-releases.ubuntu.com/releases/kinetic/ubuntu-22.10-live-server-amd64.iso
mkdir source-files
7z -y x ubuntu-22.10-live-server-amd64.iso -osource-files
cd source-files
mv  '[BOOT]' ../BOOT
nano boot/grub/grub.cfg
menuentry "Autoinstall Ubuntu Server" {
    set gfxpayload=keep
    linux   /casper/vmlinuz quiet autoinstall ds=nocloud\;s=http://192.168.1.71/  ---
    initrd  /casper/initrd
}

cd source-files

xorriso -as mkisofs -r \
  -V 'Ubuntu 22.10 AUTO (EFIBIOS)' \
  -o ../ubuntu-22.10-autoinstall.iso \
  --grub2-mbr ../BOOT/1-Boot-NoEmul.img \
  -partition_offset 16 \
  --mbr-force-bootable \
  -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b ../BOOT/2-Boot-NoEmul.img \
  -appended_part_as_gpt \
  -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
  -c '/boot.catalog' \
  -b '/boot/grub/i386-pc/eltorito.img' \
    -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
  -eltorito-alt-boot \
  -e '--interval:appended_partition_2:::' \
  -no-emul-boot \
  .

user-data hosted on my local server

autoinstall:
  version: 1
  identity:
    hostname: ubuntu-server-1
    username: ubuntu
    password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
    realname: "Ubuntu User"
    user-data:
      lock_passwd: false

  keyboard:
    layout: en
    variant: gb

  locale: en_GB.UTF-8
  keyboard: en_GB.UTF-8
  language: en
  country: GB

  storage:
    grub:
      install_devices:
        - /dev/sda

    layout:
      name: direct

    filesystem:
      - device: /dev/sda
        format: ext4
        wipe: superblock
        label: root

  user-data:
    timezone: Europe/London
    package-selection: standard
    update: yes
    upgrade: yes

  early-commands:
    - curtin in-target --target=/target -- apt-get install -y openssh-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment