User Tools

Site Tools


Sidebar

software:virtualization:kvm-uefi

What?

My notes on using uefi on KVM.

setup on Fedora 23

dnf install dnf-plugins-core
dnf config-manager --add-repo http://www.kraxel.org/repos/firmware.repo
dnf install edk2.git-ovmf-x64
# kraxel++

running a UEFI-KVM guest

virt-install ... -boot uefi ...
i.e.
virt-install -n $HOSTNAME -r 1024 --vcpus 2 --cpu host \
  --disk path=/img/tvm.qcow2,format=qcow2,bus=virtio,cache=unsafe \
  --location http://192.168.4.1/repos/$DISTRO \
  --graphics none --virt-type kvm --os-type linux \
  --boot uefi,menu=on,useserial=on \
  --console pty --os-variant rhel7 \
  --network bridge=virbr0,model=virtio \
  --extra-args "console=tty0 console=ttyS0,115200n8 net.ifnames=0"

efibootmgr on Linux, from the guest

[root@rhel7u2a ~]# efibootmgr 
BootCurrent: 000A
Timeout: 0 seconds
BootOrder: 000A,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
Boot0000* EFI Floppy
Boot0001* EFI Floppy 1
Boot0002* EFI Network 1
Boot0003* EFI Misc Device
Boot0004* EFI Network
Boot0005* EFI Network 4
Boot0006* EFI Network 2
Boot0007* EFI Network 3
Boot0008* Red Hat Enterprise Linux
Boot0009* EFI Network 5
Boot000A* EFI Internal Shell
Boot000B* EFI Floppy
Boot000C* EFI Floppy 1
Boot000D* EFI Misc Device
Boot000E* EFI Network
Boot000F* EFI Network 1
Boot0010* EFI Network 2
Boot0011* EFI Network 3
Boot0012* EFI Network 4
Boot0013* EFI Network 5
[root@rhel7u2a ~]# efibootmgr -b f -B  # removing entry "f"
BootCurrent: 000A
Timeout: 0 seconds
BootOrder: 000A,0008,000B,000C,000D,000E,0010,0011,0012,0013
Boot0000* EFI Floppy
[..]
Boot000E* EFI Network
Boot0010* EFI Network 2
[root@rhel7u2a ~]# efibootmgr -n a  # configuring shell
BootNext: 000A
BootCurrent: 000A
[root@rhel7u2a ~]# reboot

efi shell commands

UEFI Interactive Shell v2.1
EDK II
UEFI v2.60 (EDK II, 0x00010000)
Mapping table
      FS0: Alias(s):HD1b:;BLK3:
          PciRoot(0x0)/Pci(0x7,0x0)/HD(1,GPT,7E05BAFB-BFCD-432E-9E75-FD29C8D8F95D,0x800,0x64000)
     BLK0: Alias(s):
          PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0)
     BLK1: Alias(s):
          PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1)
     BLK2: Alias(s):
          PciRoot(0x0)/Pci(0x7,0x0)
     BLK4: Alias(s):
          PciRoot(0x0)/Pci(0x7,0x0)/HD(2,GPT,E70DB185-B12D-4730-9703-3E8E36986D0D,0x64800,0xFA000)
     BLK5: Alias(s):
          PciRoot(0x0)/Pci(0x7,0x0)/HD(3,GPT,224CCEFA-DE71-4088-B790-1E067315D096,0x15E800,0x46A1000)



Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
Shell>fs0:
FS0:\> ls
Directory of: FS0:\
04/21/2016  02:40 <DIR>         4,096  EFI
          0 File(s)           0 bytes
          1 Dir(s)
FS0:\> cd EFI\redhat
FS0:\EFI\redhat\> ls
Directory of: FS0:\EFI\redhat\
04/21/2016  02:40 <DIR>         4,096  .
04/21/2016  02:40 <DIR>         4,096  ..
04/21/2016  02:40 <DIR>         4,096  fonts
04/21/2016  02:41               1,024  grubenv
10/12/2015  16:57           1,008,080  gcdx64.efi
10/12/2015  16:57           1,008,080  grubx64.efi
07/20/2015  14:48                 176  BOOT.CSV
07/20/2015  14:48           1,282,496  MokManager.efi
07/20/2015  14:48           1,289,544  shim-redhat.efi
07/20/2015  14:48           1,295,704  shim.efi
04/21/2016  02:41               4,220  grub.cfg
          8 File(s)   5,889,324 bytes
          3 Dir(s)
FS0:\EFI\redhat\> grubx64.efi
software/virtualization/kvm-uefi.txt ยท Last modified: 2021/03/23 12:22 (external edit)