Anolis OS kickstart unattended install: the OEMDRV fully-automated run and its pit chain
Scope of verification
Section titled “Scope of verification”The OEMDRV fully-automated install is the successful chain from three rounds of PVE debugging on 2026-11-06 (the ks file ships in the repo as scripts/lab/kickstarts/an23-server.ks); on 2026-11-14 the same mechanism ran again as an en_US OEMDRV rerun on VM 430 (anolis23-p2-ks-en-20261114/run.json — pit 6 comes from that round); the inst.ks network-injection variant was not tested (same principle, parameters below).
1. The ks file (verified against Anolis 23.5)
Section titled “1. The ks file (verified against Anolis 23.5)”#version=DEVELgraphical # keep the GUI during install (text also works)lang zh_CN.UTF-8keyboard ustimezone Asia/Shanghai --utcrootpw --plaintext 'your-password' # see pit ④: fall back to %post chpasswduser --name=labuser --groups=wheel --plaintext --password='your-password'sshkey --username=labuser "ssh-ed25519 AAAA...your-public-key"services --enabled=sshdselinux --permissive # the distro's install default is permissive (measured)firewall --enabled --service=sshurl --url=https://mirrors.openanolis.cn/anolis/23/os/x86_64/os/ # pit ②: double-layer pathnetwork --bootproto=static --ip=192.168.2.239 --netmask=255.255.255.0 \ --gateway=192.168.2.2 --nameserver=223.5.5.5 --device=link --activate \ --hostname=anolis-ks # pit ⑤: device=linkbootloader --timeout=5clearpart --all --initlabelautopart --type=lvmreboot --eject # pit ③: on VMs switch boot to disk manually after reboot
%packages@core%end
%postecho 'root:your-password' | chpasswd # pit ④ fallbackmkdir -p /etc/ssh/sshd_config.dprintf 'PermitRootLogin yes\nPasswordAuthentication yes\n' > /etc/ssh/sshd_config.d/60-lab.confsed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/;s/^PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config || trueecho 'labuser ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/90-labuserchmod 440 /etc/sudoers.d/90-labuser%end
2. OEMDRV injection (no kernel args needed)
Section titled “2. OEMDRV injection (no kernel args needed)”Pack ks.cfg into an ISO with the volume label OEMDRV and Anaconda finds it automatically (no inst.ks= required):
mkdir -p ksdrv && cp an23-server.ks ksdrv/ks.cfggenisoimage -quiet -V OEMDRV -o oemdrv-an23.iso -rJ ksdrv# PVE: mount it as a second CD-ROM (ide3); boot.iso stays on ide2The other injection method is the GRUB kernel argument inst.ks=<url or device path> — suited to PXE; not tested on this page.
After the url fix the full run completed unattended (no manual steps, screenshots):

3. The visual way to confirm the ks took effect
Section titled “3. The visual way to confirm the ks took effect”On the installation summary screen, entries covered by the ks render grey-locked (Root “set”, user “labuser will be created”); only entries missing a command turn interactive (pit ①). When everything is covered, clicking Begin Installation runs the whole install hands-free.
4. Post-install verification (a closed loop)
Section titled “4. Post-install verification (a closed loop)”ssh labuser@<ip> hostname # anolis-ks (ks --hostname took effect)ssh labuser@<ip> cat /etc/pve-lab/scenario # the %post markerssh labuser@<ip> getenforce # PermissiveThis site runs a 12-step first-hour journey as install acceptance (archived in run.json) — write your acceptance checks in the same reproducible shape.
Pit quick table
Section titled “Pit quick table”| # | Symptom | Cause | Fix |
|---|---|---|---|
| 1 | Summary screen “Installation Source” red | The ks has no install-source command | Add url --url=… |
| 2 | The url is right yet 404s | The 23-line repo is a double-layer path | Use anolis/23/os/<arch>/os/ |
| 3 | After install the machine boots into the installer again | PVE does not eject + CD-ROM-first boot | Detach the CD-ROM / boot from disk |
| 4 | Root password does not log in | rootpw measured not applied | %post chpasswd fallback |
| 5 | network never activates | Wrong device-name guess | --device=link |