Abstract
Historically we have published the artifacts necessary to netboot the d-i-based server installer. We should publish them for the subiquity-based installer too.
Rationale
For releases 18.04 and prior, we provide reasonably convenient instructions and artifacts to netboot a machine into a server. We should do the same for later releases (and also provide instructions that work with UEFI!).
Specification
For 18.04, we provide an entry point (https://cdimage.ubuntu.com/netboot/bionic/) that leads a user to a tarball they can untar at the root directory of a tftp server such that a netbooting machine can be pointed at “/pxelinux.0” in this directory via BOOTP and end up in an installation environment.
We should provide a similar entry point for newer releases (and also make UEFI boot equally easy to set up). This will take the form of a set of files (and a convenience tarball containing them) that will be published in the same directory as the dailies. So the https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/ directory will contain a directory ‘netboot’ which will contain directories ‘amd64’, ‘arm64’ and so on. Untarring the supplied tarball into the root directory of a tftp server and configuring bootp as documented will result in a working netboot environment. It will be possible to untar tarballs for multiple architectures into one directory without conflicts.
The bootloader config will need to include a URL for the ISO for the installer. By default, we’ll point to the directory the netboot files were downloaded from, but we should make it as easy as possible for the user to override this (maybe by adding a specific file or something).
Every architecture needs a kernel (which will be called “$arch/linux”) and casperized initrd (which will be called “$arch/initrd” – except for s390x where these have different names to match user expectations, see below). Additional files are needed per-architecture (yes, this is a screenshot of a google doc, discourse’s table support is annoying):
We should configure the e.g. https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/netboot/amd64/ directory listing to contain or link to configuration snippets for at least dnsmasq and dhcpd.
The https://cdimage.ubuntu.com/netboot/jammy/ directory should link to https://cdimage.ubuntu.com/ubuntu-server/jammy/daily-live/current/netboot/$arch for each arch.
Implementation
Most of the implementation work for this will be making changes to lp:ubuntu-cdimage. It already copies most of the files we need around when making a live server ISO:
- The kernel and initrd are produced by the livecd-rootfs build
- The signed shim and grub binaries are in the cd-boot-images-amd64 and cd-boot-images-arm64 packages
- pxelinux.0 is part of the pxelinux package so we can fish it out of there but we should add pxelinux.0 to cd-boot-images-amd64
We will probably need to write some code to generate the grub and pxelinux config files.
Possible future work
- Include the hwe kernel and have bootloader configs that offer a choice between generic and hwe but boot generic after a short delay.
- Make a UEFI bootable “micro.iso” that has shim, grub, grub.cfg, kernel, initrd and the grub.cfg has “ip=dhcp url=https://cdimage.ubuntu.com/path/to/full.iso”.
- Add some top level URLs / redirects that make it easy to use efibootmgr to add a boot entry to network boot from ubuntu.com.
- It’s not clear that this is possible, although it might well be. All the documentation about this sort of thing sucks.
Further Information
Some helpful links:
https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml
https://github.com/dannf/ubuntu-server-netboot
https://discourse.ubuntu.com/t/netbooting-the-live-server-installer/14510
https://discourse.ubuntu.com/t/netbooting-the-live-server-installer-on-ibm-power-ppc64el-with-petitboot
Interactive live server installation on IBM z/VM (s390x) (netbooting on s390x - non-PXE)
https://github.com/ibm-s390-linux/s390-tools/tree/master/netboot
https://c-nergy.be/blog/?p=13822
https://www.ibm.com/support/pages/sites/default/files/inline-files/SB10-7176-01.pdf
https://cpaelzer.github.io/blogs/004-s390x-kvm-pxe-on-ubuntu/
One day we may want to support booting via grub for amd64 BIOS rather than pxelinux.0 as we don’t use syslinux for anything else currently. But the network code in grub that would be used for this is not battle tested (to put it mildly).
Appendix – what we ship for 18.04 amd64
For bionic amd64 we ship at http://archive.ubuntu.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/:
The tl;dr is that you untar the netboot.tar.gz archive at the root directory your tftpd is serving from and then point the machine you want to netboot at “/pxelinux.0” on this tftp server via BOOTP.