UDE

Network booting
Login

Network booting

Purpose: boot an emulated machine from the network, with udedhcpd handing out the boot file and udetftpd serving it.

A PC boots from the network with PXE: its network card's boot ROM asks DHCP for an address, the address of a TFTP server and the name of a file, then loads that file with TFTP and runs it. The file is a small boot loader such as PXELINUX or iPXE, which loads a kernel and an initial RAM disk the same way. On a UDE network, udedhcpd -B -b answers the first question and udetftpd serves the files, without root and without touching the host's network.

QEMU PXE ROM (iPXE) udeswitch -T 0 udedhcpd 10.0.0.1 udetftpd 10.0.0.2 1. DHCP: an address, the TFTP server (-B) and the boot file (-b) 2. TFTP: the boot loader, its configuration, the kernel, the initrd
scale = 0.85
Q: box "QEMU" "PXE ROM (iPXE)" fit
S: box "udeswitch" "-T 0" fit at Q + (2.2, 0)
D: box "udedhcpd" "10.0.0.1" fit at S + (2.2, 0.6)
T: box "udetftpd" "10.0.0.2" fit at S + (2.2, -0.6)
line from Q.e to S.w
line from S.e to D.w
line from S.e to T.w
text "1. DHCP: an address, the TFTP" ljust at D.e + (0.2, 0.12)
text "server (-B) and the boot file (-b)" ljust at D.e + (0.2, -0.12)
text "2. TFTP: the boot loader, its" ljust at T.e + (0.2, 0.12)
text "configuration, the kernel, the initrd" ljust at T.e + (0.2, -0.12)

The example below boots the Debian installer in QEMU, first with PXELINUX, then with an iPXE script. It was run as written; see What was tested.

What you need

mkdir -p netboot/root && cd netboot
curl -LO https://deb.debian.org/debian/dists/trixie/main/installer-amd64/current/images/netboot/netboot.tar.gz
tar -xzf netboot.tar.gz -C root

The archive's pxelinux.cfg/default is a symbolic link into debian-installer/amd64/; udetftpd follows links that stay inside its root. Its menu waits on the VGA screen; for a serial console that boots at once, replace the link with a file of your own:

rm root/pxelinux.cfg/default    # pxelinux.cfg is a link: this removes the link inside it
cat > root/debian-installer/amd64/pxelinux.cfg/default <<'CFG'
SERIAL 0 115200
DEFAULT install
PROMPT 0
TIMEOUT 0
LABEL install
  KERNEL debian-installer/amd64/linux
  APPEND initrd=debian-installer/amd64/initrd.gz console=ttyS0,115200 ---
CFG

Boot with PXELINUX

Start a switch, a DHCP server that names the TFTP server and the boot file, and the TFTP server. QEMU sends no keepalives, so give the switch -T 0:

udeswitch -T 0 &
udedhcpd -a 10.0.0.1/24 -B 10.0.0.2 -b pxelinux.0 &
udetftpd -a 10.0.0.2/24 -r root &

Then boot a machine from its network card (-boot n):

L=local.type=inet,local.host=127.0.0.1,local.port=7601
R=remote.type=inet,remote.host=127.0.0.1,remote.port=7500
qemu-system-x86_64 -m 1024 -boot n -serial stdio -display none \
  -netdev dgram,id=n0,$L,$R -device e1000,netdev=n0,mac=52:54:00:12:34:56

Add -accel kvm where KVM is available. Within seconds udedhcpd logs the offer with its boot file, and udetftpd every file PXELINUX asks for:

udedhcpd: DHCP: DHCPACK 10.0.0.100 to 52:54:00:12:34:56, boot file pxelinux.0
udetftpd: TFTP: RRQ pxelinux.0 from 10.0.0.100:24694, octet, blksize 1432, window 1 (options acknowledged)
udetftpd: TFTP: RRQ ldlinux.c32 from 10.0.0.100:49152, octet, blksize 1408, window 1 (options acknowledged)
udetftpd: TFTP: RRQ pxelinux.cfg/01-52-54-00-12-34-56 from 10.0.0.100:49153: file not found
...
udetftpd: TFTP: RRQ pxelinux.cfg/default from 10.0.0.100:49162, octet, blksize 1408, window 1 (options acknowledged)
udetftpd: TFTP: sent debian-installer/amd64/linux to 10.0.0.100:49163, 12171200 bytes in 8645 blocks, 1105 ms, 0 retransmitted
udetftpd: TFTP: sent debian-installer/amd64/initrd.gz to 10.0.0.100:49164, 40761958 bytes in 28951 blocks, 3694 ms, 0 retransmitted

The "file not found" lines are normal: PXELINUX looks for a configuration named after the machine's MAC address, then after its IP address in hexadecimal, shorter and shorter, before default. To give one machine its own menu, create the file it asks for first. The installer then starts on the serial console with its "Select a language" screen.

Boot with an iPXE script

The ROM in QEMU's network cards is iPXE, which can load a kernel itself and follow a script. iPXE says who it is in its DHCP requests (user class iPXE), so udedhcpd can give it a script while other clients keep pxelinux.0; ipxe= entries are chosen first:

udedhcpd -a 10.0.0.1/24 -B 10.0.0.2 -b ipxe=boot.ipxe -b pxelinux.0 &

root/boot.ipxe:

#!ipxe
echo Booting Debian installer from ${next-server} over TFTP
kernel tftp://${next-server}/debian-installer/amd64/linux console=ttyS0,115200 initrd=initrd.gz
initrd tftp://${next-server}/debian-installer/amd64/initrd.gz
boot

${next-server} is the address given with -B. The same qemu command boots it; udetftpd logs three files, boot.ipxe, the kernel and the initrd.

The same setup in a configuration file

Both servers read the configuration file, so the switch address, the boot files and the root are written once:

[global]
connection = "udp://127.0.0.1:7500"

[udedhcpd]
subnet = "10.0.0.1/24"
next_server = "10.0.0.2"
boot_file = ["ipxe=boot.ipxe", "pxelinux.0"]

[udetftpd]
address = "10.0.0.2/24"
root = "root"          # relative to this file
udedhcpd -C netboot.toml &
udetftpd -C netboot.toml &

Other machines and firmware

Troubleshooting

What was tested

On 1 December 2026, on Debian 13 (x86-64), with QEMU 10.0.13 without KVM, the e1000 card's iPXE ROM and Debian trixie's netboot.tar.gz (kernel 6.12): both ways above reached the installer's first screen. With PXELINUX, udetftpd sent pxelinux.0, ldlinux.c32, the configuration, the 12 MB kernel and the 40 MB initrd, with no retransmissions; with the iPXE script, boot.ipxe, the kernel and the initrd. The host's tftp-hpa client, through udetap, fetched the initrd with 512-byte blocks (79614 blocks, so the block number wrapped past 65535) byte for byte, and curl the kernel with 1468-byte blocks.

make test runs udetftpd against an internal TFTP client (tests/udetftp.c): option negotiation, netascii, block number rollover, a lost acknowledgment, concurrent transfers, refused names and requests, and a transfer through a link that loses 10% of the frames. See udetftpd and udetftpd(8).