Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

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

Open
Marietto2008 opened this issue Jan 2, 2019 · 931 comments
Open

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

Marietto2008 opened this issue Jan 2, 2019 · 931 comments
Labels

Comments

@Marietto2008
Copy link

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

@raphaelning
Copy link
Contributor

We don't plan to provide official support for running macOS guests, but we're open to pull requests for this feature.

"VCPU shutdown request" indicates a panic in the HAXM driver. Could you post the HAXM driver log?

@HaHoYou
Copy link
Contributor

HaHoYou commented Jan 3, 2019

The HAXM driver log can be got from Windbg. Also, would you help to provide the MacOS iso file and other files you used, as well as the method how you made them.

@Marietto2008
Copy link
Author

Thanks. You can find everything below (the mac os x high sierra iso file and the log file). PS : About how I have obtained the mac os x iso file : I got it following this tutorial : https://github.com/kholia/OSX-KVM/tree/master/HighSierra

https://drive.google.com/open?id=1sYLvF8tgd3baCD-IVoAJ1kpx8SggyqOq

@Marietto2008
Copy link
Author

Anyway,I have attached the log file below..

High_Sierra.LOG

@Marietto2008
Copy link
Author

Marietto2008 commented Jan 6, 2019 via email

@raphaelning
Copy link
Contributor

did u get everything you need ?

Yes, thanks for providing all the details! It seems the error has nothing to do with the macOS guest image (mac_hdd.img or HighSierra.iso), because I was able to reproduce the same error with the following QEMU command:

qemu-system-x86_64 -machine q35 -drive if=pflash,format=raw,readonly,file=X:\path\to\OSX-KVM\OVMF_CODE.fd -accel hax

Without -accel hax, QEMU can boot to the OVMF shell. Therefore, the first step is to get OVMF working on HAXM. This is the first time we have tested booting UEFI firmware (OVMF) on HAXM, so there can be surprises.

@HaHoYou
Copy link
Contributor

HaHoYou commented Jan 7, 2019

Yes, we got them, thanks.

@Marietto2008
Copy link
Author

news ?

@raphaelning
Copy link
Contributor

Today we received an important tip from the QEMU community (many thanks to @AlexAltea) on why OVMF doesn't yet run on HAXM:

http://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg08482.html

If we implement the proposed changes, we should be a big step closer to getting OVMF booting.

@Marietto2008
Copy link
Author

nice.

@ewoks
Copy link

ewoks commented May 26, 2019

any progress on this? tnx

@tibidi
Copy link

tibidi commented Oct 1, 2019

I have the same issue any progress ?

@Marietto2008
Copy link
Author

Marietto2008 commented Oct 1, 2019 via email

@HaHoYou
Copy link
Contributor

HaHoYou commented Oct 14, 2019

The guest of Darwin has not been supported so far. Unfortunately, we have not prioritized this feature in our development plans yet. If community contributors are willing to investigate this feature, it will be welcomed and we will provide corresponding supports. We will record your requirements in order to include it in the future development plans. Thank you.

@Marietto2008
Copy link
Author

Marietto2008 commented Oct 14, 2019 via email

@HaHoYou
Copy link
Contributor

HaHoYou commented Oct 16, 2019

Great thanks for your previous information from raising this issue to providing the detailed logs. All of these contributions helped us to narrow down the original issue to the OVMF booting support. We had already marked this issue as a feature in January of this year, and we are very open to discuss the implementation of this feature and welcome any pull request for it. Currently, we are busy in solving the issues reported by Android SDK customers and our focus is mainly targeted to Android Emulator, sorry for delayed response. Thanks for you understanding.

@nevilad
Copy link
Contributor

nevilad commented Feb 2, 2020

Is OVMF_CODE.fd MacOS bios image? Can MacOs run with bioses shipped with qemu?
The error can be reproduced using this command line:
qemu-system-x86_64 -machine q35 -drive if=pflash,format=raw,readonly,file=X:\path\to\OSX-KVM\OVMF_CODE.fd -accel hax
Does this mean that it is possible to run MacOs without hdd and installation iso?
Since it is possible to reproduce the bug usng only OVMF_CODE.fd, can I download only this file somewhere?

@nevilad
Copy link
Contributor

nevilad commented Feb 17, 2020

With some patches in qemu and hax I'm able to run MacOS. It requires exactly Penryn CPU version in cpuid1.eax. I don't wan't to change the code to return exactly this version, instead qemu should set it through specific ioctls. But there are no ioctls for doing this yet. KVM API has an ioctl for setting values returned by cpuid. It would be good to make exactly this API in hax, but it does not allow to set only one register for cpuid. Any suggestions for solving this problem? Should hax move towards KVM-like ioctl API?
@AlexAltea mentioned that it would be good to adopt the KVM API #106 (comment) and created #121.

@oliverhbailey
Copy link

I am working on a book developing for UEFI. I've been writing operating system drivers, and developing custom hardware for over 40 years. And I co-authored some very early PC applications and developer tools. I have had issues with UEFI in a virtual environment. First off, OVMF development isn't supported in VirtualBox, as the emulator is incomplete. They note that fact in the documentation. What does surprise me is the fact that HAXM doesn't support protected ROM areas when used with QEMU. The reason I need this is for screen captures for the book. My screen capture and screen recording software works on Windows, so I routinely run Linux and OVMF in qemu to capture these screens.
Since Intel is a member of the "Unified" group developing UEFI, it would seem there would be better support and less time making excuses why it won't work. You cannot support Mac, if you don't support UEFI. If any executive from Intel would be willing to explain this, I would be interested in hearing what the have to say. You can't finish the UEFI implementation of make the BIOS completely transparent until you have a plan to make it work with QEMU. Maybe you should consider using kvm to support the Intel emulator and move forward so kernel and driver developers can help you move forward.
The following is the error message generated by haxm 7.5.6 on Windows 10.1 build 1903.
qemu-system-x86_64: warning: Ignoring ROMD region 0x00000000ffc84000->0x0000000100000000

This is just the OVMF_CODE.fd ROM image. The same happens for the OVMF_VARS.fd ROM image as well.

If the right person reads this who is on the HAXM team, allocating a reserved area for ROM images is going to be a requirement anyway, since many hardware devices install ROM images during the POST phase of the BIOS.

HaHoYou needs to stop making excuses for this and start finding the right people in the HAXM group at Intel to get this moving NOW. You can't finish developing UEFI without prioritizing this facet of development.

If anyone at Intel who is involved with HAXM development reads reads this. Contact me directly through LinkedIn.

Regards,
Oliver Bailey

@nevilad
Copy link
Contributor

nevilad commented Mar 16, 2020

The patch for supporting ROMD in qemu for hax is ready. Same for supporting MacOS in hax. These were ready at the time of my last post in this issue. They depend on some other patches in qemu and hax, which are not yet accepted. When these are accepted and merged, I will create a PR for solving this issue which includes ROMD support.

@oliverhbailey
Copy link

oliverhbailey commented Mar 16, 2020 via email

@hyuan3
Copy link
Contributor

hyuan3 commented Mar 17, 2020

HAXM has merged ROMD support. But needs another patch below in Qemu to be accepted. Let me ping Qemu community.
https://lists.sr.ht/~philmd/qemu/patches/6470

@oliverhbailey
Copy link

oliverhbailey commented Mar 17, 2020 via email

@nevilad
Copy link
Contributor

nevilad commented Mar 17, 2020

Approximately how long do you anticipate approval will take?

At best two weeks, but I think it will take longer. How do yo want to test ROMD support? MacOS won't run with the uploaded qemu patch.

@oliverhbailey
Copy link

oliverhbailey commented Mar 17, 2020 via email

@nevilad
Copy link
Contributor

nevilad commented Mar 18, 2020

I've tried to run the patched version but it doesn't run anymore. I worked in the this branch on other features and it seems they affected the result. I don't have time now to debug it, so cant't help you now.

@oliverhbailey
Copy link

oliverhbailey commented Mar 18, 2020 via email

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 14, 2020

Anyway,let's move our attention to the reasons why the vm that I have created with esxi 7 does not work great. I have a lot of problems to fix in my situation and I don't know how. Every time that the windows 10 VM restarts,the nvidia driver stops working because the error 43,the audio device does not work....check these errors :

https://drive.google.com/drive/folders/1Rg9e0F3agJAnoRgEcussqAzxe6HjCTxx?usp=sharing

Actually I'm using these parameters :

hypervisor.cpuid.v0 = FALSE
pciPassthru.use64bitMMIO = "TRUE"
pciPassthru.64bitMMIOSizeGB = "64"
pciPassthru0.msiEnabled = FALSE
pciHole.start = "2048"

Anyway I've just found something that's really interesting. A reddit user gave me important informations about the graphic card that he is using and that's similar to mine :

cS8zAv6

and now check my 2080 ti parameters :

Schermata a 2020-06-14 12-21-42

inside these different parameters there are the reasons why he does not see the error 43 and his audio works correctly. For example,why his bios is UEFI enabled,but mine isn't ?

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 14, 2020

@nevilad
Copy link
Contributor

nevilad commented Jun 15, 2020

DDA script said that it does not support passthrough of all your devices, so windows is not able to dismount them.

It may be not a bug of gigabyte, but missing functionality, that hyper-v requires. Some BIOS functions, that it requires, but other hypervisors not. If you are able to get the exact functions, which hyper-v/DDA script uses/checks, you can ask gigabyte if they support these.

@nevilad
Copy link
Contributor

nevilad commented Jun 15, 2020

For example,why his bios is UEFI enabled,but mine isn't ?

Too many differences to say what's exact missing. But it's a good idea to upgrade your GPU BIOS. Ask Nvidia for an update.

@nevilad
Copy link
Contributor

nevilad commented Jun 15, 2020

Every time that the windows 10 VM restarts,the nvidia driver stops working because the error 43

So after installation but before reboot you are able to work with the GPU from VM?

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 15, 2020

when I do the reinstallation of the drivers it works until the next reboot. I could use a script to make an automatic task,that tells to windows to reinstall automatically the nvidia driver as soon as it starts. could be good. but I'm finicky. In addition to this,the audio does not work. And I suspect that I could use an external monitor,when I will be able to fix the error 43. Read at the end of this article 👍

https://www.igorslab.de/community/threads/threadripper-x399-esxi-gpu-passthrough.1637/

it says :

Cosmetics

If you are sure everything works (i.e. you see the windows desktop on the monitor directly connected to the GPU and the core USB-Devices work as well) & still works after rebooting the VM, feel free to disable the vmware virtual gpu in the advanced settings, i.e. svga.present = FALSE. In case something goes wrong with your passthrough-GPU, you need to set the parameter to "TRUE" again.

does not seem that an external monitor could be used ?

@Marietto2008
Copy link
Author

This sounds interesting. I have installed an old version of the microsoft driver for the RTX 2080 ti and it seems to work better.

Schermata a 2020-06-15 14-42-38

I have installed the nvidia control panel because I wanted to change the primary graphic card,from the vmware svga to the rtx,but it says :

actually I'm not using a monitor attached to the nvidia GPU.

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 15, 2020

no way. both the screens are tied to the vmware display adapter even if I have another monitor and graphic card. If I disable it from the beginning from the esxi options,the screen will be white.

Schermata a 2020-06-15 14-47-02
Schermata a 2020-06-15 14-46-23

@nevilad
Copy link
Contributor

nevilad commented Jun 15, 2020

does not seem that an external monitor could be used ?

The monitor connected to GPU? He writes that it should work.

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 15, 2020 via email

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 15, 2020

do u remember the old connectivity problem with WSL 2 ? maybe the fix arrived...this could fix that :

https://github.com/aaronlks/wsl2-19041-fixDNS/blob/master/fixdns.sh

so,now could be nice to see if esxi get the proper ip address inside WSL2 :P

@nevilad
Copy link
Contributor

nevilad commented Jun 15, 2020

This is about DNS. Under WSL you was unable to ping by IP and didn't used names.
Proper addresses are managed by DHCP.

@Marietto2008
Copy link
Author

I've reinstalled windows 10. This time from an ISO image and it will create a virtual installation. Before I was using the physical installation of Windows 10 that I usually use everydays. it does not work....check the image below.

https://drive.google.com/file/d/1GmoFu3Ro7YHOdh_s_cgi3dCBAXib6bnF/view?usp=sharing

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 16, 2020

I've virtualized xen on top of qemu / kvm and It seems that the graphic card is seen by the client and can be used on a guest vm. isn't cool ?

Schermata a 2020-06-17 01-38-55

Schermata a 2020-06-17 01-39-17

@Marietto2008
Copy link
Author

@nevilad : are u alive ?

@nevilad
Copy link
Contributor

nevilad commented Jun 18, 2020

Yep.

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 18, 2020 via email

@nevilad
Copy link
Contributor

nevilad commented Jun 18, 2020

I've never worked with xen.

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 18, 2020 via email

@nevilad
Copy link
Contributor

nevilad commented Jun 18, 2020

I'm not interested in xen, but can answer some questions. Hypervisors are similar.

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 18, 2020

why you aren't interested ? it seems the perfect product for the virtualization. if it works,it should generate interest. Right now I have installed xen orchestra (similar to the vsphere client),using this tutorial :

https://openschoolsolutions.org/how-to-install-xen-orchestra-with-all-features-and-update-it/

it says that I can install all the features of the professional versions,but I tried and I found that its not true. or it is not true anymore. Now I'm trying to understand how to create a virtual machine using the physical installation of windows 10.

@Marietto2008
Copy link
Author

Let's come back to esxi. there is a new hope that it works like it should,thanks to the help of another reddit user,who says :

It took me a while to get back to my system, but here's the information.

You do need to have the VMWare video driver enabled, so do reinstall VMWare tools, but you can disable the VMWare display later. The VMWare driver does NOT interfere with the NVIDIA driver. I have both installed, and each handles its own monitor. However, be aware that the VMWare display will be blank if the NVIDIA driver is functioning (You won't be able to manage it through ESXi VM console, so you need a remote access software like parsec or remote utilities installed).

I did NOT mess with the 64bit mmio settings.

I did change the following

hypervisor.cpuid.v0 FALSE

pciPassthru0.msiEnabled FALSE

pciHole.start 2048

pciHole.dynStart 3072

I also edited /etc/vmware/passthru.map

and added

NVIDIA

10de ffff d3d0 false

Those are the only changes I made.

I DO NOT pass through the NVIDIA High Definition Audio device, JUST the video because I have seen issues with NVIDIA HDA and I don't need it since I use a cheap USB sound card.

I have had this configuration for years and have never had issues with driver problems (barring some bad driver update that was quickly fixed). After I found the "magic sauce" I just left it alone and never had any more problems. I'm currently running one of my VMs as a gaming system with a 4k monitor as well as a secondary 1080p.

For the sake of testing, I would remove all the customizations you already made, and try these options to see whether they will work for you.

After the NVIDIA driver is working, you will see a small "monitor" in display settings that is the VMWare device. Just disable it. If there is some crash with the NVIDIA driver then it will re-activate the VMWare monitor and control, which you can then access through ESXi's VM console.

Since I am also passing through a USB device with keyboard and mouse, and gaming performance is important to me, I also set the latency sensitivity to high.

@Marietto2008
Copy link
Author

it didn't work. I asked more help from him and he asked me a lot of money,so I let it go.

@Marietto2008
Copy link
Author

the gpu passthrough is coming into wsl 2 👍

https://ubuntu.com/blog/new-gpu-and-gui-features-announced-for-wsl-at-build

@Marietto2008
Copy link
Author

Marietto2008 commented Jun 22, 2020 via email

@Marietto2008
Copy link
Author

why u don't reply anymore ? there are big changes in the WSL platform.

@nevilad
Copy link
Contributor

nevilad commented Jun 23, 2020

Startergo has experience in WSL and answers your questions. I'm watching.

@jhay06
Copy link

jhay06 commented Dec 19, 2022

any news with OVMF support + haxm ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

11 participants