Jump to content

Insanely fast virtual Mac (QEMU, OVMF, Clover and native graphics)


514 posts in this topic

Recommended Posts

I had this same issue.  To solve it, I downloaded the source for the latest version of clover, manually edited the source files to include dreadkopp's changes and built the clover installer.  I hesitate to post my built binary installer, since no-one should trust a binary from an Internet random.

 

I used this tool to download and build clover:

 

https://github.com/JrCs/CloverGrowerPro

 

That tool will download and build clover without stopping to let you apply the source changes.  After CloverGrowerPro downloaded built the latest vanilla clover, I had to modify its shell scripts slightly to make it stop and let me apply changes before rebuilding.

 

The dreadkopp's source changes can be found here:

 

https://sourceforge.net/p/cloverefiboot/tickets/255/

 

He makes a number of revisions in his comments, but essentially, I used the following comment in that ticket:

 

https://sourceforge.net/p/cloverefiboot/tickets/255/#16e1

 

I did this weeks ago and didn't take notes.  If you need more details, I can maybe recreate my process this weekend.

 

 

Hello I have tested your patched Clover on 10.11 and 10.12. They both seems to run at the correct speed for me. Host is Proxmox 4.3. 

However the Clover that you have patched is older then r3751. 

 

I need r3751+ to enable Nvidia Web Driver in Serria. Can you provide a patcher version of the newest clover? Or can you provide instructions so i can patch clover? Thanks!

  • Like 1
Link to comment
Share on other sites

Great info! I'll try to patch / build clover. I'll post back with results.

 

EDIT:

 

I tried to patch Clover using the info that was provided on the ticket. Unfortunately it's failing to compile after I add the changes. 1 of two things are happening I think. 

 

1. The code is all formatted weird on the ticket so it may be missing something I need. 

or

2. Clover code has changed enough sense he submitted this ticket that it no longer works with the current code base.

 

Whatever the case I'm stuck for now. I hope someone else can help.
 

I had this same issue.  To solve it, I downloaded the source for the latest version of clover, manually edited the source files to include dreadkopp's changes and built the clover installer.  I hesitate to post my built binary installer, since no-one should trust a binary from an Internet random.
 
I used this tool to download and build clover:
 
https://github.com/JrCs/CloverGrowerPro
 
That tool will download and build clover without stopping to let you apply the source changes.  After CloverGrowerPro downloaded built the latest vanilla clover, I had to modify its shell scripts slightly to make it stop and let me apply changes before rebuilding.
 
The dreadkopp's source changes can be found here:
 
https://sourceforge.net/p/cloverefiboot/tickets/255/
 
He makes a number of revisions in his comments, but essentially, I used the following comment in that ticket:
 
https://sourceforge.net/p/cloverefiboot/tickets/255/#16e1
 
I did this weeks ago and didn't take notes.  If you need more details, I can maybe recreate my process this weekend.

Link to comment
Share on other sites

I found a script that build clover automatically. But need to put in a pause in the script so we can modify the patch before creating the installer. Would that line be before echo "building GCC";

 

I don't follow how to add the patches :-( anyone that can add what to change and where in the files. :-)

 

http://osxarena.com/2015/03/compiling-installing-clover-bootloader/

#!/bin/bash
# Script for Clover Compiler Script
# Created by Deepak on v1.0
# Copyright © 2015 Deepak insanelydeepak.wordpress.com. All rights reserved.

echo "--------------------------------------------------------------------------------"
echo "Clover Compiler Script Copyright © 2015 Deepak insanelydeepak.wordpress.com. All rights reserved."
echo "--------------------------------------------------------------------------------"
echo "==============================================="
echo "Start - Clover Compiler Script"
echo "*********************************"
echo "-----------------------------------------------"
echo ""
cd ~;
mkdir src;
cd ~/src/;
echo "=================";
echo "Downloading EDK2";
echo "=================";
svn co svn://svn.code.sf.net/p/edk2/code/trunk/edk2 ~/src/edk2;
cd ~ / src / edk2;
echo "=================";
echo "Downloading Clover";
echo "=================";
svn checkout svn://svn.code.sf.net/p/cloverefiboot/code/ ~/src/edk2/Clover;
echo "=================";
echo "Copy Files";
echo "=================";
cp ~/src/HFSPlus.efi ~/src/edk2/Clover/HFSPlus/Ia32/HFSPlus.efi;
cp ~/src/HFSPlus64.efi ~/src/edk2/Clover/HFSPlus/X64/HFSPlus.efi;
cp ~/src/edk2/Clover/Patches_for_EDK2/Conf/build_rule.txt ~/src/edk2/Conf/;
cp ~/src/edk2/Clover/Patches_for_EDK2/Conf/tools_def.txt ~/src/edk2/Conf/;
cp ~/src/edk2/Clover/Patches_for_EDK2/BaseTools/Source/Python/AutoGen/GenC.py ~/src/edk2/BaseTools/Source/Python/AutoGen;
cp ~/src/edk2/Clover/Patches_for_EDK2/MdePkg/Include/Base.h ~/src/edk2/MdePkg/Include;
echo "=================";
echo "building GCC";
echo "=================";
cd ~/src/edk2/Clover/;
./buildgcc-4.9.sh;
./buildnasm.sh;
./buildgettext.sh;
echo "=================";
echo "building Clover x64";
echo "=================";
cd ~/src/edk2/Clover/;
./ebuild.sh -x64;
echo "=================";
echo "building Clover boot7";
echo "=================";
./ebuild.sh -mc;
echo "=================";
echo "building Clover ia32";
echo "=================";
./ebuild.sh --ia32;
echo "=================";
echo "building CloverPKG";
echo "=================";
cd ~/src/edk2/Clover/CloverPackage/;
./makepkg;
echo "=================";
echo "building CloverISO";
echo "=================";
cd ~/src/edk2/Clover/CloverPackage/;
./makeiso;
echo "==============================================="
echo "END - Clover Compiler Script "
echo "*********************************"
echo "-----------------------------------------------"
echo ""

Link to comment
Share on other sites

I am able to compile clover just fine without the timing fixes. However when I try to patch the timing it will no longer compile. Have you tried compiling vanilla just to make sure your system can get that much done?

 

Hmmm, I get error when running ./buildgcc-4.9.sh on Sierra.

 

//P

Link to comment
Share on other sites

I had some time today to re-create my process and take notes:
 
To do source download and build, follow instructions here:
 
 
I wait for vanilla build to completely finish.  The edk2/Clover build portion is redundant, but I just let it finish for simplicity.  The line numbers below are accurate as of revision 3793.
 
So that we can manually patch Clover, change the empty line 656 of CloverGrowerPro.sh to:
 
exit 
 
I end up with:
 
    fi
    exit
    # Construct EBUILD_COMMAND
    EBUILD_COMMAND=("./ebuild.sh" "-${ebuildToolchainFlag}")
 
Delete the edk2 directory and re-run cloverpro.  This will re-fetch a clean edk2 and clover source and stop before building.  Now we’ll modify clover using dreadkopp’s changes. 
 
Make this change to edk2/Clover/rEFIT_UEFI/refit/main.c:
 
Replace lines 1908-1924 with:
 
DBG("Starting QEMU vCPU workaround...\n");
//fake values for correct calculations
gCPUStructure.MaxRatio = 40;
gCPUStructure.MinRatio = 40;
gCPUStructure.Turbo = 40;
gCPUStructure.Turbo1 = 40;
gCPUStructure.Turbo2 = 40;
gCPUStructure.Turbo3 = 40;
gCPUStructure.Turbo4 = 40;
gCPUStructure.FSBFrequency = gCPUStructure.CPUFrequency / 4;
gCPUStructure.Stepping = 3;
gCPUStructure.Model = 23;
gCPUStructure.Family = 6;
gCPUStructure.Type = 0;
gCPUStructure.Extmodel = 1;
gCPUStructure.ARTFrequency = 0;
gCPUStructure.SubDivider = 0;
//these seem to be constants. need further testing by differnt host machines
gCPUStructure.ExternalClock = 1133825;
gCPUStructure.ProcessorInterconnectSpeed = 2147057130;
gCPUStructure.Signature = 0x010673;
}
 
I ended up with: 
 
if (gSettings.QEMU) {
//    UINT64 Msrflex = 0ULL;
 
    DBG("Starting QEMU vCPU workaround...\n");
    //fake values for correct calculations
    gCPUStructure.MaxRatio = 40;
    gCPUStructure.MinRatio = 40;
    gCPUStructure.Turbo = 40;
    gCPUStructure.Turbo1 = 40;
    gCPUStructure.Turbo2 = 40;
    gCPUStructure.Turbo3 = 40;
    gCPUStructure.Turbo4 = 40;
    gCPUStructure.FSBFrequency = gCPUStructure.CPUFrequency / 4;
    gCPUStructure.Stepping = 3;
    gCPUStructure.Model = 23;
    gCPUStructure.Family = 6;
    gCPUStructure.Type = 0;
    gCPUStructure.Extmodel = 1;
    gCPUStructure.ARTFrequency = 0;
    gCPUStructure.SubDivider = 0;
    //these seem to be constants. need further testing by differnt host machines
    gCPUStructure.ExternalClock = 1133825;
    gCPUStructure.ProcessorInterconnectSpeed = 2147057130;
    gCPUStructure.Signature = 0x010673;
  }
 
Make this change to edk2/Clover/rEFIt_UEFI/Platform/DataHubCpu.c:
 
Insert the following between lines 319 and 320:
 
case CPU_MODEL_PENRYN: //fix for Penryn Qemu vCPU
DBG("Using workaroud for Penryn Qemu vCPU in DataHubCpu.c.\n");
FrontSideBus = gCPUStructure.FSBFrequency;
break;
 
I ended up with:
 
  if (gSettings.QEMU) {
    FrontSideBus = gCPUStructure.TSCFrequency;
    switch (gCPUStructure.Model) {
      case CPU_MODEL_DOTHAN:
      case CPU_MODEL_YONAH:
      case CPU_MODEL_MEROM:
        FrontSideBus = DivU64x32(FrontSideBus, 4);
        break;
      case CPU_MODEL_PENRYN: //fix for Penryn Qemu vCPU
        DBG("Using workaroud for Penryn Qemu vCPU in DataHubCpu.c.\n");
        FrontSideBus = gCPUStructure.FSBFrequency;
        break;
      default:
        break;
    }
    DBG("Using QEMU FrontSideBus=%d\n", FrontSideBus);
  }
 
I ignored dreadkopp’s changes to edk2/Clover/rEFIT_UEFI/refit/menu.c.  I couldn’t figure out where to put it and it seemed to work anyway.
 
Now that we’ve made the source changes, remove the line “exit”, number 656 that we added to CloverGrowerPro.sh above, then run cloverpro to build Clover and make the installer.

 

 

I had this same issue.  To solve it, I downloaded the source for the latest version of clover, manually edited the source files to include dreadkopp's changes and built the clover installer.  I hesitate to post my built binary installer, since no-one should trust a binary from an Internet random.

 

I used this tool to download and build clover:

 

https://github.com/JrCs/CloverGrowerPro

 

That tool will download and build clover without stopping to let you apply the source changes.  After CloverGrowerPro downloaded built the latest vanilla clover, I had to modify its shell scripts slightly to make it stop and let me apply changes before rebuilding.

 

The dreadkopp's source changes can be found here:

 

https://sourceforge.net/p/cloverefiboot/tickets/255/

 

He makes a number of revisions in his comments, but essentially, I used the following comment in that ticket:

 

https://sourceforge.net/p/cloverefiboot/tickets/255/#16e1

 

I did this weeks ago and didn't take notes.  If you need more details, I can maybe recreate my process this weekend.

  • Like 1
Link to comment
Share on other sites

I'm trying to install El Capitan in QEMU/KVM with passthrough of my Sapphire R9 390. I have already built a successful vm with passthrough of Windows 8.1. I have vt-d and vt-x enabled. I am connecting to my monitor by displayport. I'm getting a white scrambled image in the installer.

 

Any ideas on how to troubleshoot this?

 

 

My Hardware

-------------------

i5-4590 - CPU

r9 390 - GPU

ga z97x-sli - Mobo

 

Software

---------------

Xubuntu 16.04

Linux 4.7.8-040708

QEMU 2.5.0

OVMF git-20160929.b2156 (kraxel/jenkins) OVMF: 0~20160408.ffea0a2c-2 (standard from ubuntu 16.04 repositories)

Clover 2.3k rev 3786

 

Here's my script

 

#!/bin/bash

# Flush networking for vm

/home/KVM/vmnet1.sh
/home/KVM/vmnet0.sh

echo 1 > /sys/module/kvm/parameters/ignore_msrs

configfile=/etc/vfio-pci1.cfg
vfiobind() {
    dev="$1"
        vendor=$(cat /sys/bus/pci/devices/$dev/vendor)
        device=$(cat /sys/bus/pci/devices/$dev/device)
        if [ -e /sys/bus/pci/devices/$dev/driver ]; then
                echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
        fi
        echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id
}
modprobe vfio-pci
cat $configfile | while read line;do
    echo $line | grep ^# >/dev/null 2>&1 && continue
        vfiobind $line
done

/home/KVM/vmnet1.sh

synergyc --name DeusVitam 192.168.179.50:24800

qemu-system-x86_64 -enable-kvm \
-machine q35,accel=kvm \
-bios /usr/share/ovmf/OVMF.fd -vga none \
-cpu core2duo,vendor=GenuineIntel \
-smp 2,cores=2,threads=1,sockets=1,maxcpus=2 \
-m 4096 \
-smbios type=2 \
-device vfio-pci,host=01:00.0,addr=0x8.0x0,multifunction=on \
-device vfio-pci,host=01:00.1,addr=0x8.0x1 \
-device isa-applesmc,osk="REDACTED" \
-device ide-drive,bus=ide.2,drive=MacHD \
-drive id=MacHD,if=none,file=/home/KVM/ElCapitan.qcow2,format=qcow2 \
-usb -usbdevice host:046d:c52b -usbdevice host:0461:4d8a -usbdevice host:0d8c:013c \
-netdev tap,id=t0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=t0,id=nic0 \
-netdev user,id=vmnic -device e1000-82545em,netdev=vmnic \
-smb /home/Downloads


sudo killall -9 synergyc

/home/KVM/vmnet0.sh

exit 0
EDIT: SOLVED, USE AN OLDER VERSION OF OVMF, NEW GIT BUILDS DO NOT WORK. SCRIPT UPDATED. CARD IS WORKING PERFECTLY WITH ACCELERATION AND 8GB SHOWN. USE FB RADEON, INJECTATI, AND 0x67B01002
Link to comment
Share on other sites

I'm having the exact same issue with a 970. I was able to get GPU passthrough working for El Capitan using SeaBios, but that was very tied to chameleon/Enoch. 

 

I see displayed on both the SPICE client in virt-manager, and on the screen connected to my GPU the following:

OsxAptioFix2Drv: Starting overrides for System/Library/CoreServices/boot.efi
Using relic block: no, hibernate wake: no
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Looking through the serial port logs, I see the exact same thing as you. A NVDA::rmstart failed, and a bunch of:

NVDA,Display-B: not usable

kPEDisableScreen -1

NVDA,Display-C: not usable

kPEDisableScreen -1

NVDA,Display-D: not usable

kPEDisableScreen -1

... etc to Display-F.

 

Did you ever get this figured out?

 

 

Edit:

The system boots completely, and I can access it using VNC.  I see no output on either the SPICE client, or the GPU screen. They remain frozen at the message above.

I have the same issue with my 980Ti. Until now I didn't found a solution, which could solve the problem.

 

I didn't had enough time to try all this solutions, but

 

Problem 4: Monitor goes to sleep at the end of the boot sequence when using iMac15,1 or iMac17,1 or MacPro 6,1 system definition

from this link could help.

Link to comment
Share on other sites

Yesterday I updated Clover on my Sierra from the patched one to latest Clover(unpatched) and it WORKS!

 

I'm running unRAID 6.2.1 (qemu 2.5)

 

BUT!! On unRAID 2.3.0-rc1 (qemu 2.7) I'm stuck on PCI Configuration Begin. Don't know how to solve this :-(

 

 

EDIT

 

What qemu version are you other using ??

 

//Peter

Link to comment
Share on other sites

Hey Peter. What clover version unpatched is working for you? Are you using Penryn to boot Serria? Anything of note in your clover.confg? Thanks!

 

Yesterday I updated Clover on my Sierra from the patched one to latest Clover(unpatched) and it WORKS!

 

I'm running unRAID 6.2.1 (qemu 2.5)

 

BUT!! On unRAID 2.3.0-rc1 (qemu 2.7) I'm stuck on PCI Configuration Begin. Don't know how to solve this :-(

 

 

EDIT

 

What qemu version are you other using ??

 

//Peter

Link to comment
Share on other sites

I am trying 3793 right now. The vm is running extremely slow. What cpu options are you using in clover? qemu on?

 

As far as your GPU are you using Nvidia? This works for me but the OS is unusable because of the timing issues.

 

https://www.tonymacx86.com/threads/new-method-for-enabling-nvidia-web-drivers-in-clover.202341/

 

 

 

I have Penryn with Clover = 3793

 

BUT, anyone get a GPU passtrough using Qemu 2.7 for Sierra?

 

//Peter

Link to comment
Share on other sites

Amazing instructions! Thank you!!!!!!! :w00t::D:yes::wub:

I built Clover with the patch today when I got home from school. It's working :thumbsup_anim:

Thank you so much for the help!

EDIT: I'm useing seabios and clover in "legacy mode" couldn't get ovmf to work. Seabios seems to work just great though.

 

 

EDIT:

(I have started filling in documentation on how I got this working just so that if I ever need to do this again in case of a system crash I have the info. I thought it would also be useful to others. Red means the step is required, orange is might be required depending on hardware, green is things that are working, Purple does not work.)

 

Got OVMF working today. My VM boots much faster now. Also I was having USB issues sometimes with Seabios. They seem mostly resolved with OVMF. 0~20160408.ffea0a2c-2 is required (Extract using dpkg). The newer OVMF will freeze at boot. Included newest version of OVMF with Proxmox now works. VM does not show boot screen just a black screen. But once it reaches the log in screen it will show all graphics correctly. 

 

Host Configuration.

Proxmox V4.3

ThinkServer TS-140.

20GB ram.

Intel Xeon 1220 V3. 3.1Ghz video=efifb:off in grub boot arguments is required as this CPU does not have a built in Video card. This keeps linux from accessing the video card and it can then be passed through to the VM. 

 

Also have to blacklist the PCI-E card to be passthrough. And Disable msrs.

echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf      

echo "options kvm ignore_msrs=Y" >>/etc/modprobe.d/kvm.conf

echo "options vfio-pci ids=0000:0000,0000:0000" > /etc/modprobe.d/vfio.conf

 

backup and update /etc/modules 

cp /etc/modules /etc/modules-original
echo "vfio" >> /etc/modules
echo "vfio_iommu_type1" >> /etc/modules
echo "vfio_pci" >> /etc/modules
echo "vfio_virqfd" >> /etc/modules
 
Edit Grub boot options
sed 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="quiet rootdelay=5 intel_iommu=on video=efifb:off"/' /etc/default/grub-original > /etc/default/grub

 

update initramfs and grub

update-grub
update-initramfs -k all -u
 

 

VM Status.

Video works. GTX 750TI PCI-E Passthrough

Serria 10.12 (VCPU is set to Penryn)

Audio Works with PCI-e Passthrough of on board sound card.

iMessage, iCloud, Ect all working. 

Virtio network driver working. Must install pkg and use "args" in vm conf. (otherwise use e1000-82545em) back to using  e1000-82545em. The Virtue driver worked but was painfully slow. Not sure how to fix it. I get 1gbe speed with  e1000-82545em. I may try adding more then one  e1000-82545em and using bonding to see what that does.

 

Sleep does not work, VM will refuse to wake after sleeping. I doubt this will ever work. I also see no point as the host is still on and using power.

 

Next goal is to try and get Emulated audio working instead of passthrough PCI-e. That was I can hear my MacOS sound and other VM's sound at the same time. If anyone has had success please let me know what you did it!

 

Below is my VM .conf file to help others I did not need to add the isa-applesmc,os device. I have striped all UUID's and replaced with 000's

args: -netdev tap,id=net0 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:56,vectors=0
boot: cdn
bootdisk: sata5
cores: 3
cpu: Penryn
cpuunits: 1600
hostpci0: 01:00,pcie=1,x-vga=on
hostpci1: 00:1b,pcie=1
hotplug: usb
machine: q35
memory: 6000
name: OSXPassthrough
numa: 1
ostype: other
sata5: Tank:vm-104-disk-1,cache=writeback,size=20G
smbios1: uuid=0000-0000-0000-0000-0000
sockets: 1
tablet: 0
usb0: host=0000:0000
usb1: host=0000:0000
vga: none

I had some time today to re-create my process and take notes:

To do source download and build, follow instructions here:

https://github.com/JrCs/CloverGrowerPro

I wait for vanilla build to completely finish. The edk2/Clover build portion is redundant, but I just let it finish for simplicity. The line numbers below are accurate as of revision 3793.

So that we can manually patch Clover, change the empty line 656 of CloverGrowerPro.sh to:
 

exit
I end up with:

fi    exit    # Construct EBUILD_COMMAND    EBUILD_COMMAND=("./ebuild.sh" "-${ebuildToolchainFlag}")
Delete the edk2 directory and re-run cloverpro. This will re-fetch a clean edk2 and clover source and stop before building. Now we’ll modify clover using dreadkopp’s changes.

Make this change to edk2/Clover/rEFIT_UEFI/refit/main.c:

Replace lines 1908-1924 with:

DBG("Starting QEMU vCPU workaround...\n");//fake values for correct calculationsgCPUStructure.MaxRatio = 40;gCPUStructure.MinRatio = 40;gCPUStructure.Turbo = 40;gCPUStructure.Turbo1 = 40;gCPUStructure.Turbo2 = 40;gCPUStructure.Turbo3 = 40;gCPUStructure.Turbo4 = 40;gCPUStructure.FSBFrequency = gCPUStructure.CPUFrequency / 4;gCPUStructure.Stepping = 3;gCPUStructure.Model = 23;gCPUStructure.Family = 6;gCPUStructure.Type = 0;gCPUStructure.Extmodel = 1;gCPUStructure.ARTFrequency = 0;gCPUStructure.SubDivider = 0;//these seem to be constants. need further testing by differnt host machinesgCPUStructure.ExternalClock = 1133825;gCPUStructure.ProcessorInterconnectSpeed = 2147057130;gCPUStructure.Signature = 0x010673;}
I ended up with:

if (gSettings.QEMU) {//    UINT64 Msrflex = 0ULL;     DBG("Starting QEMU vCPU workaround...\n");    //fake values for correct calculations    gCPUStructure.MaxRatio = 40;    gCPUStructure.MinRatio = 40;    gCPUStructure.Turbo = 40;    gCPUStructure.Turbo1 = 40;    gCPUStructure.Turbo2 = 40;    gCPUStructure.Turbo3 = 40;    gCPUStructure.Turbo4 = 40;    gCPUStructure.FSBFrequency = gCPUStructure.CPUFrequency / 4;    gCPUStructure.Stepping = 3;    gCPUStructure.Model = 23;    gCPUStructure.Family = 6;    gCPUStructure.Type = 0;    gCPUStructure.Extmodel = 1;    gCPUStructure.ARTFrequency = 0;    gCPUStructure.SubDivider = 0;    //these seem to be constants. need further testing by differnt host machines    gCPUStructure.ExternalClock = 1133825;    gCPUStructure.ProcessorInterconnectSpeed = 2147057130;    gCPUStructure.Signature = 0x010673;  }
Make this change to edk2/Clover/rEFIt_UEFI/Platform/DataHubCpu.c:

Insert the following between lines 319 and 320:

case CPU_MODEL_PENRYN: //fix for Penryn Qemu vCPUDBG("Using workaroud for Penryn Qemu vCPU in DataHubCpu.c.\n");FrontSideBus = gCPUStructure.FSBFrequency;break;
I ended up with:

if (gSettings.QEMU) {    FrontSideBus = gCPUStructure.TSCFrequency;    switch (gCPUStructure.Model) {      case CPU_MODEL_DOTHAN:      case CPU_MODEL_YONAH:      case CPU_MODEL_MEROM:        FrontSideBus = DivU64x32(FrontSideBus, 4);        break;      case CPU_MODEL_PENRYN: //fix for Penryn Qemu vCPU        DBG("Using workaroud for Penryn Qemu vCPU in DataHubCpu.c.\n");        FrontSideBus = gCPUStructure.FSBFrequency;        break;      default:        break;    }    DBG("Using QEMU FrontSideBus=%d\n", FrontSideBus);  }
I ignored dreadkopp’s changes to edk2/Clover/rEFIT_UEFI/refit/menu.c. I couldn’t figure out where to put it and it seemed to work anyway.

Now that we’ve made the source changes, remove the line “exit”, number 656 that we added to CloverGrowerPro.sh above, then run cloverpro to build Clover and make the installer.
 
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

After three frustrating days trying to make functional UEFI QEMU OSX El Capitan installation, I'm here to ask for help. I managed to install Clover and boot from QEMU but after booting comes this weird issue where i'm presented with two OSX screens on one monitor(you can see what I'm talking about in attached file). I tried with different Clover options(different patches, changing resolution, SMBIOS changes) and QEMU options(tried different cpu models, three OVMF.fd files, removing x-vga=on...) and this is the closest I could come to a functional QEMU OSX. I should point out that OSX is working as expected when I disable OVMF and enable old BIOS booting style within QEMU.

 

My System:

Intel 4790K
Nvidia GTX460(using in linux)
Nvidia GTX960(using for VGA passthrough)

Runing Arch linux with 4.7.6-1 kernel

My QEMU flags:

args="-enable-kvm \
      -cpu core2duo,kvm=off,vendor=GenuineIntel \
      -smp sockets=1,cores=4,threads=2 \
      -M q35 \
      -m 8192 \
      -vga none \
      -smbios type=2 \
      -device isa-applesmc,osk=MY APPLE KEY \
      -monitor telnet:localhost:7101,server,nowait \
      -usb \
      -netdev bridge,br=br0,id=mynet \
      -device e1000-82545em,netdev=mynet \
      -device ide-hd,bus=ide.0,drive=hdd \
      -drive file=/opt/osx/OVMF-pure-efi.fd,format=raw,if=pflash \
      -drive id=hdd,if=none,format=raw,cache=none,file=/opt/osx/el_capitan.img \
      -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root \
      -device vfio-pci,host=01:00.0,bus=root,addr=00.0,multifunction=on \
      -device vfio-pci,host=01:00.1,bus=root,addr=00.1"

I would really appreciated any kind of help. Thanks in advance.

post-1696462-0-59344000-1476966972_thumb.jpg

Link to comment
Share on other sites

Try removing Monitor telnet. What is that? Also add -vga none to make sure that it does not try to create a virtual gpu/monitor.

You said it works correctly with Seabios? You are using nvidia web driver?

What do you have in your clover conf? also what drivers are in your clover folder and kexts in your clover folder?

 

After three frustrating days trying to make functional UEFI QEMU OSX El Capitan installation, I'm here to ask for help. I managed to install Clover and boot from QEMU but after booting comes this weird issue where i'm presented with two OSX screens on one monitor(you can see what I'm talking about in attached file). I tried with different Clover options(different patches, changing resolution, SMBIOS changes) and QEMU options(tried different cpu models, three OVMF.fd files, removing x-vga=on...) and this is the closest I could come to a functional QEMU OSX. I should point out that OSX is working as expected when I disable OVMF and enable old BIOS booting style within QEMU.

 

My System:

 

Intel 4790K
Nvidia GTX460(using in linux)
Nvidia GTX960(using for VGA passthrough)

Runing Arch linux with 4.7.6-1 kernel
My QEMU flags:

args="-enable-kvm \
      -cpu core2duo,kvm=off,vendor=GenuineIntel \
      -smp sockets=1,cores=4,threads=2 \
      -M q35 \
      -m 8192 \
      -vga none \
      -smbios type=2 \
      -device isa-applesmc,osk=MY APPLE KEY \
      -monitor telnet:localhost:7101,server,nowait \
      -usb \
      -netdev bridge,br=br0,id=mynet \
      -device e1000-82545em,netdev=mynet \
      -device ide-hd,bus=ide.0,drive=hdd \
      -drive file=/opt/osx/OVMF-pure-efi.fd,format=raw,if=pflash \
      -drive id=hdd,if=none,format=raw,cache=none,file=/opt/osx/el_capitan.img \
      -device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root \
      -device vfio-pci,host=01:00.0,bus=root,addr=00.0,multifunction=on \
      -device vfio-pci,host=01:00.1,bus=root,addr=00.1"
I would really appreciated any kind of help. Thanks in advance.
Link to comment
Share on other sites

Try removing Monitor telnet. What is that? Also add -vga none to make sure that it does not try to create a virtual gpu/monitor.

You said it works correctly with Seabios? You are using nvidia web driver?

What do you have in your clover conf? also what drivers are in your clover folder and kexts in your clover folder?

 

-monitor telnet is for managing virtualized system over shell via telnet protocol. I'm using it to send a poweroff signal to shutdown the OSX via shell. You can do some cool manipulation over telnet via -monitor. I have tried to remove this line but this did not fix the issue.

 

-vga none is always active and this also is not a problem

 

You are right, OSX is booting and showing correctly with Seabios. Nvidia web drivers are installed and working.

 

In UEFI mod I tried booting with nv_disable=1 and this also did not fix the problem.

 

My config.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ACPI</key>
	<dict>
		<key>DSDT</key>
		<dict>
			<key>Debug</key>
			<true/>
			<key>DropOEM_DSM</key>
			<false/>
			<key>Fixes</key>
			<dict>
				<key>AddPNLF_1000000</key>
				<true/>
				<key>DeleteUnused_400000</key>
				<true/>
				<key>FIX_ACST_4000000</key>
				<true/>
				<key>FIX_ADP1_800000</key>
				<true/>
				<key>FIX_RTC_20000</key>
				<true/>
				<key>FIX_S3D_2000000</key>
				<true/>
				<key>FixRegions_10000000</key>
				<true/>
				<key>FixSBUS_0080</key>
				<true/>
				<key>NewWay_80000000</key>
				<true/>
			</dict>
			<key>Name</key>
			<string>q35-acpi-dsdt.aml</string>
			<key>ReuseFFFF</key>
			<false/>
		</dict>
		<key>DropTables</key>
		<array>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>Cpu0Ist</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>CpuPm</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>DMAR</string>
			</dict>
		</array>
		<key>SSDT</key>
		<dict>
			<key>DropOem</key>
			<false/>
			<key>Generate</key>
			<false/>
			<key>MaxMultiplier</key>
			<integer>40</integer>
			<key>MinMultiplier</key>
			<integer>40</integer>
		</dict>
	</dict>
	<key>Boot</key>
	<dict>
		<key>Arguments</key>
		<string>nv_disable=1 kext-dev-mode=1 rootless=0</string>
		<key>Debug</key>
		<false/>
		<key>DefaultLoader</key>
		<string>boot.efi</string>
		<key>DefaultVolume</key>
		<string>OS X</string>
		<key>Legacy</key>
		<string>PBR</string>
		<key>Secure</key>
		<false/>
		<key>Timeout</key>
		<integer>5</integer>
		<key>XMPDetection</key>
		<string>Yes</string>
	</dict>
	<key>CPU</key>
	<dict>
		<key>BusSpeedkHz</key>
		<integer>1000000</integer>
		<key>QEMU</key>
		<true/>
		<key>UseARTFrequency</key>
		<false/>
	</dict>
	<key>Devices</key>
	<dict>
		<key>USB</key>
		<dict>
			<key>FixOwnership</key>
			<false/>
			<key>Inject</key>
			<false/>
		</dict>
	</dict>
	<key>GUI</key>
	<dict>
		<key>Language</key>
		<string>en:0</string>
		<key>Mouse</key>
		<dict>
			<key>DoubleClick</key>
			<integer>500</integer>
			<key>Enabled</key>
			<false/>
			<key>Mirror</key>
			<false/>
			<key>Speed</key>
			<integer>8</integer>
		</dict>
		<key>Scan</key>
		<true/>
		<key>ScreenResolution</key>
		<string>1600x900</string>
		<key>Theme</key>
		<string>bootcamp</string>
	</dict>
	<key>Graphics</key>
	<dict>
		<key>DualLink</key>
		<integer>0</integer>
		<key>Inject</key>
		<dict>
			<key>ATI</key>
			<false/>
			<key>Intel</key>
			<false/>
			<key>NVidia</key>
			<true/>
		</dict>
		<key>NvidiaSingle</key>
		<false/>
	</dict>
	<key>KernelAndKextPatches</key>
	<dict>
		<key>AppleRTC</key>
		<false/>
		<key>AsusAICPUPM</key>
		<false/>
		<key>Debug</key>
		<false/>
		<key>KernelCpu</key>
		<false/>
		<key>KernelHaswellE</key>
		<false/>
		<key>KernelLapic</key>
		<false/>
		<key>KernelPm</key>
		<false/>
	</dict>
	<key>RtVariables</key>
	<dict>
		<key>BooterConfig</key>
		<string>0x28</string>
		<key>CsrActiveConfig</key>
		<string>0x67</string>
		<key>ROM</key>
		<string>UseMacAddr0</string>
	</dict>
	<key>SMBIOS</key>
	<dict>
		<key>BiosReleaseDate</key>
		<string>03/05/08</string>
		<key>BiosVendor</key>
		<string>Apple Inc.</string>
		<key>BiosVersion</key>
		<string>MBP31.88Z.0070.B07.0803051658</string>
		<key>Board-ID</key>
		<string>Mac-F4238BC8</string>
		<key>BoardManufacturer</key>
		<string>Apple Inc.</string>
		<key>BoardType</key>
		<integer>10</integer>
		<key>ChassisAssetTag</key>
		<string>MacBook-Aluminum</string>
		<key>ChassisManufacturer</key>
		<string>Apple Inc.</string>
		<key>ChassisType</key>
		<string>08</string>
		<key>Family</key>
		<string>MacBook Pro</string>
		<key>Manufacturer</key>
		<string>Apple Inc.</string>
		<key>Mobile</key>
		<false/>
		<key>ProductName</key>
		<string>MacBookPro3,1</string>
		<key>SerialNumber</key>
		<string>CK8026D0X91</string>
		<key>Trust</key>
		<false/>
		<key>Version</key>
		<string>1.0</string>
	</dict>
	<key>SystemParameters</key>
	<dict>
		<key>InjectKexts</key>
		<string>Detect</string>
		<key>InjectSystemID</key>
		<true/>
	</dict>
</dict>
</plist>

Kexts is empty. I'm not sure what do I need to put in that folder.

 

drivers64UEFI folder:

DataHubDxe-64.efi
FSInject-64.efi
OsxAptioFix2Drv-64.efi
OsxFatBinaryDrv-64.efi
VBoxHfs-64.efi

I have tested with a lot of efi files but this was a bad attempt to fix it without knowing what this files do.

Link to comment
Share on other sites

I remember I had some similar Issues when my host was set to bios. Make sure the host is booting UEFI. It seemed like the video card got confused when there was a miss match. Im not home right now to check but I do remember that OsxAptioFix2Drv did not work correctly. I had to use the non "2" version. When I get home I'll post what I have in my EFI folder to see if that helps you.

 

-monitor telnet is for managing virtualized system over shell via telnet protocol. I'm using it to send a poweroff signal to shutdown the OSX via shell. You can do some cool manipulation over telnet via -monitor. I have tried to remove this line but this did not fix the issue.

 

-vga none is always active and this also is not a problem

 

You are right, OSX is booting and showing correctly with Seabios. Nvidia web drivers are installed and working.

 

In UEFI mod I tried booting with nv_disable=1 and this also did not fix the problem.

 

My config.plist:

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>ACPI</key>
	<dict>
		<key>DSDT</key>
		<dict>
			<key>Debug</key>
			<true/>
			<key>DropOEM_DSM</key>
			<false/>
			<key>Fixes</key>
			<dict>
				<key>AddPNLF_1000000</key>
				<true/>
				<key>DeleteUnused_400000</key>
				<true/>
				<key>FIX_ACST_4000000</key>
				<true/>
				<key>FIX_ADP1_800000</key>
				<true/>
				<key>FIX_RTC_20000</key>
				<true/>
				<key>FIX_S3D_2000000</key>
				<true/>
				<key>FixRegions_10000000</key>
				<true/>
				<key>FixSBUS_0080</key>
				<true/>
				<key>NewWay_80000000</key>
				<true/>
			</dict>
			<key>Name</key>
			<string>q35-acpi-dsdt.aml</string>
			<key>ReuseFFFF</key>
			<false/>
		</dict>
		<key>DropTables</key>
		<array>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>Cpu0Ist</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>SSDT</string>
				<key>TableId</key>
				<string>CpuPm</string>
			</dict>
			<dict>
				<key>Signature</key>
				<string>DMAR</string>
			</dict>
		</array>
		<key>SSDT</key>
		<dict>
			<key>DropOem</key>
			<false/>
			<key>Generate</key>
			<false/>
			<key>MaxMultiplier</key>
			<integer>40</integer>
			<key>MinMultiplier</key>
			<integer>40</integer>
		</dict>
	</dict>
	<key>Boot</key>
	<dict>
		<key>Arguments</key>
		<string>nv_disable=1 kext-dev-mode=1 rootless=0</string>
		<key>Debug</key>
		<false/>
		<key>DefaultLoader</key>
		<string>boot.efi</string>
		<key>DefaultVolume</key>
		<string>OS X</string>
		<key>Legacy</key>
		<string>PBR</string>
		<key>Secure</key>
		<false/>
		<key>Timeout</key>
		<integer>5</integer>
		<key>XMPDetection</key>
		<string>Yes</string>
	</dict>
	<key>CPU</key>
	<dict>
		<key>BusSpeedkHz</key>
		<integer>1000000</integer>
		<key>QEMU</key>
		<true/>
		<key>UseARTFrequency</key>
		<false/>
	</dict>
	<key>Devices</key>
	<dict>
		<key>USB</key>
		<dict>
			<key>FixOwnership</key>
			<false/>
			<key>Inject</key>
			<false/>
		</dict>
	</dict>
	<key>GUI</key>
	<dict>
		<key>Language</key>
		<string>en:0</string>
		<key>Mouse</key>
		<dict>
			<key>DoubleClick</key>
			<integer>500</integer>
			<key>Enabled</key>
			<false/>
			<key>Mirror</key>
			<false/>
			<key>Speed</key>
			<integer>8</integer>
		</dict>
		<key>Scan</key>
		<true/>
		<key>ScreenResolution</key>
		<string>1600x900</string>
		<key>Theme</key>
		<string>bootcamp</string>
	</dict>
	<key>Graphics</key>
	<dict>
		<key>DualLink</key>
		<integer>0</integer>
		<key>Inject</key>
		<dict>
			<key>ATI</key>
			<false/>
			<key>Intel</key>
			<false/>
			<key>NVidia</key>
			<true/>
		</dict>
		<key>NvidiaSingle</key>
		<false/>
	</dict>
	<key>KernelAndKextPatches</key>
	<dict>
		<key>AppleRTC</key>
		<false/>
		<key>AsusAICPUPM</key>
		<false/>
		<key>Debug</key>
		<false/>
		<key>KernelCpu</key>
		<false/>
		<key>KernelHaswellE</key>
		<false/>
		<key>KernelLapic</key>
		<false/>
		<key>KernelPm</key>
		<false/>
	</dict>
	<key>RtVariables</key>
	<dict>
		<key>BooterConfig</key>
		<string>0x28</string>
		<key>CsrActiveConfig</key>
		<string>0x67</string>
		<key>ROM</key>
		<string>UseMacAddr0</string>
	</dict>
	<key>SMBIOS</key>
	<dict>
		<key>BiosReleaseDate</key>
		<string>03/05/08</string>
		<key>BiosVendor</key>
		<string>Apple Inc.</string>
		<key>BiosVersion</key>
		<string>MBP31.88Z.0070.B07.0803051658</string>
		<key>Board-ID</key>
		<string>Mac-F4238BC8</string>
		<key>BoardManufacturer</key>
		<string>Apple Inc.</string>
		<key>BoardType</key>
		<integer>10</integer>
		<key>ChassisAssetTag</key>
		<string>MacBook-Aluminum</string>
		<key>ChassisManufacturer</key>
		<string>Apple Inc.</string>
		<key>ChassisType</key>
		<string>08</string>
		<key>Family</key>
		<string>MacBook Pro</string>
		<key>Manufacturer</key>
		<string>Apple Inc.</string>
		<key>Mobile</key>
		<false/>
		<key>ProductName</key>
		<string>MacBookPro3,1</string>
		<key>SerialNumber</key>
		<string>CK8026D0X91</string>
		<key>Trust</key>
		<false/>
		<key>Version</key>
		<string>1.0</string>
	</dict>
	<key>SystemParameters</key>
	<dict>
		<key>InjectKexts</key>
		<string>Detect</string>
		<key>InjectSystemID</key>
		<true/>
	</dict>
</dict>
</plist> 
Kexts is empty. I'm not sure what do I need to put in that folder.

 

drivers64UEFI folder:

DataHubDxe-64.efi
FSInject-64.efi
OsxAptioFix2Drv-64.efi
OsxFatBinaryDrv-64.efi
VBoxHfs-64.efi
I have tested with a lot of efi files but this was a bad attempt to fix it without knowing what this files do.
Link to comment
Share on other sites

I remember I had some similar Issues when my host was set to bios. Make sure the host is booting UEFI. It seemed like the video card got confused when there was a miss match. Im not home right now to check but I do remember that OsxAptioFix2Drv did not work correctly. I had to use the non "2" version. When I get home I'll post what I have in my EFI folder to see if that helps you.

 

I have double checked my motherboard BIOS. It's set up as UEFI only. I would appreciate if you could check what files are in your EFI drivers folder.

Link to comment
Share on other sites

My bisect on edk2/ovmf showed that the last working commit is d85c5e31ed2b550dd801f82e4ddb5f7583332098. The next commit (855743f7177459bea95798e59b6b18dab867710c) introduced a new DXE driver named "IncompatiblePciDeviceSupportDxe". That somehow broke Clover/OSX support in Qemu.

 

So maybe this is a starting point to get more recent versions of ovmf to work again in this scenario.

 

Kind regards

palimm

Link to comment
Share on other sites

hi,

 

I'm on latest Sierra 10.12.1 (16B2555) and I can't build Clover! anyone knows what to do?

 

Using CloverGrowerPro.sh

Active Platform          = /Users/peter/CloverGrowerPro/edk2/Clover/Clover.dsc
Flash Image Definition   = /Users/peter/CloverGrowerPro/edk2/Clover/Clover.fdf

Processing meta-data ..... done!
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BaseLib/BaseLib.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BasePrintLib/BasePrintLib.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf [X64]
Building ... /Users/peter/CloverGrowerPro/edk2/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf [X64]
make: *** No rule to make target `tbuild'.  Stop.


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BasePcdLibNull/BasePcdLibNull]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BaseMemoryLib/BaseMemoryLib]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BasePrintLib/BasePrintLib]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BaseLib/BaseLib]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib]


build.py...
 : error 7000: Failed to execute command
	make tbuild [/Users/peter/CloverGrowerPro/edk2/Build/Clover/RELEASE_GCC49/X64/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint]


build.py...
 : error F002: Failed to build module
	/Users/peter/CloverGrowerPro/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf [X64, GCC49, RELEASE]

- Failed -
Build end time: 16:33:35, Oct.30 2016
Build total time: 00:00:10

Cloverx64  ERROR!!


Ejecting RAM disk
"disk1" unmounted.
"disk1" ejected.

Link to comment
Share on other sites

 Share

×
×
  • Create New...