FS#55496 - [edk2-ovmf] Windows 10 guests do not boot on OVMF

Attached to Project: Arch Linux
Opened by Victor Bessonov (Unb0rn) - Monday, 04 September 2017, 07:57 GMT
Last edited by David Runge (dvzrv) - Friday, 12 June 2020, 12:46 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Thomas Bächler (brain0)
David Runge (dvzrv)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
After updating to testing qemu-2.10.0-1 windows guests on OVMF are failing to boot on two separate machines.
Problem reproduces even with Windows 10 ISO, as it gets detected, starts to boot(gives "press any button to load from CD" message) and hangs on TianoCore splash after that.
Updating OVMF to ovmf-git from aur solves this issue, so it's either OVMF or qemu 2.10 bug.

Additional info:
* package version:2.10.0-1

Steps to reproduce:
-Install qemu or qemu-headless 2.10.0-1 from testing repo
-Install ovmf with pacman
-Create VM with OVMF
-Try to boot either installed Windows 10 or Windows 10 ISO
This task depends upon

Closed by  David Runge (dvzrv)
Friday, 12 June 2020, 12:46 GMT
Reason for closing:  No response
Comment by Anatol Pomozov (anatolik) - Thursday, 07 September 2017, 16:46 GMT
Here is a similar upstream bug https://bugs.launchpad.net/qemu/+bug/1714331

It says bumping OVMF to the latest version helps to fix the problem. Adding Thomas Bächler to bump OVMF package.
Comment by George Amanakis (gamanakis) - Friday, 08 September 2017, 00:05 GMT
Upgrading ovmf to latest git resolves this.
Comment by Anatol Pomozov (anatolik) - Friday, 08 September 2017, 00:06 GMT
Thanks for confirming it. I reassign this ticket to Thomas.
Comment by George Amanakis (gamanakis) - Friday, 08 September 2017, 02:29 GMT
Upgrading to tag=vUDK2017 (https://github.com/tianocore/edk2/releases/tag/vUDK2017) resolves this, too.
Comment by Alexander (mastersplinter777) - Sunday, 10 September 2017, 10:35 GMT
I've installed Qemu 2.10.0 + ovmf-git and have the same bug.
My Qemu Win7 UEFI config:
--------------------
QEMU_AUDIO_DRV=pa
QEMU_PA_SAMPLES=8192
QEMU_AUDIO_TIMER_PERIOD=99
QEMU_PA_SERVER=/run/user/1000/pulse/native
VMDIR=$(basename $(pwd))
DIF=12
PORT=59$DIF
NAME=$VMDIR
BUS=pcie.0
PASS=123
SPORT=56$DIF
VNCPORT=57$DIF
DISPLAY=:0

qemu-system-x86_64 \
-daemonize \
-uuid fafafafa-1234-bcbc-5678-11112222ff$DIF \
-name $NAME,process=QEMU-"$NAME" \
-parallel none \
-net none \
-nodefconfig \
-nodefaults \
-monitor telnet:127.0.0.1:370$DIF,server,nowait \
-serial telnet:127.0.0.1:371$DIF,server,nowait \
-rtc base=localtime \
-machine type=q35,accel=kvm \
-drive if=pflash,format=raw,unit=0,file=$(pwd)/ovmf_x64.bin \
-smp 2,sockets=1,cores=2,threads=1 \
-cpu Penryn,kvm=off,check,vendor=GenuineIntel,+vmx \
-m 4G \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=$BUS,addr=0x1b.0x0 \
-global qxl-vga.revision=4 \
-spice port=$PORT,disable-ticketing,seamless-migration=on,password=$PASS \
-device ich9-intel-hda,bus=$BUS,addr=0x11.0x0,id=sound0 \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-device e1000-82545em,netdev=br0,mac=XX:XX:XX:XX:XX:$DIF,id=vnet0,bus=$BUS,addr=0x6.0x0,romfile= \
-netdev bridge,id=br0 \
-device ich9-usb-ehci1,id=ehci1,bus=$BUS,addr=0x12.0x7 \
-device ich9-usb-uhci1,id=uhci1,masterbus=ehci1.0,firstport=0,bus=$BUS,multifunction=on,addr=0x12.0x0 \
-device ich9-usb-uhci2,id=uhci2,masterbus=ehci1.0,firstport=2,bus=$BUS,addr=0x12.0x1 \
-device ich9-usb-uhci3,id=uhci3,masterbus=ehci1.0,firstport=4,bus=$BUS,addr=0x12.0x2 \
-device usb-tablet,id=tablet0,bus=ehci1.0 \
-device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \
-drive file="$(pwd)"/$NAME.qcow2,if=none,media=disk,id=drive-sata0-0-0,format=qcow2 \
-device ide-drive,bus=ide.1,drive=drive-sata0-0-1,id=sata0-0-1 \
-drive file=/dev/sr0,if=none,media=cdrom,readonly=on,id=drive-sata0-0-1,format=raw
-----------
Comment by Alexander (mastersplinter777) - Sunday, 10 September 2017, 11:51 GMT
Building OVMF manually from git didn't solve the problem.
Comment by George Amanakis (gamanakis) - Tuesday, 12 September 2017, 16:57 GMT
@Alexander, could you try building with the attached PKGBUILD? (this is what I am currently using on a Win10-VM)
   PKGBUILD (5.4 KiB)
Comment by Thomas Bächler (brain0) - Wednesday, 13 September 2017, 14:32 GMT
Sorry for the delays with OVMF, I'll prepare an update this week.
Comment by Marcos Alves Pintar (mapintar) - Friday, 15 September 2017, 21:50 GMT
Same problem here.

Build from AUR ovmf-git fail.

This work: https://www.kraxel.org/repos/jenkins/edk2/
Comment by Alexander (mastersplinter777) - Saturday, 16 September 2017, 09:09 GMT
Just tested with https://www.kraxel.org/repos/jenkins/edk2/
2.10.0 - not work with Win7, macOS, Win10 (tested with a package from repo and also built qemu myself)
2.9.0 - works just fine
Comment by Thomas Bächler (brain0) - Sunday, 17 September 2017, 13:47 GMT
Updated package is in [testing]. I was unable to test it myself, will do so tomorrow.

* I disabled the ia32 build, since the build is broken
* The images now have their upstream file names: /usr/share/ovmf/x64/OVMF_{CODE,VARS}.fd

I will move this to [extra] as soon as I can test it.
Comment by Alexander (mastersplinter777) - Monday, 18 September 2017, 06:19 GMT
Tested OVMF package from testing. It still hangs with 100% cpu load, however now it gets further: I can see Windows 7 animated logo.
Comment by Manawyrm (Manawyrm) - Tuesday, 19 September 2017, 13:37 GMT
Can confirm, after system upgrade Win10 didn't boot anymore.
newer EDK2/TianoCore fixed the problem.
Comment by Adam (adam900710) - Wednesday, 11 October 2017, 07:16 GMT
Extra similar bug report related to this is, Archlinux guest failed to do ACPI shutdown/reboot.

The testing/ovmf at least solves linux guest shutdown/reboot problem.

And for linux, with bad ovmf it will gives kernel output about ACPI like:
ACPI Error: Could not disable RealTimeClock events (20170303/evxfevnt-267)

Which is also gone with testing/ovmf.

So it's improving, no windows tested though.
Comment by Peter Wu (Lekensteyn) - Friday, 12 January 2018, 12:56 GMT
The ovmf package in testing is broken for me. Versions:
extra/ovmf 1:r21243.3858b4a1ff-1
testing/ovmf 1:r22345.bec7a86c70-1
qemu 2.11.0-3

With the testing/ovmf package, a Windows 10 installation occupies a single guest/host core for 100%. After 2 HOURS it is still crawling with "Getting files ready for installation (66%)".
The same qemu-system-x86_64 command with the extra/ovmf package the setup was completed in mere 3 minutes...
Comment by George Amanakis (gamanakis) - Friday, 12 January 2018, 13:33 GMT
I am starting to suspect this is not an ovmf problem per se, but happens when Windows updates their GPU initialization code.

If you use a passthrough GPU:
1)remove the GPU passthrough, add a soft VGA/Spice graphics adapater
2)boot win10, it should boot normally
3)remove soft VGA/Spice, add passthrough GPU
4)reboot win10, it should boot normally again

Comment by Peter Wu (Lekensteyn) - Friday, 12 January 2018, 18:38 GMT
George, I do not use a passthrough CPU. This is my command:

qemu-system-x86_64 -machine pc,accel=kvm -monitor stdio -drive if=pflash,format=raw,file=/usr/share/ovmf/x64/OVMF_CODE.fd,readonly -net user -net nic,model=e1000 -vga std -cpu Haswell -m 2G -smp 4 -drive file=win10-debug.qcow2,if=ide -rtc base=2016-01-01 -cdrom en_windows_10_n_multiple_editions_debug-checked_version_1511_x64_dvd_7223826.iso

Current master (commit 018432f0ce1b42541977f61f9c7607257a4bf43a) works for me. Tried to bisect, but many commits could not be tested as the display was unavailable (everything starting with commit d41fd8e839 works again). After a few hours, I found that commit bca18551f6 is the last broken commit, and that the next commit fixes it:

commit 76fd5a660d704538a1b14a58d03a4eef9682b01c
Author: Laszlo Ersek
Date: Thu Oct 26 15:48:31 2017 +0200

MdeModulePkg/AtaAtapiPassThru: disable only BM-DMA at ExitBootServices()

Clearing I/O port decoding in the PCI command register at
ExitBootServices() breaks IDE boot in Windows, on QEMU's "pc" (i440fx)
machine type. (AHCI boot on "q35" is unaffected.) Windows seems repeatedly
stuck, apparently waiting for a timeout of sorts.

Is it possible to either remove testing/ovmf, or update to the fixed or latest git version?
(This also turns out to be fixed in Ubuntu via https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1725560)
Comment by Anatol Pomozov (anatolik) - Friday, 12 January 2018, 18:56 GMT
Hi Peter,

I just pushed up-to-date ovmf package to [testing]. Please check it.
Comment by Peter Wu (Lekensteyn) - Friday, 12 January 2018, 21:38 GMT
Confirmed that testing/ovmf 1:r23112.018432f0ce-1 resolves the slow Windows 10 VM (with the IDE drive type), thanks.
Comment by Thomas C (evil5826) - Tuesday, 16 January 2018, 23:54 GMT
Update breaks existing VM's. Looks like your missing some files in your update. Update package only contains two files. Missing the following:
/usr/share/licenses/ovmf/License.txt
/usr/share/ovmf/ovmf_code_ia32.bin
/usr/share/ovmf/ovmf_code_x64.bin
/usr/share/ovmf/ovmf_vars_ia32.bin
/usr/share/ovmf/ovmf_vars_x64.bin
Comment by Anatol Pomozov (anatolik) - Wednesday, 17 January 2018, 00:09 GMT
Licenses.txt file is there.

*.bin file got renamed to more upstream-like *.fd filename (e.g. /usr/share/ovmf/x64/OVMF_CODE.fd).
i32 build is disabled here https://git.archlinux.org/svntogit/packages.git/commit/trunk/PKGBUILD?h=packages/ovmf&id=afc5fd47e84749f2db15cf3b1439e811b2c48233

Could you please describe your VM issue? Do you have 32bit VM?
Comment by Thomas C (evil5826) - Wednesday, 17 January 2018, 00:31 GMT
Guess i'll have to rebuild or edit the vm to that in the future. Ill just ignore update for now.
Comment by David Runge (dvzrv) - Wednesday, 22 April 2020, 12:54 GMT
@evil5826: You will need to update your VMs firmware paths with `virsh edit <domain>`.

@Unb0rn: Please check whether edk2-ovmf 202002-6 in [testing] fixes your issue.

Loading...