acidanthera / bugtracker

Acidanthera Bugtracker
374 stars 42 forks source link

How actually to use MacHyperVSupport without proper guide? #2179

Closed ANONIMNIQ closed 1 year ago

ANONIMNIQ commented 1 year ago

Can someone use this? I don't really understand how to create macos vm for hyper-v. I can download installer.dmg ... then I need to create VHDX image from it, but how to do this from Windows? Also, how to attach OpenCore to the VM and where exctly to use MacHyperVSupport.kext? To put it in OpenCore and crete new cofig.plist maybe?

pigworlds commented 1 year ago

It is pretty simple to use MacHyperVSupport.kext under Hyper-V.

Prerequisites: Prepare the EFI folder and config.plist.

Create the boot VHDX

Prepare installer or recovery VHDX. (Only need to pick one)

Install macOS

You should have macOS running under Hyper-V now. Hope this helps.

Many thanks to the acidanthera team for making this happen.

ANONIMNIQ commented 1 year ago

Thank you! I'll tried it! btw is it possible to use some sort of gpu passthrough / GPU Partitioning to macos hyper-v vm?

ANONIMNIQ commented 1 year ago

@pigworlds can you share your EFI folder, I tried to make it but opencore can't show installer.

pigworlds commented 1 year ago

Have you put both recovery files under com.apple.recovery.boot folder? You can take a look at my config.plist. It adds MacHyperVSupport.kext and some cosmetic fixes.

ANONIMNIQ commented 1 year ago

@pigworlds I don't put recovery, I only convert installer.dmg to installer.vhdx and attached it to VM. With you config.plist it detects one hdd called NEW VOLUME in opencore and tried to boot from it but only shows black screen after that. I'm not sure if that's installer hdd or empty hdd for the vm. I tried with nother opencore version, but now can't see any hdd, only uefi shell.

aguys123 commented 1 year ago

Sorry for OOT, @ANONIMNIQ.

@pigworlds I've successfully installed Mountain Lion in Hyper-V, thanks to your config (which I configured a little bit for older macos). Now, how to use hvfilecopyd, hvshutdownd, and hvtimesyncd daemons? Should I put it in /Library/LaunchDaemon?

ANONIMNIQ commented 1 year ago

I make a little progress but it stuck on boot: https://ibb.co/tKwF3w0 https://ibb.co/4mxgRJb

mahfoudfx commented 1 year ago

Thanks @pigworlds for your help. Even if I carefully followed the documentation of OpenCore, I still unable to boot and struggling in OpenShell.efi boot. I have a bunch of unclear points for which I didn't find no answer since several weeks, for example:

  1. If I want to Install Monterey or Ventura, do I need only MacHyperVSupportMonterey.kext or to combine it with MacHyperVSupport.kext.
  2. How to use the binaries: hvfilecopyd, hvshutdowndand hvtimesyncdmentioned in the beginning of the documentation of the MacHyperVSupport and that can be found under the Tools folder of the package.
  3. Do we need to customize the config.plist according the used platform (CPU, SMBIOS) or as Virtual Environment it is not concerned.
  4. The Installer Image creation is it based on the downloaded BaseSystem.dmg Downloading macOS or another file? If I use the mentioned command qemu-img convert -f raw -O vhdx Installer.dmg Installer.vhdx I get an BaseSystem.img inside the .vhdx file, if I use it without the -f raw, it .vhdx containing macOS Base System partition but this will cause a failure to start the VM, maybe because the HFS file system is not recognized.
  5. I see in your config.plist example the include of HFSPlus.efi, which is not included by default in OpenCore, is it mandatory?
  6. How and where Boot arguments are configured?

If you can share the EFI folder, or write a proper guide for Hyper-V it will be very helpful.

murkomarko commented 1 year ago

does this still works?

pidimensions commented 1 year ago

I have done this successfully. Attached are the files for anyone wanting to do this EFI Folder

Many thanks to @pigworlds for sharing the config.plist

Maleficent-Magik commented 1 year ago

Are you really sure it works? Because it doesn't. @pidimensions Once past the openCore boot, we have a forbidden sign after selecting the DMG...

(also, if you add -v for verbose, the DMG don't start)

pidimensions commented 1 year ago

Hm, it worked for me. I'll take a look and try it again Video proof that it works

zeanzhou commented 1 year ago

I got the forbidden sign as well, but it turns out that I allocate too few memory to MacOS..

More background:

Hope it helps.

Maleficent-Magik commented 1 year ago

I got the forbidden sign as well, but it turns out that I allocate too few memory to MacOS..

4096MB - Doesn't work 8192MB - It works, installation continues.

Mmh, I'm interested, I've actually also put 4GB of RAM, I'll test with 8, thanks for the help! @zeanzhou

cmd430 commented 1 year ago

mine gets the the apple logo but never progresses past that (no progress bar, just black screen with apple logo)

pidimensions commented 1 year ago

How much RAM is allocated to the VM @cmd430 ? And did you use my EFI/prebuilt VM

cmd430 commented 1 year ago

How much RAM is allocated to the VM @cmd430 ? And did you use my EFI/prebuilt VM

16GB, using your prebuilt VM, I am however using an AMD CPU in this PC, so that could be the issue

pidimensions commented 1 year ago

Ah probably. I'll take a look at how to fix it for AMD CPUs. You will probably have to edit the EFI

cmd430 commented 1 year ago

If you get it working (or need someone to help test) it would be much appreciated if you would also be able to link the vhdx with the changes that would also be nice unless you have a solution to edit the EFI under windows (or WSL) (as the current vhdx wont let me mount under windows i assume from the DMG conversion)

pidimensions commented 1 year ago

Okay, I will work on trying to fix it, also in order to edit it, you must first double-click on it, then open disk manager, then scroll down to find it. It should be called "Install" or "Opencore," and it should be 1 GB. Then right click and either mount as a letter or in a folder.

cmd430 commented 1 year ago

ah i brain farted, never actually checked in Disk Manager after attempting to mount....

I did notice however that OpenCore claims to support AMD CPUs

CPU Support [...] Ryzen (17h) CPUs

I am using 5600x (zen 3/19h) so maybe this will be useful information, maybe its not possible but hopefully its something relatively easy to get working

pidimensions commented 1 year ago

Okay, what model is your CPU and how many cores does it have? I can help with kernel patching which is needed Edit: the amount of cores that the VM will have allocated, must be 4, 6, 8, 12, 16, 24, 32

cmd430 commented 1 year ago

Okay, what model is your CPU and how many cores does it have? I can help with kernel patching which is needed Edit: the amount of cores that the VM will have allocated, must be 4, 6, 8, 12, 16, 24, 32

Fixed my last message formatting, I have a Ryzen 5 5600X, it is a 6 core CPU (12 Threads)

pidimensions commented 1 year ago

Okay do you plan to allocate all of the cores to the VM?

cmd430 commented 1 year ago

No was planning on allocating 4

pidimensions commented 1 year ago

Ok I'll change the config.plist based on that and post another version with google drive link https://dortania.github.io/OpenCore-Install-Guide/AMD/zen.html#acpi

cmd430 commented 1 year ago

I have to head off for now but I enabled verbose boot and can see a couple errors i have attached a screenshot of the output in case it helps at all

image

pidimensions commented 1 year ago

Deleted to avoid failed attempts

pidimensions commented 1 year ago

I am still without a way to correct the abysmal graphics + resolution. I think the issue for the graphics is that the VM is being connected to with VNC or something like that which is slow. The resolution is an issue because it's not like you can go into the VM firmware settings with Hyper-V (at least to my knowledge) like you can with KVM.

aguys123 commented 1 year ago

According to Goldfish64 :

AMD is currently completely unsupported and requires additional patches beyond the standard AMD macOS patches.

https://github.com/acidanthera/bugtracker/issues/2120#issuecomment-1250372560

pidimensions commented 1 year ago

Ok I stand corrected maybe its not possible Well it's worth it for @cmd430 to at least give it a try That is very unfortunate though

cmd430 commented 1 year ago

Confirmed still unable to load the installer, was worth a shot

pidimensions commented 1 year ago

Ah damn that's unfortunate

TaylorTWBrown commented 1 year ago

I have done this successfully. Attached are the files for anyone wanting to do this Hyper-V VM EFI Folder

Many thanks to @pigworlds for sharing the config.plist

Thank you for sharing this! I imported the VM and unfortunately it just hangs on the Apple logo.

I'm running an Intel i9-12900K.

image

pidimensions commented 1 year ago

There have been many issues with RAM allocation, how much did you give to the VM? 8 GB and 16 GB are good, anything else might cause boot issues

TaylorTWBrown commented 1 year ago

I used 16000 MB, the same that's set in the VM. 8000, 8192, and 16384 seem to yield the same result. I've also tried 4, 8, 16 cores.

Could it have to do with Windows 11 and the Hypervisor scheduler, or the performance/efficiency cores of the 12th gen CPU?

Maybe I'll try the VM on my older Xeon E5v4 server

pidimensions commented 1 year ago

Ah damn I don't know then, okay yeah maybe the other computer will be better

TaylorTWBrown commented 1 year ago

I just tried it on a server I have running. Windows Server 2022, Xeon E5 2680 v4.

I get the same issue. The one thing that my desktop and server have in common, is that they're both running the latest version of Windows. If you're running Windows 10 or Server 2016, maybe something is substantially different.

I'm curious: @pidimensions If you download and import the VM that you uploaded, does it 'just work' for you? What version of Windows are you running, and what's your CPU?

pidimensions commented 1 year ago

I'm running Windows 10 with i7-6700k

pidimensions commented 1 year ago

And it does work as shown here video

TaylorTWBrown commented 1 year ago

There might be some bigger hypervisor differences with Windows 10. I'll report back soon, hopefully.

pidimensions commented 1 year ago

Okay, I'd be interested to know if its different on different versions of Windows

aguys123 commented 1 year ago

I get the same issue. The one thing that my desktop and server have in common, is that they're both running the latest version of Windows. If you're running Windows 10 or Server 2016, maybe something is substantially different.

I'm on Windows 11 hyper-v and successfully installed Mountain Lion and High Sierra with only 4GB of RAM allocated (on Acer laptop, i7-8550U proc, 16GB RAM). Maybe you can try spoofing the CPU.

pigworlds commented 1 year ago

I have done this successfully. Attached are the files for anyone wanting to do this Hyper-V VM EFI Folder Many thanks to @pigworlds for sharing the config.plist

Thank you for sharing this! I imported the VM and unfortunately it just hangs on the Apple logo.

I'm running an Intel i9-12900K.

image

I got success with some newer Intel CPU using CPUID spoofing. You can give a try to modify this section in the config.plist

        <key>Emulate</key>
        <dict>
            <key>Cpuid1Data</key>
            <data>6gYJAAAAAAAAAAAAAAAAAA==</data>
            <key>Cpuid1Mask</key>
            <data>/////wAAAAAAAAAAAAAAAA==</data>
TaylorTWBrown commented 1 year ago
      <key>Emulate</key>
      <dict>
          <key>Cpuid1Data</key>
          <data>6gYJAAAAAAAAAAAAAAAAAA==</data>
          <key>Cpuid1Mask</key>
          <data>/////wAAAAAAAAAAAAAAAA==</data>

Thank you! That's all I needed to get booted. I'll finish my install tomorrow, and happily share my progress and any relevant files.

pidimensions commented 1 year ago

Interesting, should I add that change into the Google Drive link VM? Or is it CPU-specific?

aguys123 commented 1 year ago

Interesting, should I add that change into the Google Drive link VM? Or is it CPU-specific?

I think it's host CPU related since I cannot boot Mountain Lion VM without spoofing CPU to Ivy Bridge and I can boot High Sierra VM without spoofing (Kabylake supported by HS).

zeanzhou commented 1 year ago

Hello all, I am trying to activate iMessage on this VM, but the iMessage App just logged me out a couple of seconds after logging in. When I run the iMessage App from terminal, I can see the customer code error being printed out in the terminal, the message is the same as the one in this guide https://dortania.github.io/OpenCore-Post-Install/universal/iservices.html .

Before calling Apple, I was still trying to troubleshoot this error, and I did go through every single step in the above guide. However, when I followed What if I don't have En0 at all?!? step, even after applying NullEthernet.kext, I still got an empty list in Hackintool as below. hackintool

Note that my network is working. I can see en0 and a fake en1 after applying NullEthernet.kext via ifconfig.

And when I switched to PCIe Tab in Hackintool, it only shows 1 device as below. But the same screenshot in the guide contains a long list of PCI devices, which makes me feel something is wrong with my hyper-v configuration. hackintool2

Background:

Could someone help to confirm this is the right behavior? Are you also seeing an empty list there using Hackintool, and 1 device only in PCIe Tab? Are you able to make iMessage work with Hyper-V?

Not sure whether this is the right place to ask this question, let me know if there is a better place!

pidimensions commented 1 year ago

Yeah I am experiencing the same thing with no Ethernet Peripherals in the System > Peripherals but an ethernet PCIe device

I don't know how to fix it sorry

TaylorTWBrown commented 1 year ago

@zeanzhou from the screenshot, I see you have Bluetooth in the VM. How did you passthrough the Bluetooth adapter, and what hardware are you using?