acidanthera / bugtracker

Acidanthera Bugtracker
382 stars 44 forks source link

Cannot find qcow2 disk using latest OVMF. #751

Closed Leoyzen closed 4 years ago

Leoyzen commented 4 years ago

Describe: When using latest OVMF from QEMU, opencore can't find correct filesystem to boot.The difference is in the pic and highlighted. I can't find useful information by reading the code(maybe related to "OcScanForBootEntries"?) image

vit9696 commented 4 years ago

Where are logs and EFI directory dump?

Leoyzen commented 4 years ago

Here is log with latest OVMF: opencore-2020-03-04-172632.txt

Here is log with custom OVMF opencore-2020-03-04-173238.txt

My config

config2.plist.zip

vit9696 commented 4 years ago

Morning, thanks for the logs. The config mostly makes sense to me (although I believe you should not inject that AGPM kext or video properties), but I wonder about two things:

Try them both separately. To be honest, all this looks quite strange, will it be possible to create a minimal macOS version we can run here and debug? E.g. by just running it on macOS without KVM accelerator.

CC @Download-Fritz, @savvamitrofanov

Leoyzen commented 4 years ago

@vit9696

  1. Yeah, the log is using ScanPolicy=0, so no, it did not work.
  2. I will test apfs.efi and feedback again.
  3. This almost the minimal test enviroments (I use it to debug hackintosh setup), but without KVM accelerator it won't boot at all.(kvm and supervisor expose is important for MacoS to boot)
vit9696 commented 4 years ago

For the current issue it should be doable to just have OpenCore starting I guess. From what I remember, macOS boots fine without KVM if you specify Penryn CPU, so with a little tweaking it might work too. Anyway, let's wait for an apfs.efi test first.

Leoyzen commented 4 years ago

@vit9696 Yes! Apfs.efi works fine.So it may be ApfsDriverLoader.efi issues?(apfs.efi dumps from 10.15.4 beta)

Here is the log with apfs.efi opencore-2020-03-05-045028.txt

vit9696 commented 4 years ago

Yes, this is possible. We are currently rewriting ApfsDriverLoader, so I would suggest you to wait until that lands to master. There is probably little reason to debug a deprecated driver.

Leoyzen commented 4 years ago

Ok, I will use apfs.efi first until the rewrite of ApfsDriverLoader merged.How long will it happen?

vit9696 commented 4 years ago

It is hard to give definite deadlines, as this has been postponed several times already. I want it to land in 0.5.7 though, will see if it can.

arrmo commented 4 years ago

OK, let me apologize in advance - I know just about enough here to be an idiot. Actually, clearly less than that ... LOL.

I am having what I believe is a similar issue - OpenCore works fine with VirtualBox, sees the drives to boot from, but not in QEMU (have tried both Linux and Windows hosts). Is the workaround to manually change out the driver, from ApfsDriverLoader to apfs? If that is the case, sorry, but ... where to find apfs.efi (that works)?

Or is the thought to try a different EFI / OVMF?

Thanks!

PS: Am seeing this in 0.5.7, but you likely already know that 😄

vit9696 commented 4 years ago

May be resolved in ApfsSupportPkg master. Please check.

Leoyzen commented 4 years ago

@vit9696 I tried with latest build, but it still not work(boot not found).Also another issue prevent me from getting log. When I tried set Target to 83 (logging to file) then opencore (0.5.7) stuck at BIOS Logo, log stuck after OpenRuntime.efi loaded:


00:000 00:000 OC: OpenCore DBG-058-2020-04-10 is loading in Optional mode (0/0)...
00:046 00:046 OC: Boot timestamp - 2020.04.10 06:43:36
00:095 00:048 OCCPU: MP services threads 4 (enabled 4) - Success
00:140 00:045 OCCPU: MP services Pkg 1 Cores 2 Threads 2 - Success
00:185 00:044 OCCPU: Found Intel Xeon Processor (Skylake)
00:229 00:044 OCCPU: Signature 50654 Stepping 4 Model 55 Family 6 Type 0 ExtModel 5 ExtFamily 0 uCode 0
00:274 00:044 OCCPU: Hypervisor detected
00:317 00:043 OCCPU: VMWare TSC:  3600003000Hz,  3600MHz; FSB:  1000000000Hz,  1000MHz; BusRatio: 3
00:363 00:045 OCCPU: Detected Apple Processor Type: 05 -> 0501
00:408 00:044 OCCPU: CPUFrequencyFromTSC           0Hz     0MHz
00:452 00:044 OCCPU: CPUFrequency  3600003000Hz  3600MHz
00:497 00:044 OCCPU: FSBFrequency  1000000000Hz  1000MHz
00:543 00:046 OCCPU: Pkg 1 Cores 2 Threads 4
00:589 00:046 OC: OcLoadNvramSupport...
00:634 00:044 OC: Setting NVRAM 4D1EDE05-38C7-4A6A-9CC6-4BCCA8B38C14:UIScale - ignored, exists
00:678 00:044 OC: Setting NVRAM 7C436110-AB2A-4BBB-A880-FE41995C9F82:boot-args - ignored, exists
00:723 00:044 OC: Setting NVRAM 7C436110-AB2A-4BBB-A880-FE41995C9F82:csr-active-config - ignored, exists
00:767 00:044 OC: Current version is DBG-058-2020-04-10
00:812 00:045 OC: OcLoadUefiSupport...
00:882 00:069 OCABC: RTDFRG 1 DEVMMIO 0 NOSU 0 NOVRWR 0 NOSB 0 NOHBMAP 0 SMSLIDE 1 WRUNPROT 1
00:928 00:046 OCABC: FEXITBS 0 PRMRG 0 CSLIDE 1 PRSRV 0 RBMAP 0 VMAP 1 APPLOS 0 RTPERMS 0
00:972 00:044 OCABC: Firmware has 2085587 free pages (512723 in lower 4 GB)
01:030 00:057 OCABC: Awaiting rendezvous with OpenRuntime r10
01:078 00:048 OC: Got 4 drivers
01:123 00:044 OC: Driver #ApfsDriverLoader.efi at 0 is being loaded...
01:167 00:044 OC: Driver VBoxHfs.efi at 1 is being loaded...
01:233 00:065 OC: Driver VBoxHfs.efi at 1 is successfully loaded!
01:279 00:045 OC: Driver VBoxHfs.efi at 1 needs connection.
01:323 00:044 OC: Driver apfs-nolog.efi at 2 is being loaded...
01:430 00:106 OC: Driver apfs-nolog.efi at 2 is successfully loaded!
01:481 00:050 OC: Driver apfs-nolog.efi at 2 needs connection.
01:525 00:044 OC: Driver OpenRuntime.efi at 3 is being loaded...
vit9696 commented 4 years ago

@Leoyzen target 83 also logs to UEFI variable, maybe it is the problem. Does the same issue happen with target 76?

We cannot really reproduce the issue here. Could you please attach a sample qcow2 disk and a command-line argument for qemu to use it? Are you sure that the disk is bootable and is not visible from UEFI Shell?

Leoyzen commented 4 years ago

@vit9696 I'm quite sure the qcow2 disk is bootable , it works with apfs.efi but not with ApfsDriverLoader.efi.The xml and efi details can be found here:KVM-Opencore.

vit9696 commented 4 years ago

@Leoyzen there is no libvirt on macOS and there also is not KVM. The whole thing is a bit different. For this reason I cannot easily setup macOS in QEMU and make a qcow2 disk with APFS. I may be able to reproduce it if you provide a disk on your own, however. I do not mind the size.

Leoyzen commented 4 years ago

Here you are, this is the 0.5.8 qcow2 disk which I used to test. opencore.beta.qcow2.zip

Leoyzen commented 4 years ago

@vit9696 This is the qemu command-line arguments from libvirt which I'm using now:

2020-04-10 06:32:32.453+0000: starting up libvirt version: 5.10.0, qemu version: 4.2.0, kernel: 5.5.8-Unraid, hostname: Tower
LC_ALL=C \
PATH=/bin:/sbin:/usr/bin:/usr/sbin \
HOME=/var/lib/libvirt/qemu/domain-4-CatalinaBetaVNC \
XDG_DATA_HOME=/var/lib/libvirt/qemu/domain-4-CatalinaBetaVNC/.local/share \
XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain-4-CatalinaBetaVNC/.cache \
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain-4-CatalinaBetaVNC/.config \
QEMU_AUDIO_DRV=none \
/usr/local/sbin/qemu \
-name guest=CatalinaBetaVNC,debug-threads=on \
-S \
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-4-CatalinaBetaVNC/master-key.aes \
-blockdev '{"driver":"file","filename":"/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/etc/libvirt/qemu/nvram/5d3d0751-356b-a414-3fd9-c7a4ff1b70a5_VARS-pure-efi.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine pc-q35-4.2,accel=kvm,usb=off,dump-guest-core=off,mem-merge=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-cpu host,topoext=on,l3-cache=on,host-cache-info=off \
-m 8192 \
-overcommit mem-lock=off \
-smp 1,maxcpus=4,sockets=1,cores=2,threads=2 \
-uuid 5d3d0751-356b-a414-3fd9-c7a4ff1b70a5 \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=34,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc,driftfix=slew \
-global kvm-pit.lost_tick_policy=delay \
-no-hpet \
-no-shutdown \
-boot strict=on \
-device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \
-device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \
-device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 \
-device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \
-device pci-bridge,chassis_nr=5,id=pci.5,bus=pcie.0,addr=0x6 \
-device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x7.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x7 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x7.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x7.0x2 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x0 \
-blockdev '{"driver":"file","filename":"/mnt/user/domains/Catalina/opencore.beta.qcow2","node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage","backing":null}' \
-device usb-storage,bus=usb.0,port=1,drive=libvirt-2-format,id=usb-disk2,bootindex=1,removable=off,write-cache=on \
-blockdev '{"driver":"file","filename":"/mnt/user/domains/Catalina/system.beta.qcow2","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}' \
-device ide-hd,bus=ide.0,drive=libvirt-1-format,id=sata0-0-0,write-cache=on \
-netdev tap,fd=36,id=hostnet0 \
-device e1000-82545em,netdev=hostnet0,id=net0,mac=52:54:00:3e:21:a2,bus=pcie.0,addr=0xb \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,fd=37,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-device usb-tablet,id=input0,bus=usb.0,port=2 \
-device usb-kbd,id=input2,bus=usb.0,port=3 \
-vnc 0.0.0.0:0,websocket=5700 \
-k en-us \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1 \
-device vfio-pci,host=0000:05:10.2,id=hostdev0,bus=pcie.0,addr=0xa \
-device 'isa-applesmc,osk=xxxxxxx' \
-cpu Skylake-Server,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+topoext,+svm \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
vit9696 commented 4 years ago

Your disk is partitioned as MBR, why do you use MBR, when it is said to be explicitly unsupported by OpenCore?

Leoyzen commented 4 years ago

@vit9696 I don't know which disk you mentioned. I fromated all my disk as GUID. This is the VM I've been used for testing (which the issues happened, also with the qcow2 image), here is the screenshot from Apple Disk Utility: image image

vit9696 commented 4 years ago

@Leoyzen oh, I see now, it is just having some reserved MBR data. Ok, I will continue investigating.

vit9696 commented 4 years ago

I reviewed your HDD, it only has 2 FAT32 partitions, no APFS on it. Most likely you made some mistake when uploading the drive.

Leoyzen commented 4 years ago

@vit9696 I have two disk like the screenshot above:

  1. the one I've uploaded, it just a EFI partition like a usb stick, then we can backup/recovery/modified/sharing easily.
  2. the one wiith system without EFI.

Do you want the system image?It may quite large(28G).

vit9696 commented 4 years ago

Yeah, that's what I need. You can remove basically all the files from it to make it smaller, but I personally do not care if I need to download 28G.

vit9696 commented 4 years ago

Actually, could you test this version and provide a log if it fails?

ApfsDriverLoader-r3.zip

Leoyzen commented 4 years ago

@vit9696 This one works for me, it boots fine.

Leoyzen commented 4 years ago

@vit9696 Here is the download link.

vit9696 commented 4 years ago

Thanks for the uploaded image. This helped quite a lot for testing. Modern OpenCore has builtin support for APFS, which should work just fine with OVMF. Closing as resolved.

Leoyzen commented 4 years ago

@vit9696 So I use master branch of opencorepkg then the apfsloader will work right?

vit9696 commented 4 years ago

ApfsLoader no longer exists. You need to use UEFI → APFS section from OpenCorePkg master.

arrmo commented 4 years ago

Hi,

Sorry, trying to wrap my head around how to make this work 😞. Just a couple minor questions, 1) Is this also in 0.5.7, or only master? Asking because I'm trying to build master, but it's breaking here (that's likely just me!). 2) I do see APFS Properties inside the UEFI section (of the plist file) ... but not quite sure what to set the value to for auto-detection to work. Any pointers?

Thanks!

arrmo commented 4 years ago

FYI, added the key EnableJumpstart (APFS, inside UEFI) - no drives show up, but this is on 0.5.7 ... so perhaps that's the problem?

Thanks!

arrmo commented 4 years ago

Hi,

Still seeing the issue in 0.5.8 😞. It may be that my plist syntax is not quite right ... can you clarify what it should be, and I'll recheck.

Thanks!

rjocoleman commented 4 years ago

An example is

    <key>UEFI</key>
    <dict>
        <key>APFS</key>
        <dict>
            <key>EnableJumpstart</key>
            <true/>
            <key>HideVerbose</key>
            <true/>
            <key>JumpstartHotPlug</key>
            <false/>
            <key>MinDate</key>
            <integer>0</integer>
            <key>MinVersion</key>
            <integer>0</integer>
        </dict>

No ApfsDriverLoader.efi in Drivers. Maybe you should also check your ScanPolicy value.

arrmo commented 4 years ago

That did it - thanks very much!

Getting the odd "blocky" FileVault login now (like I saw in the past, blamed it on Clover ... LOL).

Much appreciated!

arrmo commented 4 years ago

BTW, to explain my "blocky" comment ... LOL. Here is what I see for the FileVault login - is it just me? https://github.com/CloverHackyColor/CloverBootloader/issues/7#issuecomment-605678761

And should I open a different issue for this? FYI, I'm running on Linux, QEMU / kvm - much faster than my (very) old Mac, so otherwise lovin' it!

vit9696 commented 4 years ago

The issue you mentioned is likely related to broken FV2 UI caches. If you think it can be driver you can always use direct rendering in OpenCore (check the output section).

arrmo commented 4 years ago

That worked - thanks! I enabled DirectGopRendering, and it fixed it 😄.

The documentation mentions perhaps slower scrolling ... any other downside to leaving this enabled?

Thanks again!

vit9696 commented 4 years ago

Interesting. As for downsides, sometimes slower scrolling in UEFI applications is pretty much all you can notice. There are no downsides once macOS starts.

arrmo commented 4 years ago

Excellent - thanks!