public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, pavankumar_a@accelerite.com,
	"Tomas Pilar (tpilar)" <tpilar@solarflare.com>
Subject: Re: [edk2-devel] Help needed in building UEFI qcow2 images
Date: Tue, 4 Jun 2019 12:49:38 +0200	[thread overview]
Message-ID: <88960f45-42c4-3420-e33a-880a55960e48@redhat.com> (raw)
In-Reply-To: <13789.1559589696810523451@groups.io>

Pavan,

On 06/03/19 21:21, Pavan Kumar Aravapalli wrote:

> * We have CentOS flavoured qcow2 image which is used to boot Guest
>   VM's in Apache CloudStack. We are trying to enable these CentOS
>   qcow2 images with UEFI support.

I told you weeks ago to take this question to the CentOS mailing list.

https://edk2.groups.io/g/devel/message/40531

Have you done that?

Also, what prevents you from installing a CentOS guest in UEFI mode from
scratch, and using the resultant disk image as a template?

Anyway, I guess I'm going to send them a separate message, and CC you.


> * I have been struggling to secure boot Guest VM using UEFI.  I have
>   enclosed my secure boot domain dumpxml [secure-vm.xml]with this mail
>   too. When i try to boot with this xml i am  ended up with an
>   Exception. I have attached the error screen shot too .

You are using Gerd's "OVMF_CODE-pure-efi.fd" firmware binary. That
binary is not built with -D SECURE_BOOT_ENABLE. Therefore the Secure
Boot related standard UEFI variables are not available (the Secure Boot
feature is missing altogether). That's the reason EnrollDefaultKeys.efi
fails to find the SetupMode variable.


You've mentioned that your host environment is CentOS 7.6. Here's what
you should do:

- Install the latest OVMF package available in that CentOS release. (I
  think it should be
  "OVMF-20180508-3.gitee3198e672e2.el7_6.1.noarch.rpm" at the moment.)

- You already have "qemu-kvm-ev" installed, good.

- If your libvirt domain currently has a variable store file under
  "/var/lib/libvirt/qemu/nvram/", then delete that file (the domain
  should be powered off first).

- Edit your domain XML as follows (only relevant elements quoted):

  <domain type='kvm'>
    <os>
      <type arch='x86_64' machine='pc-q35-rhel7.6.0'>hvm</type>
      <loader readonly='yes' secure='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
      <nvram template='/usr/share/OVMF/OVMF_VARS.secboot.fd'/>
    </os>
    <features>
      <smm state='on'/>
    </features>
    <devices>
      <emulator>/usr/libexec/qemu-kvm</emulator>
    </devices>
  </domain>

- When you next launch this domain, the domain's private varstore file
  (under "/var/lib/libvirt/qemu/nvram/") will be re-created from the
  template specified ("/usr/share/OVMF/OVMF_VARS.secboot.fd"). The
  Secure Boot operational mode will be enabled at once, and you will not
  have to run EnrollDefaultKeys.efi manually.

Hope this helps,
Laszlo

  reply	other threads:[~2019-06-04 10:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 11:02 Help needed in building UEFI qcow2 images Pavan Kumar Aravapalli
2019-05-22 11:19 ` Tomas Pilar (tpilar)
2019-05-22 15:58   ` [edk2-devel] " Andrew Fish
2019-05-22 16:57     ` Tomas Pilar (tpilar)
2019-05-22 17:05       ` Andrew Fish
2019-05-22 19:05     ` Laszlo Ersek
2019-05-22 19:10       ` Andrew Fish
2019-05-23 13:45         ` Laszlo Ersek
2019-06-03 19:21   ` Pavan Kumar Aravapalli
2019-06-04 10:49     ` Laszlo Ersek [this message]
2019-06-04 11:28       ` Pavan Kumar Aravapalli
2019-06-04 16:10         ` Laszlo Ersek
2019-06-05  5:49           ` Gerd Hoffmann
2019-06-07  9:13             ` Pavan Kumar Aravapalli
2019-06-05 18:19           ` Pavan Kumar Aravapalli
2019-06-06  7:43             ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88960f45-42c4-3420-e33a-880a55960e48@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox