Jump to content
waschbenzin

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

511 posts in this topic

Recommended Posts

Ok, I also had some trouble, but I think I have it all working now.

 

I have attached my clover image (svn 3322), the OVMF I use as well as the command line to start. I have verified it works with a vanilla El Capitan USB installer on Linux with KVM (QEMU 2.3) as well as on Mac without KVM (QEMU 2.4). I think this should boot just about everything you throw at it (I confirmed mavericks also works). I've also included a fix for the memory problem when not using the kernel cache. I never had any problems with insanely high speeds. Without KVM the vm is pretty slow, but it still shows the right time :-). In any case, give it a few minutes time before claiming it hangs.

 

All the debug options I know about are enabled, so maybe this helps with finding bugs...

 

Could we agree to use this to do further testing?

 

Adjust the included scripts to use your image and provide the smc key. 

 

Happy testing.

clover-qemu-test.zip

Share this post


Link to post
Share on other sites
Advertisement

Ok, I also had some trouble, but I think I have it all working now.

 

I have attached my clover image (svn 3322), the OVMF I use as well as the command line to start. I have verified it works with a vanilla El Capitan USB installer on Linux with KVM (QEMU 2.3) as well as on Mac without KVM (QEMU 2.4). I think this should boot just about everything you throw at it (I confirmed mavericks also works). I've also included a fix for the memory problem when not using the kernel cache. I never had any problems with insanely high speeds. Without KVM the vm is pretty slow, but it still shows the right time :-). In any case, give it a few minutes time before claiming it hangs.

 

All the debug options I know about are enabled, so maybe this helps with finding bugs...

 

Could we agree to use this to do further testing?

 

Adjust the included scripts to use your image and provide the smc key. 

 

Happy testing.

can you elaborate the memory fix? 

Share this post


Link to post
Share on other sites

this is log from my VM using your script, anything strange ?

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Longterm timer threshold: 1000 ms
version_variant = 0
version         = Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64
himemory_mode: 2
KASLR slide: 0x000000000f000000 dynamic
Hiding local relocations
WARNING: ignoring first page in [0x0:0x0]
Physical memory 2048 MB
avail_remaining = 0x7f9ae
Kernel virtual space from 0xffffff8000000000 to 0xffffffffffffefff.
Available physical space from 0x12b82000 to 0x7ffff000
initialize_screen: b=C0000000, w=00000320, h=00000258, r=00000C80, d=00000001
Telemetry: Sampling all tasks once per 1 second
Setting scheduler priority decay band limit 18
Scheduler: Default of multiq
Reallocated master cpu data: 0xffffff804a9fd000, interrupt stack: 0xffffff804a9fd000, fault stack: 0xffffff804aa09000
CPU identification: Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
CPU features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH MMX FXSR SSE SSE2 SS SSE3 SSSE3 CX16 x2APIC VMM
CPU extended features: SYSCALL XD EM64T LAHF
Initializing EFI runtime services
MSR_IA32_APIC_BASE 0xfee00000 enabled legacy mode BSP
x2APIC supported but will not be enabled
ID: 0x0 LDR: 0x0
Boot cpu local APIC id 0x0
TSC sync margin disabled
Kernel text is 2MB aligned and will be mapped with 2M pages
Kernel text 0xffffff800f200000-0xffffff800fa00000 to be write-protected
Const DATA misaligned 0xffffff800fa01000 0xffffff800fa2a6d0
Marking const DATA read-only
[RTCLOCK] frequency 3400000000 (3400062956)
maxDec: 2526404568
ATM subsystem is initialized
BANK subsystem is initialized
Kernel boot args: 'debug=0x108 -v '
corecrypto_kext_start called
kext fips mode set to 2
Plist hmac value is    af32c1825e4140d392842644a8072a1204f5e211acd73030f25581be0296993f
Computed hmac value is af32c1825e4140d392842644a8072a1204f5e211acd73030f25581be0296993f
corecrypto.kext FIPS integrity POST test passed!
corecrypto.kext FIPS AES CBC POST test passed!
corecrypto.kext FIPS TDES CBC POST test passed!
corecrypto.kext FIPS AES ECB POST test passed!
corecrypto.kext FIPS AES XTS POST test passed!
corecrypto.kext FIPS SHA POST test passed!
corecrypto.kext FIPS HMAC POST test passed!
corecrypto.kext FIPS ECDSA POST test passed!
corecrypto.kext FIPS DRBG POST test passed!
corecrypto.kext FIPS RSA POST test passed!
corecrypto.kext FIPS POST passed!
ACPI: RSDP 0x000000007FEF2014 000024 (v02 BOCHS )
ACPI: XSDT 0x000000007D717000 00004C (v01 BOCHS  BXPCFACP 00000001      01000013)
ACPI: FACP 0x000000007D6C5000 0000F4 (v04 Apple  BXPCFACP 00000001 BXPC 00000001)
ACPI: DSDT 0x000000007D6BA000 001DB8 (v01 Apple  BXPCDSDT 00000001 BXPC 00000001)
ACPI: FACS 0x000000007FEF5000 000040
ACPI: SSDT 0x000000007D6C3000 00031A (v01 BOCHS  BXPCSSDT 00000001 BXPC 00000001)
ACPI: APIC 0x000000007FEEC000 000078 (v01 BOCHS  BXPCAPIC 00000001 BXPC 00000001)
ACPI: HPET 0x000000007FEEB000 000038 (v01 BOCHS  BXPCHPET 00000001 BXPC 00000001)
ACPI: QEMU 0x000000007E8BC000 00003C (v01 BOCHS  BXPCQEMU 00000001 BXPC 00000001)
ACPI: All ACPI Tables successfully acquired
AppleFDEKeyStore::probe(IOResources)
AppleKeyStore::probe(IOResources)
AppleFDEKeyStore::start(IOResources) <1>
IOGetBootKeyStoreData: data at address 0 size 0
AppleKeyStore::start(IOResources) <1>
ACPI Warning: GPE _L00 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L01 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L04 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L05 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L06 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L07 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L08 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L09 has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L0A has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L0B has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L0C has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L0D has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L0E has no implementation (20140828/evgpeinit-1cf)
ACPI Warning: GPE _L0F has no implementation (20140828/evgpeinit-1cf)
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S0_] (20140828/hwxface-2cd)
pci (build 16:16:43 Sep 19 2015), flags 0xe3000, pfm64 (40 cpu) 0xff80000000, 0x80000000
kPEDisableScreen -1
initialize_screen: b=C0000000, w=00000320, h=00000258, r=00000C80, d=00000001
kPEEnableScreen 1
RTC: Only single RAM bank (128 bytes)
LINK: [GSIA] no interrupt
LINK: [GSIA] enable failed
LINK: [GSIB] no interrupt
LINK: [GSIB] enable failed
LINK: [GSIA] enable failed
LINK: [GSIA] enable failed
bsd_autoconf: calling kminit
** AppleSMBusPCI::start failed to get acpi path for provider
ACPI_SMC_PlatformPlugin::start - waitForService(resourceMatching(AppleIntelCPUPowerManagement) timed out
kPEDisableScreen 1
kPEDisableScreen 1
initialize_screen: b=FFFFFF8870832000, w=00000320, h=00000258, r=00000C80, d=00000001
initialize_screen: b=FFFFFF8870832000, w=00000320, h=00000258, r=00000C80, d=00000001
kPEEnableScreen 1

Share this post


Link to post
Share on other sites

can you elaborate the memory fix? 

I just included OsxLowMemFixDrv.efi :-). Did the job...

 

 

@Peter_sm

I mainly included the logging options so we can hunt down bugs if they occur. Though it will still be hard to really fix it, it might help others to reproduce your problem. Is your vm fully booting? Any speed issues?

Share this post


Link to post
Share on other sites

So using the test image its working for you now, Slice?

 

@Peter_sm So using the test image its working for you now? Had you success booting OSX in QEMU using Clover before?

Share this post


Link to post
Share on other sites

I've been reading this thread and finding mention about a patch for Clover specific to QEMU. Is this patch only relevant to the speed issue or could it fix the issue I am experiencing?

 

For those who have a working VM, how is the CPU usage (as measured on the host) at idle? I plan to have two OS X VMs: one with access to my video card and the other running screen-less for OS X Server.

 

Instead of using -device isa-applesmc,osk="blablabla" I just include FakeSMC.kext

Does using isa-applesmc work at all?

 

I once had a 10.9 VM mostly following this page, and the only kext I added was for VirtIO Ethernet. I'd rather use isa-applesmc than throw in FakeSMC.kext.

Share this post


Link to post
Share on other sites

For those who have a working VM, how is the CPU usage (as measured on the host) at idle? I plan to have two OS X VMs: one with access to my video card and the other running screen-less for OS X Server.

 

Does using isa-applesmc work at all?

 

I once had a 10.9 VM mostly following this page, and the only kext I added was for VirtIO Ethernet. I'd rather use isa-applesmc than throw in FakeSMC.kext.

 

 

I'm idling at about 6 percent (of a single core) with my setup. 

 

I think isa-applesmc is working, since my Mac doesn't boot without the correct key, but there are a few smc related warnings during boot up. I also prefer running without FakeSMC. As said I'm currently using no kexts, so I'm able to boot vanilla Mac OS X stuff :-). Virtio worked in Mavericks, but I didn't get it working on El Capitan, but the e1000-82545em device is providing me with network for now :).

Share this post


Link to post
Share on other sites

So using the test image its working for you now, Slice?

 

@Peter_sm So using the test image its working for you now? Had you success booting OSX in QEMU using Clover before?

Before when booting with Cham, I followed danofun process step on this page for Clover , look att the bottom. This is sucessful.

https://macosxvirtualmachinekvm.wordpress.com/guide-mac-os-x-vm-on-unraid/

 

When using your image, maybe my Clover instalaltion on my VM image override your boot image? , anyway when using above way I have no boot parameters in my qemu config file.

 

Maybee I can do a test this weekend on a fresh installation with your clover image

 

//Peter

I have try these iso files , but they say they are bootable, but I can't get this to boot, 

http://sourceforge.net/projects/cloverefiboot/files/Bootable_ISO/

 

Any one knows what these are ? and how to use them

 

//Peter

Share this post


Link to post
Share on other sites

The Clover installation on your VM might override the image, if it gets to boot first. Since you saw the debug log on the console, I think my boot image won :)

 

I'm wondering why danofun and you didn't have problems with the speed of the virtual machine. Does unraid provide additional patches to fix these issues? On the other hand, the speed issue might be related to my 4GHz system. Maybe it doesn't occur at lower speeds...

Share this post


Link to post
Share on other sites

Talk to Jonp at lime tech , he is the man that are involved in virtualisation , need more info , please let me know , he are talking also with one at redhead that know very much of KVM :-)

Share this post


Link to post
Share on other sites

Ok, I also had some trouble, but I think I have it all working now.

 

I have attached my clover image (svn 3322), the OVMF I use as well as the command line to start. I have verified it works with a vanilla El Capitan USB installer on Linux with KVM (QEMU 2.3) as well as on Mac without KVM (QEMU 2.4). I think this should boot just about everything you throw at it (I confirmed mavericks also works). I've also included a fix for the memory problem when not using the kernel cache. I never had any problems with insanely high speeds. Without KVM the vm is pretty slow, but it still shows the right time :-). In any case, give it a few minutes time before claiming it hangs.

 

All the debug options I know about are enabled, so maybe this helps with finding bugs...

 

Could we agree to use this to do further testing?

 

Adjust the included scripts to use your image and provide the smc key. 

 

Happy testing.

Using the files you attached, I managed to get OS X successfully booting :)

Share this post


Link to post
Share on other sites

The Clover installation on your VM might override the image, if it gets to boot first. Since you saw the debug log on the console, I think my boot image won :).

 

I'm wondering why danofun and you didn't have problems with the speed of the virtual machine. Does unraid provide additional patches to fix these issues? On the other hand, the speed issue might be related to my 4GHz system. Maybe it doesn't occur at lower speeds...

I have a i5 4570 and had same problem with speed

Share this post


Link to post
Share on other sites

I'm idling at about 6 percent (of a single core) with my setup. 

 

I think isa-applesmc is working, since my Mac doesn't boot without the correct key, but there are a few smc related warnings during boot up. I also prefer running without FakeSMC. As said I'm currently using no kexts, so I'm able to boot vanilla Mac OS X stuff :-). Virtio worked in Mavericks, but I didn't get it working on El Capitan, but the e1000-82545em device is providing me with network for now :).

Is this after the OS X guest has a user logged in?

 

Also, I just compiled the VirtIO ethernet kext from source against the 10.11 SDK. I won't be able to test it for a while, so I'm attaching it in the hope that someone will help test it out.

virtio-net.kext.zip

Share this post


Link to post
Share on other sites

I am curious, has anyone seen a benefit booting with clover into an OS X VM vs going the chameleon/enoch route?

Hi, Nice to see you here as well !!! :-)

 

Did you manage get HDMI sound ? I have it on my GPU 

//Peter

Share this post


Link to post
Share on other sites

I am curious, has anyone seen a benefit booting with clover into an OS X VM vs going the chameleon/enoch route?

 

a ) It's always nice to have an alternative :)

 

 
b ) I am under the impression, that more and more people are switching to Clover, but I might be wrong here. If they are switching to Clover we have a broader user base to support this in future.
 

c ) With OVMF+Clover you get rid of the whole BIOS and legacy VGA part of the virtual machine by just using EFI. This makes VGA arbiter unnecessary, needed for some passthrough configurations.

Share this post


Link to post
Share on other sites

And also better support to get HDMI sound using clover.... ? even if I have it on Cham for my VM passing trough my HD 6450

But I like clover so much more than Cham :-)

Share this post


Link to post
Share on other sites

Hi, Nice to see you here as well !!! :-)

 

Did you manage get HDMI sound ? I have it on my GPU 

//Peter

 

Hey Peter, I stumbled upon this thread and saw a familiar name. I have not tried to use HDMI sound at all. I have been using an USB sound card for my audio. Also I don't have any devices that I could even test HDMI audio with. I am guessing your monitor plays back the audio?? If not do they make speakers with HDMI inputs?? I am a little out of date when it comes to computer speakers / sound...

 

a ) It's always nice to have an alternative :)

 

 
b ) I am under the impression, that more and more people are switching to Clover, but I might be wrong here. If they are switching to Clover we have a broader user base to support this in future.
 

c ) With OVMF+Clover you get rid of the whole BIOS and legacy VGA part of the virtual machine by just using EFI. This makes VGA arbiter unnecessary, needed for some passthrough configurations.

 

Completely agree, the more choices the better!

Share this post


Link to post
Share on other sites

I just dropped HDMIaudio.kext (which I found by googling easy clover nvidia hdmi audio) into my clover kext folder and I have working HDMI audio with El Capitan. Though I like the finding, I'm not sure if its a good idea to discuss all passthrough hardware topics related to certain devices in this thread, might just mess everything up ;-). 

Share this post


Link to post
Share on other sites

Is this after the OS X guest has a user logged in?

 

Also, I just compiled the VirtIO ethernet kext from source against the 10.11 SDK. I won't be able to test it for a while, so I'm attaching it in the hope that someone will help test it out.

 

I installed this .kext both in L/E & S/L/E and changed my network device to virtio in my XML config but it is not recognizing the device. I have tried removing and reading my Ethernet as well without luck. Am I putting the .kext in the correct place?

 

EDIT:

I do think it loaded the driver as if I check the Network Utility it does show the vendor as Virtio and model as Paravirtual Ethernet Adapter. The link status shows as inactive and no IP address.

Share this post


Link to post
Share on other sites

The link status shows as inactive and no IP address.

 

 

Same over here. I also had the same behavior with the old virtio driver, which worked in Mavericks. I think evilsephiroth is right, as I remember reading it was only pre-Yosemite.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×