Skip to content
Search Oracle Linux

    Browse this documentation

    PXE network install, end to end: dnsmasq/grub chain, a four-layer troubleshooting map and unattended install (with anti-reloop rules)

    The complete PXE network install setup: the DHCP/TFTP/bootloader/kickstart quadruple, plus a completed end-to-end unattended install — including a troubleshooting map that dissects the classic “initrd takes over and hangs” failure into four root-cause layers. You get more than a success tutorial: the evidence and fix for every layer.

    ┌─ PXE server (OL10, VM 388) ────────────┐
    │ dnsmasq: DHCP(67/69) + TFTP(69) │
    │ http.server:8000 → ks.cfg + stage2(ISO)│
    │ NAT: 192.168.100.0/24 → outbound(repo) │
    │ tftp-root: ol10-grub/core.efi+grub.cfg │
    │ ol10/vmlinuz+initrd.img │
    └──────────────┬─────────────────────────┘
    private bridge vmbr9 (192.168.100.0/24, no uplink)
    │
    ┌─ PXE target (OVMF/q35, 4G RAM, 20G disk) ────┐
    │ PXE → grub → kernel+initrd → anaconda → install │
    └──────────────────────────────────────────────┘

    EL10 no longer ships syslinux — for UEFI PXE, generate a dedicated bootloader with grub2-mknetdir:

    /var/lib/tftpboot/ol10-grub/x86_64-efi/grub.cfg
    dnf install -y grub2-efi-x64-modules grub2-tools-extra
    grub2-mknetdir --net-directory=/var/lib/tftpboot --subdir=ol10-grub
    # → /var/lib/tftpboot/ol10-grub/x86_64-efi/core.efi (boot file)

    grub.cfg (layered sourcing is the key):

    menuentry 'OL10 PXE Install' {
    linux /ol10/vmlinuz ip=dhcp \
    inst.stage2=http://<PXE-server-IP>:8000/iso \
    inst.repo=https://yum.oracle.com/repo/OracleLinux/OL10/baseos/latest/x86_64 \
    inst.ks=http://<PXE-server-IP>:8000/ks.cfg inst.text
    initrd /ol10/initrd.img
    }
    dhcp-host=BC:24:11:3B:53:7C,set:pxe # pin the MAC (serve only the target)
    dhcp-range=192.168.100.50,192.168.100.60,12h # ⚠️ required, or dhcp-host is ignored
    dhcp-option=6,192.168.50.1,223.5.5.5 # ⚠️ required when port=0 — hand out real DNS!
    dhcp-boot=tag:pxe,ol10-grub/x86_64-efi/core.efi
    enable-tftp
    tftp-root=/var/lib/tftpboot
    1. No dhcp-range ⇒ dhcp-host is ignored (stated in the config comments) — symptom: the target gets no OFFER at all;
    2. SELinux blocks TFTP: files copied with cp carry the var_lib_t label and dnsmasq_t is denied (Permission denied) — fix with semanage fcontext -a -t tftpdir_t "/var/lib/tftpboot(/.*)?" && restorecon -R;
    3. The boot-file path is relative to tftp-root — no leading slash;
    4. The port=0 DNS trap: port=0 only turns off dnsmasq’s own DNS service, but the DHCP reply still hands out dnsmasq’s own address as the resolver (option 6 default) — every DNS lookup in the installer fails (dracut retry storm of Could not resolve host, screenshot 33). Set dhcp-option=6,<working upstream> explicitly.

    stage2 and repo: layered sourcing (the easiest 404 to hit)

    Section titled “stage2 and repo: layered sourcing (the easiest 404 to hit)”

    The two supplies of an anaconda network install are independent:

    ParameterContentSizeRecommended source
    inst.stage2installer runtime image (images/install.img)1.17GBboot.iso over local HTTP (mount the ISO, serve the mount point with python3 -m http.server)
    inst.repopackage repository (BaseOS etc.)per package setyum.oracle.com (outbound via NAT) or a full local tree

    The yum.oracle.com repo tree carries packages only, no stage2 — pointing inst.stage2 at the same URL yields a 404 loop (curl: (22), repeated “failed to fetch stage2”). Serving boot.iso over local HTTP is the most reliable stage2 source (screenshot 34: with stage2 in place the anaconda environment boots cleanly).

    The first attempt stalled at “initrd takes over” (screenshots 28/29/30: the chain was fully alive up to the kernel). The follow-up session dissected the stall into four root-cause layers, each fixed to expose the next:

    LayerSymptomRoot causeFix
    ① Memorysilence after initrd takes overtarget defaulted to 512MB; the 228MB initrd needs ~700MB unpacked — OOMgive the target 4G
    ② DNSdracut loops on Could not resolve hostdnsmasq port=0 still hands itself out as DNSdhcp-option=6 to a real upstream
    ③ stage2404 loop (curl(22))yum.oracle.com repo tree has no stage2inst.stage2 from a local boot.iso HTTP mount
    ④ Reinstall loopfinished install reboots into the installer and wipesafter ks reboot, OVMF NVRAM still prefers the NICstop DHCP once ks is fetched; reboot falls through to disk

    Final result (screenshot 35): disk boot reaches Oracle Linux Server 10.2 / ol-pxe login:. SSH evidence: /root/ks-proof.txt (%post timestamp), 455 packages @core, getenforce=Enforcing, /etc/ssh/sshd_config.d/99-pxe-rootpw.conf (written by %post) — the whole kickstart chain took effect.

    • Measured: the full end-to-end chain (DHCP→TFTP→grub→kernel→initrd→stage2→anaconda→%post→reboot→disk boot; screenshots 28/29/30/33/34/35 + dnsmasq journal + ks-proof SSH evidence; E3 record of 15 steps, result=pass); the four dnsmasq pitfalls, layered sourcing, the four-layer troubleshooting map and the break-the-loop rule;
    • Not measured / limits: BIOS (non-UEFI) PXE (EL10 has no syslinux; not exercised); concurrent multi-target installs (per-MAC dhcp-host pinning only); the serial0 socket stayed silent in this environment (diagnostics used QMP screendump instead — no impact on conclusions);
    • Sources: OL10 installation guide: network install, dnsmasq(8), grub2-mknetdir.