Jump to content
Leoyzen

** Hackintosh ** Tips to make a bare metal MacOS

669 posts in this topic Last Reply

Recommended Posts

Can you try to delete these 2 lines in your xml when using cpu host?

    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>

 

Share this post


Link to post
Posted (edited)

Tried both. 
Still the Same Problem.

Is there a way that i provide you more Information?


What is the best way to Mount the EFI Partition to copy the opencore Stuff?

 

I do not know if it is allowed but for me it would be also fine if i Pay you and you connect over Teamviewer or AnyDesk to my PC to try it out by yourself?

 

The Mac VM is fresh so you can delete it and recreate it.

 

 

 

Edited by Daniel Ehrhardt

Share this post


Link to post
1 hour ago, Daniel Ehrhardt said:

Is there a way that i provide you more Information?

Yes, we need to know why it hangs, you should provide clover or opencore log file.

Share this post


Link to post
18 hours ago, ghost82 said:

 

Create a qcow2 image of 256 MB (from Unraid terminal):


qemu-img create -f qcow2 /path/to/the/image/test.qcow2 256M

This will create a qcow2 image of 256 MB.

 

Enable NBD on the host and connect the qcow2 image as a network block device (from Unraid terminal):


modprobe nbd max_part=8
qemu-nbd --connect=/dev/nbd0 /path/to/the/image/test.qcow2

 

Create EFI partition and format:

Create GPT (from Unraid terminal):


gdisk
/dev/nbd0
w
y

Create EFI partition (from Unraid terminal):


gdisk
/dev/nbd0
n
1
<press Enter to accept default value>
<press Enter to accept default value>
EF00
w

Format the EFI partition as FAT32 (from Unraid terminal):


mkfs.fat -F 32 /dev/nbd0p1

Create a folder for the mount point (advise is to create a folder in your shares, so you can write files into the EFI partition from your vm too):


mkdir /path/to/the/mount/point/

Mount the EFI partition (from Unraid terminal):


mount /dev/nbd0p1 /path/to/the/mount/point/

Copy your EFI files in /path/to/the/mount/point/

 

Unmount the EFI partition (from Unraid terminal):


umount /path/to/the/mount/point/

Disconnect nbd0 (from Unraid terminal):


qemu-nbd --disconnect /dev/nbd0
rmmod nbd

Rename the EFI partition from "NO NAME" to "EFI"

From the virtual machine you can mount the new EFI partition and rename it with the command:


sudo diskutil rename /dev/disk0s1 "EFI"

where disk0s1 is the EFI partition.

 

In the vm xml point to the qcow2 image and add <boot order='1'/>

Ok i followed this guide but I get a constant boot loop showing the OVMF bios then black reboot. Never shows the opencore interface.

 

Only part I didn't do is this... since I don't have a vm up yet.

 

"Rename the EFI partition from "NO NAME" to "EFI"

From the virtual machine you can mount the new EFI partition and rename it with the command:

sudo diskutil rename /dev/disk0s1 "EFI"

where disk0s1 is the EFI partition."

 

Any ideas?

Share this post


Link to post
Posted (edited)
6 hours ago, Carbongrip said:

Any ideas?

Hi, renaming the efi is optional, so it doesn't affect functionality.

I tried the whole process before writing it and it works good for me.

I also tried to do the whole process through the unraid terminal (user root), including copying the EFI files to the mounted partition, to see if there were issues with permissions, and the EFI is fully functional.

What about the "OVMF bios screen"? Are you sure is the OVMF one and not the opencore one?Can you attach a picture?

Attach also you vm xml and the zipped qcow2 image you are using.

Edited by ghost82

Share this post


Link to post

I was analyzing all the qcow2 (clover and opencore) images that are around: all these images have 2 partitions: p1, the EFI System, and p2, a Linux filesystem partition; inside p1 there are all the files needed to boot, inside p2 there's an empty folder named "ESP". As far as I know ESP is a synonym of EFI and it is a non sense to have ESP in a linux filesystem partition..

When I create the qcow2 image I just only create one disk with one partition, the EFI System one, and all works as expected, and I don't think the Linux filesystem is required...Is it simply an "error" made by the first one who created the qcow2 image and the others have always modified and shared this first image or do I miss something?

 

qcow2 images downloaded around:
1.png.2d8c7a17989328dfa91b72c3b066b0fe.png

My qcow2 image:

2.png.1e0153f2474af7a02f4b1ced24c093d3.png

Share this post


Link to post
17 hours ago, ghost82 said:

Hi, renaming the efi is optional, so it doesn't affect functionality.

I tried the whole process before writing it and it works good for me.

I also tried to do the whole process through the unraid terminal (user root), including copying the EFI files to the mounted partition, to see if there were issues with permissions, and the EFI is fully functional.

What about the "OVMF bios screen"? Are you sure is the OVMF one and not the opencore one?Can you attach a picture?

Attach also you vm xml and the zipped qcow2 image you are using.

Here is the EFI that I made but doesn't work causing a constant boot loop showing the Tiano Core Bios Screen...

OpenCoreEFI.zip

 

Now here is where things get interesting...

I found this post https://www.nicksherlock.com/2020/04/installing-macos-catalina-on-proxmox-with-opencore/

and used his OpenCore efi file and it actually works, allowing me to select boot of install media. His is a .iso though. It also doesn't really help because its kernal panics while loading the installer in verbose mode and I don't know how to change the files in it besides turning on verbose mode from shell.

 

Will post a xml when I can.

Share this post


Link to post
Posted (edited)
7 hours ago, Carbongrip said:

Here is the EFI that I made but doesn't work causing a constant boot loop showing the Tiano Core Bios Screen...

Try the attached one, I changed some things in the config.plist.

Take into account that it boots with Target=83, for debug purposes, once it boots change from Target 83 to Target 0.

Target 83 means that the bootloader logs all into a file in the root of the EFI partition.

OpenCoreEFI.qcow2.zip

Edited by ghost82

Share this post


Link to post
On 4/22/2020 at 9:48 PM, ghost82 said:

Anyone ever tried to passthrough the DVD/CD/BlueRay (writer) drive to mac os?

Maybe we first need to choose a smbios such that the original SystemProductName is equipped with an optical drive..I doubt it is going to work with a sata blueray/dvd writer if the original iMacPro1,1 has no optical drive..In this case, a sata to usb adapter could work..

Share this post


Link to post

guys i need some help setting up high sierra vm on my server. i did the installation using macinabox then replaced clover files with opencore files i downloaded from @Leoyzen repo and set my xml using his guide. now after installing nvidia web drivers the only two things are that are still not working are usb and audio. not even hdmi audio is not being detected, even though i have set the audio in same bus and slot and ofcourse different function still no audio and as for usb, if use those ports which are being pass through then they work but they so slow that i have to litteraly hold the key for more than a second before it register any key press and mouse cursor just jumps here and their but if i use usb hotplug plugin they work flawlessly ( which is weird or maybe not maybe they work diffrently IDK).

<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>MacinaboxHighSierra</name>
  <uuid>9af554f4-f63a-40ad-b744-394a0ca0cb2e</uuid>
  <description>MacOS High Sierra</description>
  <metadata>
    <vmtemplate xmlns="unraid" name="MacOS" icon="/mnt/user/domains/MacinaboxHighSierra/icon/highsierra.png" os="HighSierra"/>
  </metadata>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='5'/>
    <vcpupin vcpu='2' cpuset='3'/>
    <vcpupin vcpu='3' cpuset='7'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
    <loader readonly='yes' type='pflash'>/mnt/user/domains/MacinaboxHighSierra/ovmf/OVMF_CODE.fd</loader>
    <nvram>/mnt/user/domains/MacinaboxHighSierra/ovmf/OVMF_VARS.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='1' cores='2' threads='2'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='writeback'/>
      <source file='/mnt/user/domains/MacinaboxHighSierra/Clover.qcow2'/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/MacinaboxHighSierra/HighSierra-install.img'/>
      <target dev='hdd' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='3'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/user/domains/MacinaboxHighSierra/macos_disk.img'/>
      <target dev='hde' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='4'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='pci' index='6' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='6' port='0x15'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/>
    </controller>
    <controller type='pci' index='7' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='7' port='0x16'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:5a:ad:8f'/>
      <source bridge='br0'/>
      <model type='vmxnet3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <rom file='/mnt/user/isos/vbios/Zotac.GTX1070Ti.8192.171016_1.rom'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' multifunction='on'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1d' function='0x0'/>
      </source>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </hostdev>
    <memballoon model='none'/>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='host,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2'/>
  </qemu:commandline>
</domain>

if anyone knows how to fix this then please help i would really appreciate ur help.

Share this post


Link to post
11 hours ago, Max said:

now after installing nvidia web drivers the only two things are that are still not working are usb and audio. not even hdmi audio is not being detected, even though i have set the audio in same bus and slot and ofcourse different function still no audio and as for usb, if use those ports which are being pass through then they work but they so slow that i have to litteraly hold the key for more than a second before it register any key press and mouse cursor just jumps here and their but if i use usb hotplug plugin they work flawlessly

Pascal gpus may not work properly, you need to try different ports and see if audio is working; some users reported both dp and hdmi must be connected, some users reported that only dp audio is working. Save a ioreg with io registry explorer and attach here, so we can see for the ioreg tree and if kexts are attached properly; a copy of the efi folder should help too, so attach it.

As far as usb, yes they work different: if you passthrough the whole pci mac sees the real chipset, and you can have problems, I spent days to try a working asmedia controller without luch, finally I bought a inateck card for less than 20 euros and it just worked.

If you pass usb ports through unraid you are using ehci and/or uhci which work in a different way, and these work.

Share this post


Link to post
1 hour ago, ghost82 said:

Pascal gpus may not work properly, you need to try different ports and see if audio is working; some users reported both dp and hdmi must be connected, some users reported that only dp audio is working. Save a ioreg with io registry explorer and attach here, so we can see for the ioreg tree and if kexts are attached properly; a copy of the efi folder should help too, so attach it.

As far as usb, yes they work different: if you passthrough the whole pci mac sees the real chipset, and you can have problems, I spent days to try a working asmedia controller without luch, finally I bought a inateck card for less than 20 euros and it just worked.

If you pass usb ports through unraid you are using ehci and/or uhci which work in a different way, and these work.

okay i have attached my efi folder and ioreg. for audio i cant check other ports now cause first my 1070ti doesn't have any other hdmi port and as display port, i dont have display port cable and right now i cant even go out and get one due lockdown situation here but even onboard audio is not being detected.

and yeah i thought about getting usb card too but the problem is pcie lanes, dont have enough of them and soon i be getting lsi card to attach more hdd's so usb card is not an option for me. so if usb passthough doesn't work then maybe i will just use that plugin but the problem with that plugin is that after passing through my logitech keyboard through that plugin i have restart my vm to make it work, i dont know why that happens or why it actually happens with that keyboard only other usb devices dont require a restart.

EFI.zip ioreg.ioreg

Share this post


Link to post
Posted (edited)
41 minutes ago, Max said:

for audio i cant check other ports now cause first my 1070ti doesn't have any other hdmi port

Can you try the attached AppleALC.kext?It is just a quick test, found a user on another forum with a 1070 reporting that it works for him.

Mount your efi and simply replace AppleALC in opencore.

Restart and test.

41 minutes ago, Max said:

but the problem with that plugin is that after passing through my logitech keyboard through that plugin i have restart my vm to make it work

Are you manually hot-plugging the keyboard/mouse?Why?

Just try what I did for my keyboard/mouse dongle: edit vm in xml mode and paste the proper code for usb passthrough and save; this will be persistent, so your keyboard will be attached to the vm automatically.

Ex, my code:
 

    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x0745'/>
        <address bus='1' device='3'/>
      </source>
      <alias name='hostdev4'/>
      <address type='usb' bus='0' port='1'/>
    </hostdev>

For the proper code, just hotplug the usb in "normal mode", then switch to xml, cut and paste and save, and the change will be persistent.

AppleALC.kext.zip

Edited by ghost82

Share this post


Link to post
45 minutes ago, Max said:

but even onboard audio is not being detected

Did you try different layouts for appleALC?

Share this post


Link to post
1 hour ago, ghost82 said:

Can you try the attached AppleALC.kext?It is just a quick test, found a user on another forum with a 1070 reporting that it works for him.

Mount your efi and simply replace AppleALC in opencore.

Restart and test.

nah that didnt work.

 

1 hour ago, ghost82 said:

Are you manually hot-plugging the keyboard/mouse?Why?

Just try what I did for my keyboard/mouse dongle: edit vm in xml mode and paste the proper code for usb passthrough and save; this will be persistent, so your keyboard will be attached to the vm automatically.

Ex, my code:
 


    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x0745'/>
        <address bus='1' device='3'/>
      </source>
      <alias name='hostdev4'/>
      <address type='usb' bus='0' port='1'/>
    </hostdev>

 

yeah i was manually hot-plugging, why you ask, cause im an idiot. i dont know why didn't think of that 😅

1 hour ago, ghost82 said:

Did you try different layouts for appleALC?

so after your suggestion i tried booting with alcid=1 and that worked, now onboard audio is working, now i only have figure out how to make it permanent. i mean without using it as boot arg.

and one problem that i just noticed is that upload speed that im getting are really pathetic i have connection of 100 up and down, but im only getting 1-2 Mbps get up down is fine, down im getting proper 100.

Share this post


Link to post

You are probably using the vmxnet3 for the Ethernet bridge, don't use that. Use e1000-82545em instead, make the change in your xml. vmxnet3 makes the upload real slow for whatever reason.

Share this post


Link to post
Posted (edited)
57 minutes ago, Max said:

so after your suggestion i tried booting with alcid=1 and that worked, now onboard audio is working, now i only have figure out how to make it permanent. i mean without using it as boot arg.

If you don't want to use the boot arg inject the layout-id property in the opencore config.plist.

Here is an example, injecting layout-id = 1:

	<key>DeviceProperties</key>
	<dict>
		<key>Add</key>
		<dict>
			<key>PciRoot(0x1)/Pci(0x2,0x0)</key>
			<dict>
				<key>layout-id</key>
				<data>AQAAAA==</data>
			</dict>
		</dict>

Note the address PciRoot...

Download gfxutil and run it to find your HDEF address:

./gfxutil -f HDEF

Replace with your address.

 

Otherwise, in the config.plist add the boot argument:

			<key>7C436110-AB2A-4BBB-A880-FE41995C9F82</key>
			<dict>
...
...
				<key>boot-args</key>
				<string>alcid=1</string>
...
...
			</dict>

If you have multiple boot args just separate with a space, ex:
 

<string>keepsyms=1 alcid=1</string>

 

NOTE: Leoyzen's config.plist lacks the add device section for onboard audio, obviously, because that changes for each configuration, he included the appleALC kext, but you need to inject your own properties to make HDEF working.

Edited by ghost82

Share this post


Link to post
15 minutes ago, david279 said:

You are probably using the vmxnet3 for the Ethernet bridge, don't use that. Use e1000-82545em instead, make the change in your xml. vmxnet3 makes the upload real slow for whatever reason.

yeah that worked, i knew vmxnet3 has bad upload speed problem but never expected it to be that bad.

Share this post


Link to post
4 minutes ago, ghost82 said:

If you don't want to use the boot arg inject the layout-id property in the opencore config.plist.

Here is an example:


	<key>DeviceProperties</key>
	<dict>
		<key>Add</key>
		<dict>
			<key>PciRoot(0x1)/Pci(0x2,0x0)</key>
			<dict>
				<key>layout-id</key>
				<data>AQAAAA==</data>
			</dict>
		</dict>

Note the address PciRoot...

Download gfxutil and run it to find your HDEF address:


./gfxutil -f HDEF

Replace with your address.

yeah already figured that out through dortania opencore guide but didn't quite understand the data part. it says value is in hex/data, dont know what to do with that.

Share this post


Link to post
1 minute ago, Max said:

it says value is in hex/data, dont know what to do with that.

Use a base64 to decimal converter; by the way, if you say that layout 1 is working just copy paste my example AQAAAA== corresponds to layout 1.

Share this post


Link to post
Posted (edited)
45 minutes ago, ghost82 said:

Use a base64 to decimal converter; by the way, if you say that layout 1 is working just copy paste my example AQAAAA== corresponds to layout 1.

ohh thanks. that worked. now only have to figure out usb controller passthrough. dont really care about hdmi audio as long as onboard audio is working.

 

Edited by Max

Share this post


Link to post

has anyone ever been able to make his onboard usb controller work with macos vm. cause i neved had to do anything to make my usb ports work when i used to use this machine as bare metal hackintosh and as far as i know all use a usb card or use hotplug plugin to use usb with macos here.

Share this post


Link to post

I've been using a onboard USB controller on my x370 board since I got it, passed through on all my VMs with a GPU. It's in its own group and is plug and play. 

Share this post


Link to post
23 minutes ago, david279 said:

I've been using a onboard USB controller on my x370 board since I got it, passed through on all my VMs with a GPU. It's in its own group and is plug and play. 

did it work oob or u used some special kext or ssdt of some kind to make it work.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.