🐧

Rocky Linux 9 on KVM

に公開

RHEL ベースの Rocky Linux cloud image を KVM / libvirtd で動作させるためのメモ。

現象1

  • virsh console testhost で何も流れない
  • VNC で画面をとると「Probing EDD (edd=off to disable) ... ok」と表示されて止まっている

表示されているところによると、10 分停止するらしい。対処法はSecure boot にすればよい。

現象2

起動し始めてしばらくすると kernel panic で停止する。

CPU が x86-64-v2 以上でないといけないらしい。https://zenn.dev/myuna/scraps/91eab3e039a63d

特にこだわりが無ければ host system の CPU モデルを見せておけばよいだろう。

まとめ

上のオプションをまとめると、次のような感じになる。

欲しいオプション類は LLM に書き換えさせると手早くいけるだろう。

<domain type='kvm'>
  <name>test</name>
  <memory unit='MiB'>2048</memory>
  <vcpu placement='static'>2</vcpu>
  <cpu mode="host-passthrough"/>
  <os firmware='efi'>
    <type>hvm</type>
    <feature enabled='yes' name="secure-boot"/>
    <feature enabled="yes" name="enrolled-keys"/>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test.qcow2'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/seed.img'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='bridge'>
      <source bridge='virbr0'/>
      <model type='virtio'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <graphics type='vnc' port='-1' autoport='yes'/>
  </devices>
</domain>

Discussion