Feature request : Make setting up iPXE / netbooting easier, suggest sane defaults, suggest boot firmwares

Hello,

Several months ago I tried netbooting PCs, VMs and embed computers from my openwrt router

I documented some of the challenges in

I have to say, it was very difficult and in the end I mostly had to resort to editing config files by hand.

However, this does not have to be this way.

There are very few options of boot firmware available and very few ways to configure them.

This is an obscure topic that requires extensive amount of study to get working. Mostly because the internet is absolutely filled to the brim with obsolete methods that are of use to no one except techno-historians.

In the VAST majority of cases, setting up iPXE is really all you need to do

https://ipxe.org/

BOOTP, etherboot those are simply obsolete, surpassed by ipxe in every way that matters.

To simply the process here is what needs to happen

Some random network device boots into it's network ROM.

This network ROM generally consist of technological heirloom that does very few things.

Request from DHCP server a TFTP or PXE server to download a better ROM/firmware

All we want to do is give this device a copy of the iPXE firmware for its CPU architecture, which in most cases will be X86 / X86_64 / ARM32 or ARM64 and someday, various MIPS flavours

And here is how you do this

For now, and until I can figure out a better way, you dump the following text into your /etc/dnsmasq.conf


dhcp-match=set:x86-legacy,option:client-arch,0
dhcp-match=set:x86-uefi,option:client-arch,6
dhcp-match=set:x86_64-uefi,option:client-arch,7
dhcp-match=set:x86_64-uefi,option:client-arch,9
#dhcp-match=set:arm32-uefi,option:client-arch,a
#dhcp-match=set:arm64-uefi,option:client-arch,b
#according to user ivanmara, I have not yet tested this
dhcp-match=set:arm32-uefi,option:client-arch,10
dhcp-match=set:arm64-uefi,option:client-arch,11
dhcp-match=set:ipxe,77,"iPXE"

dhcp-boot=tag:x86-legacy,ipxe.x86.undionly.kpxe,router.lan,192.168.1.1
dhcp-boot=tag:x86-uefi,ipxe.x86.efi,router.lan,192.168.1.1
dhcp-boot=tag:x86_64-uefi,ipxe.x86_64.efi,router.lan,192.168.1.1
#dhcp-boot=tag:arm32-uefi,ipxe.arm32.efi,router.lan,192.168.1.1
#dhcp-boot=tag:arm64-uefi,ipxe.arm64.snponly.efi,router.lan,192.168.1.1
dhcp-boot=tag:ipxe,http://router.lan/boot.ipxe,router.lan,192.168.1.1

You may or may not have to install the uhttpd package, I don't remember, but I have it installed
You need to place the firmware files in /www folder along with an boot.ipxe, which is the boot script that ipxe will run if you have not baked in an ipxe script into your own custom ipxe firmware

Despite what the ipxe website says, it is not necessary to build your own custom ipxe firmware, the standard distribution works just fine with the above settings, the configuration is retrieved entirely from the openwrt router

The ipxe folks have done a really good job at making sure that user cannot figure out which files they need, because they really REALLY want users to learn how to code and build their own firmwares.

It took me several weekends to figure out what I needed

And it is all in this, unlinked folder on their website

https://boot.ipxe.org/

The most important files are

For legacy bios
https://boot.ipxe.org/undionly.kpxe

For UEFI bios (you need both)
https://boot.ipxe.org/snponly.efi

And you need to server a boot.ipxe script which is what the iPXE firmware will do once booted

Once you can boot iPXE from your openwrt router, the hardest part is done, everything else is easy because the rest of the iPXE projet is very well documented , you will be able to boot anything into anything, pure tech nirvana (99% will die before reaching this step)

At this point the documentation is plenty and useful

https://ipxe.org/docs

!!!! OF PARTICULAR RELEVANCE, YOU CAN NOW BOOT DIRECTLY OF OPENWRT-SERVED ISCISI !!!

You only need to install the packages

open-iscsi

and

tgt

Here are the relevant commands for setting that up

First create LVM volumes on a USB stick and then tune this script to your liking

#!/bin/bash
tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 1
tgtadm --lld iscsi --op delete --mode logicalunit --tid 2 --lun 2
tgtadm --lld iscsi --op delete --mode logicalunit --tid 3 --lun 3
tgtadm --lld iscsi --op delete --mode logicalunit --tid 4 --lun 4
tgtadm --lld iscsi --op delete --mode logicalunit --tid 5 --lun 5
tgtadm --lld iscsi --op delete --mode logicalunit --tid 6 --lun 6
tgtadm --lld iscsi --op delete --mode logicalunit --tid 7 --lun 7
tgtadm --lld iscsi --op delete --mode target --tid 1
tgtadm --lld iscsi --op delete --mode target --tid 2
tgtadm --lld iscsi --op delete --mode target --tid 3
tgtadm --lld iscsi --op delete --mode target --tid 4
tgtadm --lld iscsi --op delete --mode target --tid 5
tgtadm --lld iscsi --op delete --mode target --tid 6
tgtadm --lld iscsi --op delete --mode target --tid 7

tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2022-10.lan.router:target01
tgtadm --lld iscsi --op new --mode target --tid 2 -T iqn.2022-10.lan.router:target02
tgtadm --lld iscsi --op new --mode target --tid 3 -T iqn.2022-10.lan.router:target03
tgtadm --lld iscsi --op new --mode target --tid 4 -T iqn.2022-10.lan.router:target04
tgtadm --lld iscsi --op new --mode target --tid 5 -T iqn.2022-10.lan.router:target05
tgtadm --lld iscsi --op new --mode target --tid 6 -T iqn.2022-10.lan.router:win10original
tgtadm --lld iscsi --op new --mode target --tid 7 -T iqn.2022-10.lan.router:win10lankit
tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/pve4/iscsitgt1
tgtadm --lld iscsi --op new --mode logicalunit --tid 2 --lun 2 -b /dev/pve4/iscsitgt2
tgtadm --lld iscsi --op new --mode logicalunit --tid 3 --lun 3 -b /dev/pve4/iscsitgt3
tgtadm --lld iscsi --op new --mode logicalunit --tid 4 --lun 4 -b /dev/pve4/iscsitgt4
tgtadm --lld iscsi --op new --mode logicalunit --tid 5 --lun 5 -b /dev/pve4/iscsitgt5
tgtadm --lld iscsi --op new --mode logicalunit --tid 6 --lun 6 -b /var/lib/vz/template/iso/Win10_21H2_English_x64.iso --device-type=cd
tgtadm --lld iscsi --op new --mode logicalunit --tid 7 --lun 7 -b /var/lib/vz/template/iso/win10_21h2_x64_lankit_2022-11-04.iso --device-type=cd
tgtadm --lld iscsi --op bind --mode target --tid 1 --initiator-address ALL
tgtadm --lld iscsi --op bind --mode target --tid 2 --initiator-address ALL
tgtadm --lld iscsi --op bind --mode target --tid 3 --initiator-address ALL
tgtadm --lld iscsi --op bind --mode target --tid 4 --initiator-address ALL
tgtadm --lld iscsi --op bind --mode target --tid 5 --initiator-address ALL
tgtadm --lld iscsi --op bind --mode target --tid 6 --initiator-address ALL
tgtadm --lld iscsi --op bind --mode target --tid 7 --initiator-address ALL
tgtadm --lld iscsi --op show --mode target
iscsiadm --mode discovery --type sendtargets --portal router.lan

You can also remotely list and check your iscsi devices with

tgtadm --lld iscsi --op show --mode target
iscsiadm --mode discovery --type sendtargets --portal router.lan

However we are not really offtopic from this feature request which is just

Make iPXE booting a ONLY CLICK setup, we don't need to know anything about the user and his network to enable iPXE booting with just one click !

5 Likes

What files are 32bit for both x86 and arm32 at https://boot.ipxe.org/?
I see only 64bit ipxe.efi for x64 and arm64-efi folder,
file ipxe.efi:
ipxe.efi: PE32+ executable (DLL) (EFI application) x86-64 Mono/.Net assembly, for MS Windows, 6 sections

Or - you could simply use the TFTP page on the web GUI. Was there an issue with the page?

The page https://boot.ipxe.org/ does not have 32-bit binaries.