openEuler 24.03 Kickstart unattended installation — OEMDRV auto-pickup, a minimal ks template and three real pitfalls (three install rounds recorded on a VM)
Verification scope
Section titled “Verification scope”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:
# 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 actionIn 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-8keyboard ustimezone Asia/Shanghai --utcrootpw --iscrypted $6$… # generated with openssl passwd -6bootloader --timeout=1clearpart --all --initlabelautopart --type=plain # simplest partitioning; custom partitioning is in the RAID volumenetwork --bootproto=static --device=link --activate --ip=192.168.2.240 \ --netmask=255.255.255.0 --noipv6 --hostname euler24-labfirstboot --disablecdrom # use the physical/virtual DVD as the install sourcepoweroff # pitfall 2: don't use reboot (see below)
%packages@coreopenssh-clientstar%end
%post --erroronfailmkdir -p /root/.sshecho 'ssh-rsa AAAA… root@pve' > /root/.ssh/authorized_keyschmod 700 /root/.ssh && chmod 600 /root/.ssh/authorized_keyschcon -t ssh_home_t /root/.ssh/authorized_keys # pitfall 3: SELinux contextcat > /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 mirrorbaseurl=http://192.168.2.2:8888/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-openEulerREPO%endDefault 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=0x00007f000x7f00 = 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).

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:

- 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; - Or keep
rebootbut have the install platform guarantee “after reboot, land on disk” (e.g. with--ejectand 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 %postsystem_u:object_r:root_home_t:s0 # ← not ssh_home_tA 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.






Unverified
Section titled “Unverified”- 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 --ejectbehavior 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).