[edk2-devel] OVMF_CODE/VARS unable to reboot a mac os vm during installation (only first stage)

Daniele Crudo crudo.daniele at gmail.com
Sat Sep 25 08:57:24 UTC 2021


Hi, forwarding this also to the mailing list:

https://bugzilla.tianocore.org/show_bug.cgi?id=3640

---->

Hello,
it's been about a year I'm experiencing a strange issue, not a
stopper, so I started only recently to investigate.
I found that it's OVMF.

System: x86_64 manjaro 21.1.3 (only cli), qemu 6.1.0, libvirt 7.7.0

Issue:

after an ota delta update from within the virtual machine (mac os big
sur and monterey were tested), from system preferences, or after the
installation from a mac os installer disc, the virtual machine doesn't
automatically reboot, ONLY after the first stage.
Installation and updates in mac os have several stages, unfortunately
I don't know in details what's going on during each stage.

This is what happens (OTA delta update in the guest):

system preferences (in the vm) --> software updates: start to download
the ota delta update,
download finishes, mac os prepares installation, then asks to reboot.
Mac os seems to start the reboot, signal to gpu (passed through) is
lost, but it never starts again: virsh is reporting that the virtual
machine is running.
After 30+ minutes I need to force the shutdown of the virtual machine
(virsh reboot/virsh shutdown have no effect, only virsh destroy is
able to force the shutdown) and manually start the vm again.
After this force shutdown/manual start, the installation completes
without issues, mac os is rebooted automatically and automatically
completes all the other installation stages.

After an installation from a mac os installer disc (empty virtual hd,
or empty passed through sata controller+ssd):

Installation starts with a gui, after some minutes (less than 10 min)
it reboots. then after some time (about 20 minutes) it tries to
restart.
Mac os seems to start the reboot, signal to gpu (passed through) is
lost, but it never starts again: virsh is reporting that the virtual
machine is running.
After 30+ minutes I need to force the shutdown of the virtual machine
(virsh reboot nor virsh shutdown have no effect, only virsh destroy is
able to force the shutdown) and manually start again.
After this force shutdown/manual start, the installation completes
without issues, mac os is reboot automatically and automatically
completes all the other stages.

Side note:
reboot/shutdown work without issue in other cases, it's only after the
first stage of a mac os installation.
Note that I tested also a very basic mac os vm, without any passthrough.

What I did:
tested different versions of qemu, from 5.1.0 to 6.1.0.
tested different versions of libvirt, from 6.5.0 to 7.7.0.
tested different versions of OVMF.

OVMF is the culprit.
I tested only release versions, compiled by me in kali linux, GCC5.
After compilation I use OVMF_CODE.fd and OVMF_VARS.fd for my virtual machine:

OVMF version 202011 (stable): it works, reboots mac os after first
stage, no issue.
OVMF version 202102 (stable): it doesn't work as expected, doesn't
reboot mac os after first stage, as explained.
OVMF version 202105 (stable): it doesn't work as expected, doesn't
reboot mac os after first stage, as explained.
OVMF version 202108 (stable): it doesn't work as expected, doesn't
reboot mac os after first stage, as explained.

The latest working OVMF version is 202011 stable, it seems something
broke it between 202011 and 202102 stable.
Strange thing, as I said, is that it doesn't reboot only after this
first installation stage (it's not random, it's always), everything
seems normal when the vm is rebooted from the installed os.
I don't know if it matters, but last lines in the vm bootloader,
before the forced shutdown after the first installation stage,
complain about system being shutdown and applesmc (which is emulated).

I'm available to perform more tests if guided, please take into
account that 1 test lasts about 45-50 minutes, because every time I
need to install the os from scratch to reach the end of the 1st stage
of installation.

Thank you for your attention.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#81118): https://edk2.groups.io/g/devel/message/81118
Mute This Topic: https://groups.io/mt/85857199/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20210925/f64a9c8d/attachment.htm>


More information about the edk2-devel-archive mailing list