intel / haxm

Intel® Hardware Accelerated Execution Manager (Intel® HAXM)
BSD 3-Clause "New" or "Revised" License
3.18k stars 853 forks source link

qemu + haxm does not work to boot and run Mac OS X High Sierra #149

Open Marietto2008 opened 5 years ago

Marietto2008 commented 5 years ago

Hello,

I tried to boot Mac Os X High Sierra with Qemu (3.1.0) and HAXM,but it did not work. Maybe someone can help me to fix it in some way ? Would be nice to make it work,since HAXM does not support nested virtualization...

C:\Programmi\qemu\qemu-system-x86_64 -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on -machine pc-q35-2.9 -smp 4,cores=2 -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=C:\Programmi\qemu\OVMF_CODE.fd -drive if=pflash,format=raw,file=C:\Programmi\qemu\OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=C:\Programmi\qemu\Clover.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=I:\OS\Images\mac_hdd.img,format=qcow2 -device ide-drive,bus=ide.0,drive=LinuxDVD -drive id=LinuxDVD,if=none,snapshot=on,media=cdrom,file=I:\OS\Images\HighSierra.iso -accel hax

HAX is working and emulator runs in fast virt mode. C:\Programmi\qemu\qemu-system-x86_64: warning: Ignoring ROMD region 0x00000000ffc84000->0x0000000100000000 C:\Programmi\qemu\qemu-system-x86_64: warning: Ignoring ROMD region 0x00000000ffc00000->0x00000000ffc84000 VCPU shutdown request VCPU shutdown request VCPU shutdown request VCPU shutdown request VCPU shutdown request VCPU shutdown request VCPU shutdown request VCPU shutdown request

nevilad commented 4 years ago

When OVMF_CODE.fd, OVMF_VARS-1024x768.fd and CloverNG.qcow2 are not from this issue, please upload these and OpenCore.vdi. Meanwhile you can try clover and uefi from this issue, these are in ziomario.7z in https://drive.google.com/drive/folders/1sYLvF8tgd3baCD-IVoAJ1kpx8SggyqOq.

arrmo commented 4 years ago

Good questions - thanks! Let me try to answer them, 1) Yes, got them all from here, https://github.com/kholia/OSX-KVM. FYI, have also tried this one in the past. Got one you trust / prefer? 2) Yes, sorry! I have been messing with it lately, trying to work through. So I likely have it all messed up now - let me "reset", try again. Don't want to waste your time! 3) Yep, I get to there. Hang is after that. 4) Right. 5) Don't worry about that one ;-). That was me messing with things, thinking Clover may be part of it, so trying OpenCore. Built my own vdi, see if that helped (different blocking point there).

Sorry, can you clarify "from this issue"? In any case, let me reset, align with you! Do I take the files from the link above, try that?

And at some point, I do want to understand how to update / build / control OVMF and VARS, but that can wait ;-).

Thanks again! Will let you know how it goes with the files you point to.

arrmo commented 4 years ago

OK, FYI, I went back, pulled the latest version of OSX-KVM (from GitHub). Started clean ... and had to modify the script file a bit (remove enable-kvm, smp), now I get this on the serial output? image

I assume the files on GitHub are the same as in the link above (Google Drive)?

arrmo commented 4 years ago

OK, took a bit of a step back - I admit, a bit confused, as I see a lot of different commands and approaches above. So as this seems to be pointing to https://github.com/kholia/OSX-KVM, I stepped back to that ... grabbed the latest from GitHub (so corrections?), and tried High Sierra, as this is what the thread seems to be. Do I have that right?

I used boot-macOS-HS.sh, with a few changes,

Error after this,

!!!! X64 Exception Type - 0D(#GP - General Protection)  CPU Apic ID - 00000002 !!!!
ExceptionData - 0000000000000000
RIP  - 000000001F88FBFF, CS  - 000000007FEB1E5C, RFLAGS - 0000000000000018
RAX  - 0000000000000001, RCX - 000000007FEB1E9C, RDX - 000000007FECC5BD
RBX  - 0000000000000020, RSP - 0000000000000001, RBP - 000000007FEB1E7C
RSI  - 000000007FECC5BD, RDI - 0000000003000000
R8   - 0000000003000000, R9  - 000000007FECC5BD, R10 - 000000007FEB1EBC
R11  - 0000000000000001, R12 - 000000007FEB1ECC, R13 - 0000000000000001
R14  - 000000007FECA460, R15 - 000000007FECC5BD
DS   - 0000000000000000, ES  - 0000000000000000, FS  - 0000000000000018
GS   - 000000007FEB0000, SS  - 0000000000000001
CR0  - 000000000000021F, CR2 - 0000000000000008, CR3 - 0000000000000008
CR4  - 0000000000000018, CR8 - 0000000000000018
DR0  - 0000000000010046, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3  - 00000000FFFFFF80, DR6 - 000000000000001F, DR7 - 000000007BF3DD80
GDTR - 000000000009F000 000000007FEB0000, LDTR - 0000000000000008
IDTR - 000000007FEB1E80 0000000000000000,   TR - 000000000009F1A1
FXSAVE_STATE - 000000007FEB1B40
!!!! Find image based on IP(0x1F88FBFF) /home/build/edk2/Build/OvmfX64/RELEASE_GCC5/X64/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe/DEBUG/VariableRuntimeDxe.dll (ImageBase=0000000000B99444, EntryPoint=0000000000B9EF0F) !!!!
!!!! X64 Exception Type - 0D(#GP - General Protection)  CPU Apic ID - 00000001 !!!!
ExceptionData - 0000000000000018
RIP  - 000000000009F009, CS  - 0000000000000018, RFLAGS - 0000000000010046
RAX  - 0000000000000018, RCX - 000000007FEB0000, RDX - 000000001F88FBFF
RBX  - 0000000000000000, RSP - 000000007FEB1E80, RBP - 000000007FEB0000
RSI  - 000000000009F000, RDI - 000000000009F1A1
R8   - 0000000000000000, R9  - 0000000000000000, R10 - 000000007FEB1E5C
R11  - 0000000000000001, R12 - 0000000003000000, R13 - 000000007FECC5BD
R14  - 000000007FEB1E7C, R15 - 0000000000000001
DS   - 0000000000000018, ES  - 0000000000000018, FS  - 0000000000000008
GS   - 0000000000000008, SS  - 0000000000000008
CR0  - 00000000E0000013, CR2 - 0000000000000000, CR3 - 0000000000800000
CR4  - 0000000000000228, CR8 - 0000000000000000
DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
GDTR - 00000000FFFFFF80 000000000000001F, LDTR - 0000000000000000
IDTR - 000000007BF3DD80 000000000000021F,   TR - 0000000000000000
FXSAVE_STATE - 000000007FEB1AE0
!!!! Can't find image information. !!!!

Couldn't even get to EFI. So then, removed smp ... get to EFI now! Still get an exception, but a bit further 😆. Have to run the EFI command manually, and not getting past that. Almost seems like a Clover issue?

So tried pointing at Catalina Clover (NG) ... now it knows what file to boot, but still hangs. Open to any thoughts, thanks!

nevilad commented 4 years ago

Sorry, can you clarify "from this issue"?

From this link - https://drive.google.com/drive/folders/1sYLvF8tgd3baCD-IVoAJ1kpx8SggyqOq. I've tried the latest one from https://github.com/kholia/OSX-KVM and they worked. Let's use them.

and tried High Sierra,

Originally I tested it on HighSierra and Sierra.

I've downloaded OVMF_CODE.fd, OVMF_VARS-1024x768.fd, CloverNG.qcow2 from https://github.com/kholia/OSX-KVM and tried to run HighSierra. Both runs (HighSierra with latest UEFI, HighSierra with latest UEFI and Catalina Clover) were successfull.

This is my command line. You can try it (but change paths): rem HighSierra with latest UEFI and Catalina Clover C:\user\qemux64\qemu-system-x86_64.exe -monitor stdio -no-reboot -machine q35 -m 4G -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=C:\user\apple\Catalina\OVMF_CODE.fd -drive if=pflash,format=raw,file=C:\user\apple\Catalina\OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=C:\user\apple\Catalina\CloverNG.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=C:\user\apple\mac_hdd.img,format=qcow2 -device ide-drive,bus=ide.0,drive=LinuxDVD -drive id=LinuxDVD,if=none,snapshot=on,media=cdrom,file=C:\VirtualMachines\ISO\HighSierra.iso -accel hax

Are you able to run HighSierra with these? Are you able to run Catalina with -accel tcg?

Are your errors before or after this screen: image

When I'm running with CloverNG, it prints many failed assertions, but loads. You write that you see errors in the serial screen, and on the main screen?

Don't smp, there were issues with it's support.

nevilad commented 4 years ago

I've installed MacOS from iso. So far I understand, you use the new method:

This new method does not require an existing physical/virtual macOS installation. However, this new method requires internet access during the macOS installation process. This limitation may be addressed in a future commit.

You removed tap, the installation process will be unable to access network.

The mentioned above reddit link states:

Solved by installing ovmf from git, looks like it is an ovmf bug

Try to download ovmf another time and replace your old files. I had issues with wrongly modified ovmf vars.

Marietto2008 commented 4 years ago

I've downloaded OVMF_CODE.fd, OVMF_VARS-1024x768.fd, Clover.qcow2 and CloverNG.qcow2 from :

https://github.com/kholia/OSX-KVM

and tried to run HighSierra with the latest version of QEMU 64 bit got from here :

https://qemu.weilnetz.de/w64/qemu-w64-setup-20200201.exe

on Windows 10 64 bit.

Below you can see the content of the file mac.bat :

@echo off C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe -monitor stdio -no-reboot -machine q35 -m 4G -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\OVMF_CODE.fd -drive if=pflash,format=raw,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\Clover.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\mac_hdd.img,format=qcow2 -device ide-drive,bus=ide.0,drive=LinuxDVD -drive id=LinuxDVD,if=none,snapshot=on,media=cdrom,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\HighSierra.iso -accel hax

and this is what happens when I run it :

C:\Users\marietto2020\Desktop\MacOS-Haxm λ mac HAX is working and emulator runs in fast virt mode. QEMU 4.2.0 monitor - type 'help' for more information

(qemu) C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: warning: Ignoring ROMD region 0x00000000ffc84000->0x0000000100000000 C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: warning: Ignoring ROMD region 0x00000000ffc00000->0x00000000ffc84000 C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: -device ide-drive,bus=ide.2,drive=Clover: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: -device ide-drive,bus=ide.1,drive=LinuxHDD: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: -device ide-drive,bus=ide.0,drive=LinuxDVD: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead VCPU shutdown request VCPU shutdown request

I tried the HighSierra.iso image file with Clover.qcow2 and with CloverNG.qcow2,but I've got the same error.

I've got the file OVMF_CODE.fd here :

https://github.com/kholia/OSX-KVM/blob/master/OVMF_CODE.fd

I've got the file OVMF_VARS-1024x768.fd here :

https://github.com/kholia/OSX-KVM/blob/master/OVMF_VARS-1024x768.fd

I've got the file Clover.qcow2 here :

https://github.com/kholia/OSX-KVM/blob/master/HighSierra/Clover.qcow2

and I've got the file CloverNG.qcow2 here :

https://github.com/kholia/OSX-KVM/blob/master/Catalina/CloverNG.qcow2

@nevilad : can u provide your HighSierra.iso and Catalina.iso image files ?

nevilad commented 4 years ago

You use qemu without my patch applied. Here is the qemu build with the patch qemu-system-x86_64.zip. It's really a rar archive, but github does not allow to post files with rar extension so I changed it to zip.

nevilad commented 4 years ago

I didn't have any Catalina installation media. The HighSierra.iso I downloaded from https://drive.google.com/drive/folders/1sYLvF8tgd3baCD-IVoAJ1kpx8SggyqOq. But as I mentioned above, when I choose install from the menu, I become an error which states that the disc is damaged: image Maybe it is a result of an error during my download, or it was already damaged.

tibidi commented 4 years ago

Hi there, good to see great progress since my last visit. @nevilad Is qemu patch enough ? Or do we also next a patched haxm driver ?

nevilad commented 4 years ago

Haxm driver should be built too from the source from https://github.com/nevilad/haxm/tree/mac_support. See https://github.com/intel/haxm/pull/288.

oliverhbailey commented 4 years ago

This is the result I got when loading Debian 10 VM on Windows 10 from qemu. There is conflicting information on the web depending on if your using EDKII documentation, QEMU, or KVM, when using the -pflash option. However, since you loaded 2 ROMS, the two lines returned that they accelerator could not be initialized.

I checked several wiki pages on this topic and they all differ in how to properly invoke qemu on Windows to get this to work. There are several variations for Linux as well, so these wikis haven't been kept up to date.

I've taken a different approach to resolve the issue so I am not having issues anymore.

Regards, Oliver Bailey

On Fri, Apr 10, 2020 at 10:02 AM Mario notifications@github.com wrote:

I've downloaded OVMF_CODE.fd, OVMF_VARS-1024x768.fd, CloverNG.qcow2 from https://github.com/kholia/OSX-KVM and tried to run HighSierra with the latest version of QEMU 64 bit on Windows 10. Below you can see the content of the file macOSX.bat :

@echo https://github.com/echo off C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe -monitor stdio -no-reboot -machine q35 -m 4G -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\OVMF_CODE.fd -drive if=pflash,format=raw,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\CloverNG.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\mac_hdd.img,format=qcow2 -device ide-drive,bus=ide.0,drive=LinuxDVD -drive id=LinuxDVD,if=none,snapshot=on,media=cdrom,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\HighSierra.iso -accel hax

and this is what happens when I run it :

(qemu) C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: warning: Ignoring ROMD region 0x00000000ffc84000->0x0000000100000000 C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: warning: Ignoring ROMD region 0x00000000ffc00000->0x00000000ffc84000 C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: -device ide-drive,bus=ide.2,drive=Clover: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: -device ide-drive,bus=ide.1,drive=LinuxHDD: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu\qemu-system-x86_64.exe: -device ide-drive,bus=ide.0,drive=LinuxDVD: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead VCPU shutdown request VCPU shutdown request

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/intel/haxm/issues/149#issuecomment-612068294, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD6CBIHBWJ4GMZFD5426VX3RL4YKFANCNFSM4GM2QLSA .

Marietto2008 commented 4 years ago

@nevilad : This is what happens when I use your qemu patched file :

C:\Users\marietto2020\Desktop\MacOS-Haxm λ mac HAX is working and emulator runs in fast virt mode. QEMU 4.2.50 monitor - type 'help' for more information (qemu) C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu-system-x86_64-patched\qemu-system-x86_64.exe: -device ide-drive,bus=ide.2,drive=Clover: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu-system-x86_64-patched\qemu-system-x86_64.exe: -device ide-drive,bus=ide.1,drive=LinuxHDD: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu-system-x86_64-patched\qemu-system-x86_64.exe: -device ide-drive,bus=ide.0,drive=LinuxDVD: warning: 'ide-drive' is deprecated, please use 'ide-hd' or 'ide-cd' instead VNC server running on ::1:5900

what shoud I do now ?

Marietto2008 commented 4 years ago

Anyway,on this site :

https://drive.google.com/drive/folders/1sYLvF8tgd3baCD-IVoAJ1kpx8SggyqOq

there isn't any HighSierra.iso file.

nevilad commented 4 years ago

VNC server is running. Open a VNC client, connect to 127.0.0.1:5900 and you will see the monitor. I hope you compiled and ran hax from https://github.com/nevilad/haxm/tree/mac_support?

there isn't any HighSierra.iso file.

Yes, not anymore. It's not my google drive.

Marietto2008 commented 4 years ago

I've got haxm from here :

https://github.com/intel/haxm/releases/download/v7.5.6/haxm-macosx_v7_5_6.zip

this is what I see when I run vnc viewer :

2020-04-10_21-29-28

nevilad commented 4 years ago

I've got haxm from here :

No, you should build the code from https://github.com/nevilad/haxm/tree/mac_support. Have you ever built haxm or other github projects?

Marietto2008 commented 4 years ago

Please can u give me the compiled version ? I'm not so advanced to be able to do that by myself. thanks.

nevilad commented 4 years ago

Yes, but this is a debug version, it's signed with a test certificate. To run it you should allow windows to load test certificate signed drivers. IntelHaxm.zip

Marietto2008 commented 4 years ago

what should I do to install it ?

nevilad commented 4 years ago

Enable loading test signed drivers: https://docs.microsoft.com/en-us/windows-hardware/drivers/install/the-testsigning-boot-configuration-option run "HaxmLoader.exe -i \IntelHaxm.sys" run "sc start "haxm service for test""

arrmo commented 4 years ago

Sorry for the delay! Seen all the traffic today, but have been stuck working. No good when work gets in the way of fun 😄.

I've tried the latest one from https://github.com/kholia/OSX-KVM and they worked. Let's use them.

Sure, that makes sense - will do the same (master, right?)

I've downloaded OVMF_CODE.fd, OVMF_VARS-1024x768.fd, CloverNG.qcow2 from https://github.com/kholia/OSX-KVM and tried to run HighSierra. Both runs (HighSierra with latest UEFI, HighSierra with latest UEFI and Catalina Clover) were successfull.

OK, doing the same ... again, using master.

This is my command line. You can try it (but change paths): rem HighSierra with latest UEFI and Catalina Clover C:\user\qemux64\qemu-system-x86_64.exe -monitor stdio -no-reboot -machine q35 -m 4G -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=C:\user\apple\Catalina\OVMF_CODE.fd -drive if=pflash,format=raw,file=C:\user\apple\Catalina\OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=C:\user\apple\Catalina\CloverNG.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=C:\user\apple\mac_hdd.img,format=qcow2 -device ide-drive,bus=ide.0,drive=LinuxDVD -drive id=LinuxDVD,if=none,snapshot=on,media=cdrom,file=C:\VirtualMachines\ISO\HighSierra.iso -accel hax

OK, my slightly modified command line - not using the ISO, rather Recovery image ... should be fine, agreed? And I have added the serial log to a file, make it easier to capture, "c:\Program Files\qemu\qemu-system-x86_64.exe" -monitor stdio -no-reboot -machine q35 -m 4G -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=OVMF_CODE.fd -drive if=pflash,format=raw,file=OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=.\Catalina\CloverNG.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=mac_hdd_ng.img,format=qcow2 -device ide-hd,bus=ide.3,drive=InstallMedia -drive id=InstallMedia,if=none,file=BaseSystem.img -accel hax -serial file:serial.log

Hangs here, image And, serial.log,

!!!! X64 Exception Type - 0D(#GP - General Protection)  CPU Apic ID - 00000000 !!!!
ExceptionData - 0000000000000000
RIP  - 000000007DE9E62E, CS  - 0000000000000038, RFLAGS - 0000000000000213
RAX  - 000000007DE9E629, RCX - 0000000000000035, RDX - 000000007DEF510C
RBX  - 000000007FEC10D0, RSP - 000000007FEC1010, RBP - 000000007FEC1180
RSI  - 000000007ED28298, RDI - 000000007EC1D018
R8   - 000000000000001E, R9  - 0000000000000001, R10 - 0000000000000000
R11  - 0000000000000000, R12 - 000000007FEC1080, R13 - 000000007FEC1598
R14  - 000000007FEC1708, R15 - 0000000000000000
DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
GS   - 0000000000000030, SS  - 0000000000000030
CR0  - 00000000C0000033, CR2 - 0000000000000000, CR3 - 000000007FC01000
CR4  - 0000000000000668, CR8 - 0000000000000000
DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
GDTR - 000000007FBEE698 0000000000000047, LDTR - 0000000000000000
IDTR - 000000007F81D018 0000000000000FFF,   TR - 0000000000000000
FXSAVE_STATE - 000000007FEC0C70
!!!! Find image based on IP(0x7DE9E62E) /Users/sergey/src/CloverHackyColor/Build/Clover/RELEASE_GCC53/X64/rEFIt_UEFI/refit/DEBUG/CLOVERX64.dll (ImageBase=000000007DE5C000, EntryPoint=000000007DEDADFA) !!!!

Are you able to run HighSierra with these? Are you able to run Catalina with -accel tcg?

Well, it gets further (below), then crashes,

OsxAptioFix3Drv: Starting overrides for \System\Library\CoreServices\boot.efi
Using reloc block: no, hibernate wake: no 
Start
Start OSName
End OSName
Start InitDeviceTree
Start InitDeviceTree
End InitDeviceTree
Start InitMemoryConfig
End InitMemoryConfig
Start CheckHibernate
End CheckHibernate
efiboot loaded from device: Acpi(PNP0A03,0)/Pci(1F|2)/SATA(3,FFFF)/HD(Part1,SigF4F07376-FA3C-4979-B3CF-C224D9E34E1B)
efiboot file path: \System\Library\CoreServices\boot.efi
Start OpenVolume
End OpenVolume
Start ProcessOptions
End ProcessOptions
RegisterRestartDataProtocol: called. 0x7ec3d498
RestartData protocol installed successfully.
Start SetConsoleMode
End SetConsoleMode
Start ReadKernelCache
End ReadKernelCache
Start UncompressKernelCache
End UncompressKernelCache
Start CalculateAdler32
End CalculateAdler32
Start LoadKernelFromStream
End LoadKernelFromStream
Start InitBootStruct

root device uuid is 'E485257F-565B-3405-BE1F-6717255D5FBB'
End InitBootStruct
Start LoadRAMDisk
End LoadRAMDisk
Start FinalizeBootStruct
Start RandomSeed
End RandomSeed
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

With no accel ... well, that crashes now too! I did rebuild with the latest master - is that what you are running? My version (git) is master 8bac3ba57e [origin/master] Merge remote-tracking branch 'remotes/rth/tags/pull-rx-20200408' into staging.

Don't smp, there were issues with it's support.

Agreed!

Suggestions? Thanks!

Marietto2008 commented 4 years ago

It started,but I'm not able to install the OS. When I click on "macOS installation" nothing happens. And I can't continue. Also when I click on "disk utility" nothing happens.

2020-04-10_22-21-31

arrmo commented 4 years ago

Hmmm ... as mine is crashing out earlier, let me take a step back. What version of qemu are you building (not master?)? And only the one patch? Just to make sure to align - can you confirm the patch?

Thanks!

nevilad commented 4 years ago

To @arrmo

Sure, that makes sense - will do the same (master, right?)

There is only master branch, no ambiguity.

Well, it gets further (below), then crashes

The log is serial output? I don't use it, so don't know what should be the correct output.

With no accel ... well, that crashes now too!

When some run ended in a crash or hang, replace OVMF vars with the original file. I encountered such issues, which seems to be related to partial or wrong data written to vars. Let's try to run HighSierra with tcg.

nevilad commented 4 years ago

To @Marietto2008

When you select some items in the window the button "continua" in the right bottom corner should be enabled. Click it to continue. Are able to select different items in the menu? For example "cambia lingua"?

Marietto2008 commented 4 years ago

I'm using this patched driver : https://github.com/intel/haxm/files/4463118/IntelHaxm.zip with this batch file :

@echo off rem Bcdedit.exe -set TESTSIGNING ON rem HaxmLoader.exe -i IntelHaxm.sys rem pause rem sc start "haxm service for test" rem pause C:\Users\marietto2020\Desktop\MacOS-Haxm\qemu-system-x86_64-patched\qemu-system-x86_64.exe -monitor stdio -no-reboot -machine q35 -m 4G -usb -device usb-kbd -device usb-tablet -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" -drive if=pflash,format=raw,readonly,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\OVMF_CODE.fd -drive if=pflash,format=raw,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\OVMF_VARS-1024x768.fd -smbios type=2 -device ich9-intel-hda -device hda-duplex -device ide-drive,bus=ide.2,drive=Clover -drive id=Clover,if=none,snapshot=on,format=qcow2,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\Clover.qcow2 -device ide-drive,bus=ide.1,drive=LinuxHDD -drive id=LinuxHDD,if=none,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\mac_hdd.img,format=qcow2 -device ide-drive,bus=ide.0,drive=LinuxDVD -drive id=LinuxDVD,if=none,snapshot=on,media=cdrom,file=C:\Users\marietto2020\Desktop\MacOS-Haxm\HighSierra.iso -accel hax pause

arrmo commented 4 years ago

Agreed, master is master ... 😆. Just wasn't sure if you were off an earlier branch (e.g. v4.2.0 or something like that).

Understood on serial. It's the same on the screen (except the crash), just easier to copy and paste from a file.

OVMF - yes, I am using the original file (meaning from GitHub, master) ... or do you mean a different file (zip perhaps?)? And yes, I tried HighSierra, with tcg.

Thanks!

Marietto2008 commented 4 years ago

@nevilad : I changed the language from italian to english and I was able to click on "continue". But the installation does not go further. It gave this error "this copy of mac os x is damaged and can't be used to install macOS"

nevilad commented 4 years ago

To @arrmo

What version of qemu are you building (not master?)? And only the one patch?

I'm building qemu 4.2, it may be not up to date, since I didn't update it with the latest changes several months. I'm adding only the patch for hax-mem. You can find my qemu exe in one of today messages.

Just to make sure to align - can you confirm the patch?

What means confirm?

It's the same on the screen (except the crash)

On the screen of the serial? I use VNC, there is no serial output window.

OVMF - yes, I am using the original file (meaning from GitHub, master) ... or do you mean a different file (zip perhaps?)? And yes, I tried HighSierra, with tcg.

I mean that all MacOS runs write to vars. You started Catalina, it's run ended in a crash. The state of the vars file may be damaged. Then you start HighSierra with an already damaged file and it does not run because of this.

nevilad commented 4 years ago

To @Marietto2008 Yes, I have the same issue. I think the iso is really damaged. I don't have a correct disc.

To @arrmo Where did you get HighSierra installation media?

nevilad commented 4 years ago

To @arrmo

I've tried the latest one from https://github.com/kholia/OSX-KVM and they worked. Let's use them.

Sure, that makes sense - will do the same (master, right?)

The original post was about ovmf files, not qemu.

Marietto2008 commented 4 years ago

I'm not sure that the image iso file is damaged,because me and you are using different iso images,right ?

nevilad commented 4 years ago

I've got the iso from the google drive link, before it was not deleted. Where did you get your iso?

Marietto2008 commented 4 years ago

I'm installing high Sierra from another ISO image and it has gone further until some point and then it stopped,maybe because some error that I don't see,the vnc server dropped. Check the images below..

2020-04-10_23-49-26

2020-04-10_23-49-39

Marietto2008 commented 4 years ago

I'm using this ISO image :

https://drive.google.com/drive/folders/1jAVPZ-9iMDBpWRE9fpXKAsS0gnP0vvTs?usp=sharing

nevilad commented 4 years ago

I've tried to run my iso with accel tcg, same error: image

Run dbgview (https://docs.microsoft.com/en-us/sysinternals/downloads/debugview) and try another time. After error save dbgview log and paste here.

nevilad commented 4 years ago

@arrmo when you run tests with haxm, please run it with dbgview.

Marietto2008 commented 4 years ago

An error occurred while preparing the installation. Try running this application again

On dbgview I see a lot of these lines :

PPLE (Informational) LIFECY L_FreeThreedData InitThreadData L_AllocThreadData

arrmo commented 4 years ago

I mean that all MacOS runs write to vars. You started Catalina, it's run ended in a crash. The state of the vars file may be damaged. Then you start HighSierra with an already damaged file and it does not run because of this.

Yes, that makes sense - and that was it, thanks! BTW, I'm running my local build now, of master (basically v5.0.0-rc2), and it works (with haxm, much faster!). Let me try to answer your other questions though.

Where did you get HighSierra installation media?

Just using ./fetch-macOS.py (python3) from https://github.com/kholia/OSX-KVM

OK, I updated to your haxm file - was having build issues here, as I cross-compile (happen to have any info on that, Linux compile for Windows?). But when I ran bcdedit ... well, it worked, but a bit of "fun" (messed with my BitLocker, had to recover the SSD ... LOL).

I'm getting now to the full OS install, that's working, but one odd thing - hard to describe this, but the mouse seems to not "track" properly, moving less inside the VM than outside (so can't really get around properly). Am I making any sense at all? 🤣. BTW, I'm running GTK, but I had this before as well, same issue with VNC (as I recall). Any pointers would be appreciated!

Thanks again!

PS: Unrelated, but do you know how to mount a thumb drive? I'd like to try to get OpenCore working also, easiest if I can and/remove the drive, and update the files. No biggie though, a side question (and minor!).

arrmo commented 4 years ago

I'm getting now to the full OS install, that's working, but one odd thing - hard to describe this, but the mouse seems to not "track" properly, moving less inside the VM than outside (so can't really get around properly). Am I making any sense at all? 🤣. BTW, I'm running GTK, but I had this before as well, same issue with VNC (as I recall). Any pointers would be appreciated!

Never mind ... LOL. That was me, using the stock Catalina command. Changed usb-mouse to usb-tablet, life is good now (just need to reverse the direction in the OS).

arrmo commented 4 years ago

OK, really is working great - just need to figure out now how to get the NIC working on qemu, bridged to my network (interfaces) ... then I can get the install to fully proceed.

Marietto2008 commented 4 years ago

it's not working for me...let me understand. we are using the same files and the same patch but for you its working and for me not ?

nevilad commented 4 years ago

@Marietto2008 can you save dbgview log (File->Save as) and attach it here? When you ran it correctly there should be lines about haxm state at exit. Are your debugview filter set as follow: image

nevilad commented 4 years ago

as I cross-compile (happen to have any info on that, Linux compile for Windows?).

Of course, this is the only possible way to build qemu for windows.

Changed usb-mouse to usb-tablet

That's an old known issue of qemu.

how to mount a thumb drive

I was unable to get connected to the host usb-drives dynamically connect to guest. Same for virtual drives. Used for this purpose small virtual drives and rebooted the OS, when needed to update files on the drive. When you find a solution, post it in this thread.

arrmo commented 4 years ago

Of course, this is the only possible way to build qemu for windows.

Yes, qemu - and that's how I do it already. Sorry, I meant cross-compiling haxm. Any pointers? The info on your fork doesn't seem to mention it (or I just missed it, that's possible!). Thanks!

That's an old known issue of qemu.

Ya, I just forgot / missed it when grabbing the stock command ... LOL

When you find a solution, post it in this thread.

You bet, will do! First, need to get through the network issue.

arrmo commented 4 years ago

it's not working for me...let me understand. we are using the same files and the same patch but for you its working and for me not ?

Can you clarify exactly what is not working? It seems like you get to the install ... is that right? Will help if I can!

nevilad commented 4 years ago

I meant cross-compiling haxm

Never cross-compiled windows drivers on linux. Why not on a windows host? Install Visual Studio and build it.

Can you clarify exactly what is not working?

I think he's problem is in MSRs. See https://github.com/intel/haxm/pull/288:

MacOS can read/write different MSRs in different runs, when some MSR is not emulated, the guest crashes. To debug this, I've added logging of accesses to these MSRs. When you encounter crashes, look to the log.

arrmo commented 4 years ago

Never cross-compiled windows drivers on linux. Why not on a windows host? Install Visual Studio and build it.

Will give it a shot ... 😄. Agreed, should be find - just used to cross-compiling, and my Linux box is a lot faster. LOL.

Thanks!

Marietto2008 commented 4 years ago

I've created the baseimage.img file with the following commands :

python fetch-macOS.py qemu-img convert BaseSystem.dmg -O raw basesystem.img

and then i tried to install HighSierra from the baseimage.img file,but it didn't work. Check the images below...

2020-04-11_12-30-54

2020-04-11_12-31-26

2020-04-11_12-32-14