CentOS 7
Sponsored Link

KVM : UEFI Boot
2018/02/03
 
Boot Virtual Machines with using UEFI (Unified Extensible Firmware Interface).
[1] Install OVMF (Open Virtual Machine Firmware).
[root@dlp ~]#
vi /etc/yum.repos.d/kraxel.repo
# create new

[qemu-firmware-jenkins]
name=firmware for qemu, built by jenkins, fresh from git repos
baseurl=https://www.kraxel.org/repos/jenkins/
enabled=0
gpgcheck=0
[root@dlp ~]#
yum --enablerepo=qemu-firmware-jenkins -y install OVMF
[root@dlp ~]#
vi /etc/libvirt/qemu.conf
# line 682: add

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

[root@dlp ~]#
systemctl restart libvirtd
[2] Update QEMU.
[root@dlp ~]#
/usr/libexec/qemu-kvm -version

QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-141.el7_4.6), Copyright (c) 2003-2008 Fabrice Bellard
[root@dlp ~]#
yum -y install centos-release-qemu-ev
# disable usually

[root@dlp ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-QEMU-EV.repo
# for this installing, [qemu-kvm] package is replaced to [qemu-kvm-ev] package

[root@dlp ~]#
yum --enablerepo=centos-qemu-ev -y install qemu-kvm-ev
[root@dlp ~]#
systemctl restart libvirtd
[root@dlp ~]#
/usr/libexec/qemu-kvm -version

QEMU emulator version 2.9.0(qemu-kvm-ev-2.9.0-16.el7_4.13.1)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
[3] It's OK all, Create a VM to install Windows Server 2016 as an example.
Specify for [--boot] with [uefi] like follows. For other items, specify anything you like.
[root@dlp ~]#
virt-install \
--name Win2k16 \
--ram 8192 \
--disk path=/var/kvm/images/Win2k16.img,size=80 \
--vcpus=4 \
--os-type windows \
--os-variant=win10 \
--network bridge=br0 \
--graphics spice,listen=0.0.0.0,password=password,keymap=ja \
--video qxl \
--cdrom /tmp/Win2016_JA-JP.ISO \
--boot uefi
[4] After booting, UEFI Interactive Shell is shown. Input [exit] to exit this screen.
[5] This is the UEFI settings. Select [Continue] to exit here if you don't have changes. After exiting, Installer starts.
[6] After finishing installation, make sure on System info tha the [BIOS mode] is just the [UEFI].
Matched Content
 
Tweet