Skip to content
Search openEuler

    Browse this documentation

    openEuler 24.03 Kickstart unattended installation — OEMDRV auto-pickup, a minimal ks template and three real pitfalls (three install rounds recorded on a VM)

    Evidence on this page is from the bare-metal track (E3) — three rounds of bare-metal-style installs of openEuler 24.03 LTS SP4 on PVE (2026-11-04; full environment and troubleshooting record: evidence/logs/openeuler-lab-setup.log; screenshot index in evidence/screenshots/euler-install-*.png and euler-firstboot.png): OEMDRV auto-pickup, the full Anaconda 36.16.5-55 installation run, %post execution, first boot and SSH takeover. The install medium is the official DVD ISO (its SHA256 matched the official sha256sum character for character; the measurement is recorded in the same log).

    The ks template on this page is the cleaned-up version of the main template from the three install rounds (v1–v3); the ks variants for RAID/custom partitioning are covered in a separate volume.

    The overall path: the OEMDRV label gets the ks picked up automatically

    Section titled “The overall path: the OEMDRV label gets the ks picked up automatically”

    The standard approach is to put the ks in the boot parameters (inst.ks=http://…), but that means typing it out at the GRUB menu — not unattended. Anaconda inherits this behavior from upstream: at startup it scans block devices labeled OEMDRV and automatically picks up the ks.cfg in the root directory. Use that for a fully unattended install:

    Terminal window
    # 1) Prepare ks.cfg (this page's template is in the next section)
    # 2) Build a small ISO labeled OEMDRV (genisoimage is available on PVE/any Linux)
    genisoimage -output oemdrv-euler24.iso -volid OEMDRV -joliet -rock /tmp/euler-ks/
    # 3) On PVE: attach the install ISO to the DVD drive + the oemdrv ISO to a second drive, boot order CD first
    # 4) Power on → automatic partitioning and formatting → finish per the ks's poweroff/reboot action

    In testing, Anaconda (36.16.5-55.oe2403sp4 — the version is visible on the installer’s text screen) correctly picked up the ks.cfg from OEMDRV in all three install rounds — /run/install/ks.cfg is verifiable in TTY2 (a check used during troubleshooting; see pitfall 3).

    The minimal ks template (every line from testing)

    Section titled “The minimal ks template (every line from testing)”
    lang en_US.UTF-8
    keyboard us
    timezone Asia/Shanghai --utc
    rootpw --iscrypted $6$… # generated with openssl passwd -6
    bootloader --timeout=1
    clearpart --all --initlabel
    autopart --type=plain # simplest partitioning; custom partitioning is in the RAID volume
    network --bootproto=static --device=link --activate --ip=192.168.2.240 \
    --netmask=255.255.255.0 --noipv6 --hostname euler24-lab
    firstboot --disable
    cdrom # use the physical/virtual DVD as the install source
    poweroff # pitfall 2: don't use reboot (see below)
    %packages
    @core
    openssh-clients
    tar
    %end
    %post --erroronfail
    mkdir -p /root/.ssh
    echo 'ssh-rsa AAAA… root@pve' > /root/.ssh/authorized_keys
    chmod 700 /root/.ssh && chmod 600 /root/.ssh/authorized_keys
    chcon -t ssh_home_t /root/.ssh/authorized_keys # pitfall 3: SELinux context
    cat > /etc/yum.repos.d/euler-dvd.repo <<'REPO' # prepare a local repo ahead of time for offline environments
    [dvd-os]
    name=openEuler 24.03 LTS SP4 - DVD local mirror
    baseurl=http://192.168.2.2:8888/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-openEuler
    REPO
    %end

    Default behaviors worth noting (measured): network --device=link takes the first NIC with a link (ens18 under PVE virtio), so no interface name guessing is needed; --iscrypted keeps the rootpw out of the ks in plaintext; --erroronfail makes a %post failure terminate the install outright instead of producing a broken machine.

    Pitfall 1: the QEMU default CPU model → installer kernel panic (init exit 127)

    Section titled “Pitfall 1: the QEMU default CPU model → installer kernel panic (init exit 127)”

    The first install round kernel-panicked outright under PVE’s default CPU model:

    Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00

    0x7f00 = init exiting with 127, occurring in the initramfs phase. The AlmaLinux/CentOS lab VMs on the same host all ran cpu: host — after changing the VM’s CPU type to host, the install ran normally. Conclusion: openEuler 24.03’s installation kernel/userspace has higher CPU feature requirements than PVE’s default model; when you see an init panic installing openEuler on PVE/Proxmox, check the CPU model first. This was the most hidden link in this experiment’s troubleshooting chain (screenshot euler-install-02.png).

    Kernel panic (Attempted to kill init! exitcode=0x00007f00) on the installer TTY under PVE's default CPU model

    Pitfall 2: the ks reboot collides with DVD-first boot → infinite reinstall

    Section titled “Pitfall 2: the ks reboot collides with DVD-first boot → infinite reinstall”

    With the SeaBIOS boot order set to CD first, the reboot at the end of the ks does not mean “reboot into the new system”: after the installer reboots, the BIOS boots from the DVD again → the OEMDRV ks gets picked up again → the whole machine reinstalls from scratch (this actually happened in testing; the screenshot euler-firstboot.png records the second install round’s progress screen). Two fixes:

    The second install round's progress screen after the ks reboot hit the DVD-first boot order (INSTALLATION PROGRESS)

    1. End the ks with poweroff (the choice in this experiment): the machine powers off automatically after the install, then you change the boot order to disk-first and power back on — zero race conditions, suitable for scripted bulk installs;
    2. Or keep reboot but have the install platform guarantee “after reboot, land on disk” (e.g. with --eject and a virtual drive that actually ejects, or with the boot order taken over by the install system).

    Pitfall 3: the authorized_keys written by %post is rejected by SELinux

    Section titled “Pitfall 3: the authorized_keys written by %post is rejected by SELinux”

    After the first install round, SSH public-key login kept being rejected (Permission denied (publickey)), while console checks confirmed: the file is there (734 bytes), its fingerprint matches the client’s private key exactly (compared with ssh-keygen -lf), and sshd_config does not disable root public keys. The real trap is SELinux:

    $ matchpathcon /root/.ssh/authorized_keys
    /root/.ssh/authorized_keys system_u:object_r:ssh_home_t:s0
    $ ls -Z /root/.ssh/authorized_keys # actual label after writing directly in %post
    system_u:object_r:root_home_t:s0 # ← not ssh_home_t

    A file created by a direct echo > file in the %post phase does not automatically get the correct context, so sshd (a confined domain) can’t read it → the public key silently fails. The fix is one line: chcon -t ssh_home_t /root/.ssh/authorized_keys (or restorecon; note that in testing restorecon relabeled it to home_root_t on this machine, which is still wrong — trust the matchpathcon output). The v4 template now includes chcon, and SSH has worked out of the box on installs since. Full console screenshots in euler-console-1..6.png.

    First boot console: reaching Multi-User System, root login and system info (6.6.0-159.4.3.154.oe2403sp4)

    Troubleshooting console: the restorecon repair attempt and the sshd journal check

    Troubleshooting console: matchpathcon's expected label vs the ssh-keygen public-key fingerprint

    Troubleshooting console: /var/log/secure after the chcon -t ssh_home_t fix

    Troubleshooting console: the sshd -ddd debug instance (port 2222 already bound by the main sshd)

    Troubleshooting console: the /run/sshd fix, sshd restart and the /var/log/secure recheck

    • The UEFI (OVMF) + ks combination was not tested separately: all three install rounds on this page used SeaBIOS; the UEFI boot experiment is in the Secure Boot volume;
    • The PXE network source + ks combination is tested separately in the PXE volume (this page uses a local DVD source);
    • reboot --eject behavior not tested (the poweroff route was chosen);
    • Embedding a ks inside a custom ISO with oemaker was not tested (see the not-tested statement in the oemaker volume).