This is an old revision of the document!
https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2004AutoinstFormat https://medium.com/@tlhakhan/ubuntu-server-20-04-autoinstall-2e5f772b655a https://askubuntu.com/questions/1235723/automated-20-04-server-installation-using-pxe-and-live-server-image
main ubuntu page for discussing autoinstall.yml
https://gist.github.com/s3rj1k/55b10cd20f31542046018fcce32f103e
https://gist.github.com/Brainiarc7/76902466d8628bcf5cd79d8953edbdd8
:focaldesktopiso kernel ${boot-url}nfs/focal/casper/vmlinuz initrd ${boot-url}nfs/focal/casper/initrd imgargs vmlinuz initrd=initrd boot=casper ip=dhcp url=${boot-url}ubuntu/focal/ubuntu-20.04.1-desktop-amd64.iso maybe-ubiquity boot
ipxe menu item
:hirsuteserver kernel ${boot-url}ubuntu/hirsute/iso/vmlinuz initrd=initrd autoinstall url=${boot-url}ubuntu/hirsute/iso/hirsute-live-server-amd64.iso net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net;s=${boot-url}ubuntu/hirsute/cloud-init/ initrd ${boot-url}ubuntu/hirsute/iso/initrd boot
File structure:
tftp$ find ubuntu/hirsute/ ubuntu/hirsute/ ubuntu/hirsute/iso ubuntu/hirsute/iso/initrd ubuntu/hirsute/iso/hirsute-live-server-amd64.iso ubuntu/hirsute/iso/vmlinuz ubuntu/hirsute/cloud-init ubuntu/hirsute/cloud-init/meta-data ubuntu/hirsute/cloud-init/user-data
meta-data
instance-id: hirsute-autoinstall
user-data aka autoinstall.yml
#cloud-config autoinstall: apt: geoip: true preserve_sources_list: false primary: - arches: [amd64] uri: http://us.archive.ubuntu.com/ubuntu identity: {hostname: autoinstall-00, password: $6$supersecretpasswdhash, realname: phil, username: phil} keyboard: {layout: us, variant: ''} locale: en_US.UTF-8 network: network: ethernets: eth0: critical: true dhcp-identifier: mac dhcp4: true version: 2 ssh: allow-pw: true authorized-keys: - "authkey ed25519 FTW" install-server: true storage: grub: reorder_uefi: False config: - {ptable: gpt, wwn: '0x50026b77832fae66', path: /dev/sda, wipe: superblock, preserve: false, name: '', grub_device: false, type: disk, id: disk-sda} - {device: disk-sda, size: 536870912, wipe: superblock, flag: boot, number: 1, preserve: false, grub_device: true, type: partition, id: partition-0} - {fstype: fat32, volume: partition-0, preserve: false, type: format, id: format-0} - {device: disk-sda, size: 1073741824, wipe: superblock, flag: '', number: 2, preserve: false, grub_device: false, type: partition, id: partition-1} - {fstype: ext4, volume: partition-1, preserve: false, type: format, id: format-1} - {device: disk-sda, size: 238444085248, wipe: superblock, flag: '', number: 3, preserve: false, grub_device: false, type: partition, id: partition-2} - name: ubuntu-vg devices: [partition-2] preserve: false type: lvm_volgroup id: lvm_volgroup-0 - {name: ubuntu-lv, volgroup: lvm_volgroup-0, size: 119220994048B, preserve: false, type: lvm_partition, id: lvm_partition-0} - {fstype: ext4, volume: lvm_partition-0, preserve: false, type: format, id: format-2} - {device: format-2, path: /, type: mount, id: mount-2} - {device: format-1, path: /boot, type: mount, id: mount-1} - {device: format-0, path: /boot/efi, type: mount, id: mount-0} version: 1 user-data: timezone: America/Chicago disable_root: false late-commands: - echo 'phil ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu - sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0"/' /target/etc/default/grub - curtin in-target --target /target update-grub2
list of bugs
https://possiblelossofprecision.net/?p=2312
#!ipxe :freedos sanhook payload.img || goto failed #optional kernel memdisk raw initrd http://www.freedos.org/download/download/FD12FLOPPY.zip boot || goto failed :failed echo Booting failed, dropping to shell goto shell
truncate payload.img --size 32MB sfdisk payload.img << EOF 63,,b EOF
losetup --partscan /dev/loop20 ./payload.img mkfs.vfat /dev/loop20p1
mount /dev/loop20p1 /mnt/ cp <necessary files> /mnt/ umount /mnt losetup -d /dev/loop20
mkdir C:\temp\winpe copype x86 C:\temp\winpe\x86 copype amd64 C:\temp\winpe\amd64
dism /mount-image /imagefile:"C:\temp\winpe\amd64\media\sources\boot.wim" /index:1 /mountdir:"C:\temp\winpe\amd64\mount" dism /image:C:\temp\winpe\amd64\mount /add-driver /driver:c:\temp\winpe\drivers /recurse /forceunsigned dism /unmount-image /mountdir:"C:\temp\winpe\amd64\mount" /commit
dism /mount-image /imagefile:"C:\temp\winpe\x86\media\sources\boot.wim" /index:1 /mountdir:"C:\temp\winpe\x86\mount" dism /image:C:\temp\winpe\x86\mount /add-driver /driver:c:\temp\winpe\drivers /recurse /forceunsigned dism /unmount-image /mountdir:"C:\temp\winpe\x86\mount" /commit