KVM创建支持UEFI启动的虚拟机

环境:rhel7.5

一.配置firmware源

wget http://www.kraxel.org/repos/firmware.repo -O /etc/yum.repos.d/firmware.repo

二.安装ovmf

yum install edk2.git-ovmf-x64
yum install OVMF #uefi的virt-manger图形组件
三.配置 libvirtd以启用UEFI

Configure libvirtd to advertise UEFI support

Libvirt needs to know about UEFI->NVRAM config file mapping, so it can advertise it to tools like virt-manager/virt-install.

As root, edit /etc/libvirt/qemu.conf, and add this section at the top of the file:

nvram = [

"/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd",

]

四.重启libvirtd

systemctl restart libvirtd

五.创建虚拟机

virt-manager
KVM创建支持UEFI启动的虚拟机

这样就可以选择的固件是uefi
注意,如果视频模式为vmvga或QXL会导致启动时黑屏,换成vga模式就可以了

上一篇:部署kvm


下一篇:家里还有最老一版本centos搭建的openstack,vm一直是error