Jump to content

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


514 posts in this topic

Recommended Posts

My screen tearing was related to a mismatched resolution in OVMF and Clover. OVMF has a default of 800x600 and if I didn't match that in Clover I had screen tearing issues. You can change the resolution in OVMF but I didn't manage to get OSX booting (consistently) with a split OVMF image (to persist the resolution).

 

So for a higher resolution I see two options:

a ) fix split image OVMF support for OSX

b ) compile OVMF with a different default resolution

Link to comment
Share on other sites

Is it possible to use the on board Intel HD 4000 IGPU for both the Linux os and as a passthrough for QEmu OSX?

 

If you want a graphical desktop on your host using the IGPU then no but if you're happy with a text only interface then I believe its possible to achieve primary GFX assignment to a VM...you'll need to research this specifically and I've only seen 1 or 2 posts where people say they have managed it.  You have to reduce the hosts commitment on the iGPU down to the bare minimum...something to do with text only mode and disabling the framebuffer but don't quote me here.  Personally I'd say this is more hassle than its worth as the iGPU isn't the best in terms of performance, much better to purchase a cheap PCI card and use this for guest graphics IMO.  (Ah, just noticed you're using an Ultrabook...no change of popping a PCI card in that then).

 

Which linux distribution are you using and are you kvm/qemu or virtualbox?

  • Like 1
Link to comment
Share on other sites

@KillerKelvUK

 

In the end i removed clover entierly from the emulator and let the live image take care of that, since [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url] installs clover to the same disk after it installs the system. I configured that clover with clover configurator and it just worked after taking a dd dump of it.

 

And yeah my goal is to use intel HD4000 for passthrough as well, but no idea how to do that. I will start looking into. I am comfortable with using linux through  command line since that is what i do with arch and i3.

Link to comment
Share on other sites

So i thought everything was good once the installer was booting it seems to stop installing half way...

 

The installer is booting just fine. I can open disk utility and format the disks.

But once the install starts, after about 10 mins it simply says

 

"OS X could not be installed on your computer

An error occurred while extracting files from the package "Essentials.pkg".

Quit the installer to restart your computer and try again."

 

EDIT: Fixed

Used ISO for install

 

Next problem, How to get 1080p resolution? Right now OSX at 800x600

Also what to do post install? install clover to the efi partition?

Link to comment
Share on other sites

So I was able to get Clover running at 1024x768 keeping the kernel output legible so try going higher as needed.  Regards forcing the OSX desktop to a higher resolution, this is configurable using native OSX if using physical GFX hardware in a passthrough configuration.  If not then there is a config file that you need to create and put into the right place with the relevant values...google 'boot.plist' (I think its called that at least).

Link to comment
Share on other sites

editing /Library/Preferences/SystemConfiguration/com.apple.Boot.plist and changing the resolution value had no effect on the resolution.

 

Changing the resolution in clover causes so much screen tearing there is no point.

 

Note: i am still using "vga -qxl"

 

Also how did you manage to get the network tap working? I am been trying for the past couple hours and i cant seem to figure it out.

Link to comment
Share on other sites

When using the QXL virtual driver the only way I've set OSX resolution is using [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url] which to my knowledge just edits the file you've called out, I'd stay this course and debug as this has previously been the solution for me...unless El Captian has changed things.

 

The tap device for network requires you to create the bridge network using a helper script (this effectively done before the guest is started), this also comes with a specific challenge around permissions which is easily solved using sudo but more complicated if you want to run qemu as a non-root user.  I'll happily share my helper scripts as I lifted them from a website but I'm not home now for a few days.  I'd recommend you research qemu tap device permissions which will help you figure this out as a few sites have the same solution just vary slightly in approach.  Note if you're transitioning to virt-manager then the scripts aren't needed as virt-manager effects the same process automatically.

Link to comment
Share on other sites

I assumed you used [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url] to change the resolution. I cant really tell since the forums censorship kicked in.

 

If you could link the website you used, that would be fine.

Link to comment
Share on other sites

I think i may have figured out the resolution problem, But no idea how to fix it.

 

In the VM i when i check graphics memory it simply says 1 mb. Else where i read that qxl uses a default value of 9MB, and that minnium 32MB is required to run 1080p.

 

I assume GPU passthrough dosen't have this problem.

Link to comment
Share on other sites

Ah yes, the QXL driver should have at least 16mb vRAM...sorry virt-manager takes care of this automatically so didn't think about the qemu command line equivalents, just checked and you need something like the following...

-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2

Your correct on the passthrough front...the passthrough card has the onboard ram for itself so not even a consideration for the vm.

Link to comment
Share on other sites

So i can't really test that since the system broke for some reason. Back to square one and trying to get the installer/system to boot again.

 

It wont boot at all, it shows a row of plus signs then reboots. (Any thoughts on this? tried adding HFSplus.efi

Note: This occurs even when i boot with regular QXL driver and no changes to vRAM

Link to comment
Share on other sites

Are you telling Clover to boot with the -v option to generate kernel output?

 

Regards the Clover drivers...if Clover is showing you the drives you can boot and the install .iso is being listed then you have all the drivers needed.

 

One other kernel parameter which sometimes brings goodness is UseKernelCache=No

Link to comment
Share on other sites

Booting the ISO or the preinstalled system does not work.

 

Even tried the UseKernelCache flag, but the outcome was the same.

 

I always boot with -v boot flag so i know where it gets stuck. But in this case it does not generate any kernel log, it just shows a row of plus signs then reboots.

Link to comment
Share on other sites

But you got this working already right? What changed? The ++++ output is Clover doing its stuff so no other output would suggest no kernel is being loaded which is really odd if Clover is showing you the option to boot from the iso! Have you tried deleting the hard disk image and recreating that as a blank file?

Link to comment
Share on other sites

No, i will give it a shot now.

 

As to what changed i have no clue. To be honest i didn't touch it post install.

 

Well.... i changed the clover resolution to 1080p. That caused too much screen tearing so i mounted the image file in linux and changed it back. This occured after that

 

Edit: Blank hdd image makes no change

 

After the plus signs a message quickly pops up "Graphics console started" then reboots. This didnt happen before

Link to comment
Share on other sites

Hey All,

 

I have taken apart @waschbenzin posted config.plist from here:

 

http://www.insanelymac.com/forum/topic/309087-insanely-fast-virtual-mac-qemu-ovmf-clover-and-native-graphics/page-4?do=findComment&comment=2185771

 

 

I ran through each config option in the current release of Clover Configurator to update my instructions and to generate an almost identical config.plist file.  I also switched over from a physical usb drive to a raw disk image using dd.

 

But on boot I get the Clover screen (yay) but on selecting Install I get:

Boot Failed. EFI Floppy
Boot Failed. EFI Floppy 1
KVM internal error. Suberror: 1
emulation failure
RAX=0000000000000000 RBX=000000007dd22018 RCX=0000000000000000 RDX=000000007e377e60
RSI=000000007e377e60 RDI=0000000000007297 RBP=000000007e3665b2 RSP=000000007ff5b7c8
R8 =000000007e37d4c0 R9 =0000000000000004 R10=000000007e336ffc R11=000000007ee4d2af
R12=000000007ee4a018 R13=000000007e36dff9 R14=000000007e33c98f R15=000000007e34d87b
RIP=00000000000b0000 RFL=00010246 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0030 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA]
CS =0038 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA]
SS =0030 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA]
DS =0030 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA]
FS =0030 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA]
GS =0030 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA]
LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT
TR =0000 0000000000000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT= 000000007fed8f18 00000047
IDT= 000000007f7e6018 00000fff
CR0=80000033 CR2=0000000000000000 CR3=000000007fefa000 CR4=00000668
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000500
Code=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <ff> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

My updated instructions, with the Clover Configurator steps are here:

https://gist.github.com/gordonturner/2a2e5ecde5e7860b52e2

 

 

With screenshots of Clover Configurator here:

http://downloads.gordonturner.ca/clover/

 

I am hoping there is some simple and obvious error? 

 

Thanks!

Link to comment
Share on other sites

No, i will give it a shot now.

 

As to what changed i have no clue. To be honest i didn't touch it post install.

 

Well.... i changed the clover resolution to 1080p. That caused too much screen tearing so i mounted the image file in linux and changed it back. This occured after that

 

Edit: Blank hdd image makes no change

 

After the plus signs a message quickly pops up "Graphics console started" then reboots. This didnt happen before

Post back your full qemu command line please, will give this a try myself to see if anything jumps out.

Link to comment
Share on other sites

@KillerKelvUK

qemu-system-x86_64 \
-enable-kvm \
-bios OVMF-pure-efi.fd \
-m 2048 \
-cpu core2duo,vendor=GenuineIntel \
-smp 4,sockets=1,cores=2,threads=2 \
-machine q35,accel=kvm,usb=off,vmport=off \
-rtc base=localtime \
-smbios type=2 \
-device isa-applesmc,osk="derp" \
-device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
-device ahci,id=sata0,bus=pci.2,addr=0x5 \
-device ich9-usb-uhci1,id=usb,bus=pci.2,addr=0x3 \
-drive file=mac_hdd.img,if=none,id=drive-sata0-0-2,format=raw \
-device ide-hd,bus=ide.2,drive=drive-sata0-0-2,id=sata0-0-2 \
-drive file=./live_new.raw,if=none,media=disk,id=drive-sata0-0-0,format=raw \
-device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-drive file=OSX.iso,if=none,media=cdrom,id=drive-sata0-0-1,readonly=on,format=raw \
-device ide-cd,bus=ide.0,drive=drive-sata0-0-1,id=sata0-0-1 \
-device piix4-usb-uhci,id=usbbus \
-device usb-mouse \
-device usb-kbd \
-vga qxl


Link to comment
Share on other sites

@ThatGordo, I've not looked in detail but couple of things stand out...

 

1) Your Clover config includes drop tables, CPU speed selections and other configurations that I've not had put in place to get this working.  Indeed this full thread suggests that the simpler the better for the Clover config so I'd go right back to basics and follow the very first post and ignore the subsequent post of the config.plist...that post even points out that its likely broken due to the editing s/he did.

 

2) Your guide shows you building everything even OVMF...I get the driver for wanting to do all of this but how are you validating at each step your 100%?  My recommendation would be to keep this simple and use built binaries from reputable sources, once you have it working you can then move into building your own to replace those you've acquired.

 

Did you build the kvm modules as well or are these from the distro's repos?

Link to comment
Share on other sites

@KillerKelvUK, thanks for the suggestions

 

1) I am having difficulty determining what is the minimum required Clover configuration.  I am pretty sure the cpu qemu and speed BusSpeedkHz are required.  Can you suggest (or point to comments/downloads) which other configuration elements are recommended?

 

2) The OVMF from http://www.tianocore.org/ovmf/is very out of date (as you correctly pointed out earlier).  The link, also provided earlier, to https://www.kraxel.org/repos/jenkins/edk2/ appears to be the nightly builds of OVMF, which is effectively what I checked out and built as well.

 

I am using the ubuntu 15.10 provided kvm and qemu, nothing fancy there.

Link to comment
Share on other sites

@ThatGordo

 

I had this issue, but i dont remeber exactly how i solved it, since my system ended up breaking.

 

Firstly is the DSDT file in EFI/CLOVER/BOOT/ACPI/origin/?

 

Also according to page 2 of this forum, you need to manually add QEMU boolean key into the config.plist (check there for instructions). Is this value there? Clover configurator has a tendencey to remove this everytime it is used. Before taking a dd dump, check if that qemu entry is there.

Link to comment
Share on other sites

@KillerKelvUK, thanks for the suggestions

 

1) I am having difficulty determining what is the minimum required Clover configuration.  I am pretty sure the cpu qemu and speed BusSpeedkHz are required.  Can you suggest (or point to comments/downloads) which other configuration elements are recommended?

 

The qemu option is located on the CPU page of Clover Configurator, if you aren't using this and building up a file manually then okay but your inclusion of it is fine and required to my understanding.  The cpu speed however I understand to be an old bug in Clover that was fixed in an earlier/latest release.  I've never specified a CPU speed either manually or using Clover Configurator and my vm works fine.

 

However you have also specified drop tables for the ACPI configuration, I can't imagine that will help as the DSDT for qemu's q35 chipset has been specifically written as such thus removing some of its configurations via drops won't be helping IMO.

Link to comment
Share on other sites

 Share

×
×
  • Create New...