PXE help - Serve multiple bootable ISOs through network boot using Truenas/Pihole

Hello!

I am currently configuring my home network and have built my own TrueNAS server.

The server is an hp proliant dl380p g8.

I am running Truenas SCALE, and I have PiHole set up as local DNS/DHCP.

I would like to set up either PXE or some other option to boot multiple ISO installations on my network. I would like it so that I could boot a laptop or VM on my network, select “ubuntu” or “windows 10” and have them install and download.

I did see this software, but I have not been keeping up with stuff enough to know if this was the best option or not.

I would prefer something I could keep in a container or configure through Pihole itself, if possible.

if youre gonna do it manually, ubuntu have some docs specific to their server distro here: Netbooting the server installer on amd64 | Ubuntu

pxelinux itself is quite well documented:
https://wiki.syslinux.org/wiki/index.php?title=PXELINUX

for me personally, after spending the effort to get network boot to work, i think im gonna stick to just a bagful of USB sticks.

i will say, i found it worthwhile when doing a bit of embedded linux kernel development for the stm32dk1 dev board - swapping out SD cards gets boring real fast. but for PCs and stuff, i found it to be too much maintenance effort.

1 Like

Years ago, I managed to get this working:

HTH!

1 Like

That looks like a great jumping off point, I need more than just Ubuntu but this will still be helpful, thank you.

That’s what I was afraid of. I wanted something that I could set up and forget about (besides updates, obviously)

Looks like this has recently been updated (2019 is recent I guess haha) I’ll definitely check it out, it looks very close to what I’m after. Thanks!

I think, if all that you want is netbooting ISOs, then you can probably get away with it being reasonably self-contained.

Fundamentally, its just a TFTP server serving up the pxelinux ‘bootloader’, and the pxelinux bootloader will then fetch the .cfg files you have over at the TFTP server, and from there you can really do whatever you want (since pxelinux knows about http, tftp, whatever.)

You can server the ISO files over http (or the same TFTP server as the pxelinux, but TFTP can be quite slow in my experience) from the same container, or if your kernel is advanced enough, it can just pull the ISOs from a http url as is the case with the ubuntu server distro.

The big annoyance I found was having to have the dhcp tftp boot parameters setup in my DHCP/router config. I’m using MikroTik hardware (still not sure if this was a good investment), so unless your dhcp server is already in a docker container, you’ll have to keep your dhcp config maintained in parallel.

The worst part by far though, is that you will be at the mercy of the first stage bootloader of whatever hardware you’re trying to netboot. and ofcourse they are all very different. I had a 32-bit x86 box append a 0xFF byte at the end of the TFTP boot filename before it fetched it, which I had to work around by manually putting a zero-byte at the end of the TFTP boot filename to act as a NUL terminator. How did I discover this? Port mirroring on my router, and then doing wireshark packet analysis. Well, I suppose I atleast learned something new.

run-of-the-mill 64 bit UEFI stuff I found more well behaved, but I still had to fiddle with the BIOS to explicitly enable boot over LAN.

I still haven’t got the RPi4 bootloader to respect by DHCP TFTP server address option. I ended up having to manually specify the TFTP address and then flashing the firmware, similar to how this guide demonstrates. Only then did it go over the cable to fetch the kernel image over TFTP. I know its my own fault for not providing what the RPI4 bootloader wants, but finding out exactly what it wants is quite hard. Come to think of it, I think the source code should be available somewhere.

The other major pain point is the sea of arcane DHCP option parameters. there are hundreds of them, and god knows what your particular first-stage ROM bootloader happens to honour, and what it ignores. Thankfully the TFTP ones are fairly obvious, but PXELINUX uses some of its own for paths and stuff.

The DHCP handbook has useful stuff about this.


P.S. that LTSP project does look worth a try, to avoid all this nonsense.