Jump to content

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


514 posts in this topic

Recommended Posts

just to be sure about my proceedings..

 

1) Booted an older yosemite vm...

2)Attached a qemu raw image (100MB)

3)Formatted within mac with 1 HFS partition journaled

4) Installed clover on it as uefi boot formatting with the command newfs_msdos -V EFI -F 32 

5)Copied file on my arch host and set with usbdevice cloverUsb.img

6)At startup, ovmf fails to recognize as a valid uefi. If I go into the boot manager, I see EFI USB drive but when I boot from it no results. I'm back at the ovmf Efi shell...

 

It's not a passthrough thing. Simply I can't seem to boot clover. If I select the common iso file no problem... 

Link to comment
Share on other sites

Guide to my clover image
 
In Linux:
qemu-img create clover.raw 64M
gdisk clover.raw
# from here on you will have to do stuff inside gdisk
n # new partition
# use default partition number
# use default for start
+32M # size
ef00 # partition type (EFI)
n
# use default for partition number, start, size, 
0700 # partition type (MSDOS)
w # write to clover.raw
y # confirm
 
OSX (with image attached):
 
Boot MacOS and figure out disk number (i.e. use Disk Utility -> info)
sudo newfs_msdos /dev/diskXs1 -V EFI -F 32
sudo newfs_msdos /dev/diskXs2 -V Useless -F 32
reboot to make them appear!
Install clover (for settings see screenshots) on this disk (should show up as "Useless" ;-) )
post-1212350-0-32215400-1446326295_thumb.png
post-1212350-0-47549400-1446326342_thumb.png
 
EFI partition should be open 
 
Download https://github.com/qemu/qemu/blob/master/pc-bios/q35-acpi-dsdt.amland copy it to EFI/CLOVER/BOOT/ACPI/origin/q35-acpi-dsdt.aml
 
Open Clover Configurator
 
ACPI
 
post-1212350-0-88532200-1446326373_thumb.png
post-1212350-0-63557700-1446326386_thumb.png
BOOT
 
post-1212350-0-61945000-1446326403_thumb.png
 
CPU 
post-1212350-0-08140100-1446326418_thumb.png
 
DEVICES
post-1212350-0-83151300-1446326435_thumb.png
 
SMBIOS
 -> Use wand to create a MacPro2,1 (at least this is what I did)
 
System Parameters
post-1212350-0-42579300-1446326456_thumb.png
 
GUI
change resolution to 800x600
 
I didn't touch the rest.
 
Save and Exit Clover Configurator
 
open EFI/CLOVER/config.plist 
 
look for
<key>CPU</key>
<dict>
<key>BusSpeedkHz</key>
<integer>1000000</integer>
</dict>

insert QEMU setting

<key>CPU</key>
<dict>
<key>BusSpeedkHz</key>
<integer>1000000</integer>
<key>QEMU</key>
<true/>
</dict>
save config.plist
 
Optional:
Create another image with only the EFI partition and just copy the content of the image (from above) into this one. This way you don't have a partition that MacOS will automount on your Clover image.
 
 
 

I've got everything working, GPU passthrough and all, added in a SMBIOS to provided clover config and it hangs on "AppleKeyStore starting"

 

I'm not exactly sure what causes this, but here are some pitfalls I stumpled across:

- Not only clover has to see your disk, but also Mac OSX. The settings I provided in the first post (using usb) as well as in the later post (using ahci/ide) work for both.

- Fixing to much with Clover hurts. I have now disabled any ACPI fixes as you can see from the screenshots

- I think I switched to SMBIOS MacPro2,1 because I had trouble with AppleTyMCEDriver (though something else might have fixed that as well)

Link to comment
Share on other sites

You can add this get a working mouse and keyboard:

-device piix4-usb-uhci,id=usbbus \
-device usb-mouse \
-device usb-kbd \

You have to click inside the qemu window on the host to transfer the focus to the vm (mind the host key!). I'm passing my usb controller to the vm so my mouse and keyboard are automatically transfered to the vm (I have a PS2 fallback keyboard for linux... not an optimal solution either, but it works).

 

 

Everybody not using VGA-Passthrough can just remove

-vga none

from the command line. In that case set the resolution in the clover configurator to 800x600 to not end up with a scrambled image. I should include this in the guide above, but I'm too lazy ;-).

Link to comment
Share on other sites

You can add this get a working mouse and keyboard:

-device piix4-usb-uhci,id=usbbus \
-device usb-mouse \
-device usb-kbd \

You have to click inside the qemu window on the host to transfer the focus to the vm (mind the host key!). I'm passing my usb controller to the vm so my mouse and keyboard are automatically transfered to the vm (I have a PS2 fallback keyboard for linux... not an optimal solution either, but it works).

 

 

Everybody not using VGA-Passthrough can just remove

-vga none

from the command line. In that case set the resolution in the clover configurator to 800x600 to not end up with a scrambled image. I should include this in the guide above, but I'm too lazy ;-).

very nice guide. Will do it this night.

Link to comment
Share on other sites

Thanks, hope you will end up with a working virtual machine. Report back :)

 

Current TODO list:

- Change OVMF boot order to boot the clover image first (minor issue)

- Check if Facetime and Messages are working - without getting anything banned (major issue)

for boot order, you should only change boot order menu  in virt-manager (if you want you can also enable boot menu activated by a key )and you're done...

Facetime and IMessage don't know really... I don't use them very much :D using Imac for mobile games...

Link to comment
Share on other sites

Seems like my bus speed is messed up too, have to type super fast to avoid messing up key repeats. OS X detects my clock speed correctly though. I'll go into my bios later and find my true bus speed and try modifying the setting to that. 

Link to comment
Share on other sites

Remember to add the qemu setting to config.plist after editing with clover configurator each time. This setting is lost otherwise! Also 1000000 kHz might not be the right value for you. I think its cpu speed (4ghz for me) divided by four. 

Weird, the setting is there, I confirmed my bus speed is 100mhz, but whenever I use that setting (100000 khz), it speeds up the vm even faster.

 

Weirdest thing when I use 499999, it goes half speed, but 500000 it goes 10x as fast again.

Link to comment
Share on other sites

This is exactly the behavior I had without the hidden QEMU setting. Check if you are using a recent Clover version and editing the correct config.plist (EFI Partition/EFI/CLOVER/config.plist). Also note, that I set my busspeed to 1GHz and not 100MHz to fix the issue, but this may depend on your CPU speed...

Link to comment
Share on other sites

This is exactly the behavior I had without the hidden QEMU setting. Check if you are using a recent Clover version and editing the correct config.plist (EFI Partition/EFI/CLOVER/config.plist). Also note, that I set my busspeed to 1GHz and not 100MHz to fix the issue, but this may depend on your CPU speed...

I was using the latest I could find(3320). From what I could see searching the code for the QEMU setting, but I couldn't find where it used it.

 

I hardcoded the FSB to 1Ghz everywhere, as well as ExternelClock and now my system runs happily, although on a very hacky version of clover.

 

 

I also just installed clover on the EFI partition on the drive OS X is on so I don't have to pass 2 separate drives to QEMU.

Link to comment
Share on other sites

I was using the latest I could find(3320). From what I could see searching the code for the QEMU setting, but I couldn't find where it used it.

 

I hardcoded the FSB to 1Ghz everywhere, as well as ExternelClock and now my system runs happily, although on a very hacky version of clover.

 

 

I also just installed clover on the EFI partition on the drive OS X is on so I don't have to pass 2 separate drives to QEMU.

So you compiled clover or used Config.plist?
Link to comment
Share on other sites

The step I'm on with is this, not sure how to mount it ?

OSX (with image attached):
 
Boot MacOS and figure out disk number (i.e. use Disk Utility -> info)
sudo newfs_msdos /dev/diskXs1 -V EFI -F 32
sudo newfs_msdos /dev/diskXs2 -V Useless -F 32

Start virtual machine attaching the qemu virtual disk created. I use virt-manager selecting img file with sata mode

Link to comment
Share on other sites

 Share

×
×
  • Create New...