我无法在 KVM 上自动安装 Rocky9 Linux。我使用 Kickstart 来自动安装。如果我登录 VM 控制台,安装屏幕就会显示,而不是自动安装。
这是 Kickstart 脚本:
# Generated by Anaconda 34.25.4.9
# Generated by pykickstart v3.32
#version=RHEL9
# Use text mode install
text
repo --name="minimal" --baseurl=file:///run/install/sources/mount-0000-cdrom/minimal
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
# System language
lang en_US.UTF-8
# Use CDROM installation media
cdrom
%packages
@^minimal-environment
%end
# Run the Setup Agent on first boot
firstboot --enable
# Do not configure the X Window System
skipx
# Generated using Blivet version 3.6.0
ignoredisk --only-use=vda
# System bootloader configuration
bootloader --append="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M" --location=mbr --boot-drive=vda
autopart
# Partition clearing information
clearpart --all --initlabel --drives=vda
# System timezone
timezone America/New_York --utc
# Root password
rootpw 1234567890
这是我创建虚拟机的方式:
$ sudo virt-install \
--virt-type kvm \
--name kvm6 \
--ram 2048 \
--vcpus 2 \
--disk size=20 \
--os-variant rocky9 \
--network network=bridged-network \
--graphics none \
--location /tmp/Rocky-9.4-x86_64-minimal.iso \
--check all=off \
--initrd-inject inst.ks \
--extra-args="ks=file:/inst.ks console=tty0 console=ttyS0,115200" \
--noautoconsole
Starting install...
Retrieving 'vmlinuz' | 13 MB 00:00:00
Retrieving 'initrd.img' | 102 MB 00:00:00
Allocating 'kvm6.qcow2' | 20 GB 00:00:00
WARNING Overriding memory to 3072 MiB needed for rocky9 network install.
Creating domain... | 00:00:00
Domain is still running. Installation may be in progress.
You can reconnect to the console to complete the installation process.
$
如果我登录控制台,我会看到默认安装屏幕,以及顶部的以下内容:
Starting installer, one moment...
15:04:13 Kernel boot argument 'ks' detected. Did you want to use 'inst.ks' for the installer instead?
15:04:13 All Anaconda kernel boot arguments are now required to use 'inst.' prefix!
15:04:13
############## Installer errors encountered during boot ##############
'ks' is deprecated and has been removed.
All usage of Anaconda boot arguments without 'inst.' prefix was removed. Please use inst.ks instead.