Netboot of customized Ubuntu 20.04 LTS server/client images via PXE

Dear all:

Is there any PXE boot setup - apart from the live netboot installer (see Netbooting the live server installer) - being supported by Ubuntu 20.04 LTS?

I’d like to roll out/deliver specially customized Ubuntu 20.04 LTS root images in a fully automtatic netboot fashion to hardware clients within my network. I am not interested in doing unattended preseed installs via netboot live installer, as I need to heavily modify the Ubuntu base/server and preseeding does not offer enough flexibilty in my case.

My setup consists in a central DHCP server (not under my control) and a Linux within my network box running either a TFTP (atftpd/inted) and an NFS server. Clients are supposed to fetch the PXELINUX ROM image (pxelinux.0 v6.04) via tftp, then load the initrd.img (initramfs) and vmlinuz images and finally step into the nfsroot.

This setup works perfectly fine delivering Debian Linux to the client machines. However vmlinuz images from Ubuntu (apart from those of the live installer) seem not to be compatible with PXELINUX. pxelinux.0 simply aborts while trying to load intramfs and vmlinuz.

Unfortunately, the community guides about the netboot topic (e. g. help.ubuntu.com/community/Installation/OnNFSDrive, help.ubuntu.com/community/Installation/Netboot, https://wiki.ubuntu.com/UEFI/PXE-netboot-install) are rather outdated and partly inconsistent.

Thanks for your suggestions and Best
Sebastian

FYI the legacy mini.iso is still available on

http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/

1 Like

Hi Norbert,

sorry, but this hint does not help me at all.
Picking up the initramfs (initrd.gz) and vmlinuz (linux) from the legacy netboot installer only allows me to boot into the Ubuntu installer environment. This is not what I plan and want to do!

Is there any possiblity to build with Ubuntu 20.04 an vmlinuz kernel and initramfs image suitable for NFS or other netbooting scenario?

Best
Sebastian

@2c74e-bux8qa9-13m56
I think you’ll want to look into debootstrap and specifically install the package live-boot. You install the kernel normally and just copy those files to your tftp server. Then export the debootstrap directory (where you installed the OS) via nfs.

You should then be able to append options to the kernel to specify the location of the filesystem on NFS.

As an example here is my iPXE entry to boot the live server installer.

:ubuntu_server_nfs
imgfree
kernel ${boot-url}ubuntu/${release}/live-${type}-amd64/casper/vmlinuz initrd=initrd netboot=nfs nfsroot=192.168.1.1:/srv/iso/ubuntu/${release}/${type} console=ttyS0 console=tty0 autoinstall net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net;s=${boot-url}ubuntu/cloud-init/
initrd ${boot-url}ubuntu/${release}/live-${type}-amd64/casper/initrd
boot || goto failed

Or booting an install OS saved as an img.

:liverescue
imgfree
kernel ${boot-url}liverescue/ubuntu/focal/vmlinuz
initrd ${boot-url}liverescue/ubuntu/focal/initrd.img
imgargs vmlinuz initrd=initrd.img boot=live components username=user fetch=${boot-url}liverescue/ubuntu/focal/filesystem.squashfs 
boot || goto failed

You solution lies somewhere between those two examples.

The above solution would download the custom/vendor-provided cloud image and untar to the target host’s disk? Or is there another way to deal with it?
Looking to PXE boot the bare-bone system, create disk layout and copy the custom image over the disk.
Any help would be appreciated.

Thanks