KVM

KVMを使って、仮想マシンをブートする。

KVM, QEMU, libvirtのインストール

as root

dnf -y install qemu-kvm libvirt virt-install libvirt-devel
systemctl enable --now libvirtd
# virt manager
dnf -y install virt-manager

仮想マシンのインストール

as root

# as root
virt-install \
--name guest1-rhel9 \
--memory 2048 \
--vcpus 2 \
--network default \
--disk size=20 \
--location /tmp/AlmaLinux-9.4-x86_64-minimal.iso \
--os-variant rhel9.4 \
--graphics none \
--extra-args "console=tty0 console=ttyS0,115200n8"
virsh console guest1-rhel9

仮想マシンのリスト

virsh list --all

仮想マシンのシャットダウン

virsh shutdown guest1-rhel9

仮想マシンの強制終了

virsh destroy guest1-rhel9

仮想マシンの削除

virsh undefine guest1-rhel9 --remove-all-storage

仮想マシンの電源オン

virsh start guest1-rhel9
Reference
|