Jump to content

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


514 posts in this topic

Recommended Posts

No, I still failed to get my USB 3.0 controller to passthrough. I can type from my keyboard which is attached to the USB controller on Clover menu, but as soon as OS X El Capitan boots it completely disables it. I even can see my USB tree on the System Profiler (even my Logitech F510 gamepad is detected) but somehow it doesn't work. Probably we need to make OS X thinks that it is an Intel USB controller not a Renesas (mine at least). I workaround it by using Synergy for mouse+keyboard and NoMachine Audio adapter for the audio.

 

Have you tried passing through USB devices individually rather than the entire controller? This works for me.

 

 

  1. <hostdev mode=’subsystem’ type=’usb’ managed=’no’>

    <source>

    <vendor id=’0x0500’/>

    <product id=’0x14f7/>

    </source>

    </hostdev>

My system refuses to boot when I passthrough the entire USB controller, It might be a hardware/osx compatibility problem.

Link to comment
Share on other sites

I'm passing through my intel usb controller without problems:

 

00:14.0 USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller
00:1a.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #2
00:1d.0 USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #1
 
You can passthrough individual usb devices, but make sure that osx supports the virtual usb controller.
  • Like 1
Link to comment
Share on other sites

I'm doing this BEFORE I start the vm

 

echo "8086 8cb1" > /sys/bus/pci/drivers/vfio-pci/new_id 
echo 0000:00:14.0 > /sys/bus/pci/devices/0000\:00\:14.0/driver/unbind 
echo 0000:00:14.0 > /sys/bus/pci/drivers/vfio-pci/bind 


echo "8086 8cad" > /sys/bus/pci/drivers/vfio-pci/new_id 
echo 0000:00:1a.0 > /sys/bus/pci/devices/0000\:00\:1a.0/driver/unbind 
echo 0000:00:1a.0 > /sys/bus/pci/drivers/vfio-pci/bind 


echo "8086 8ca6" > /sys/bus/pci/drivers/vfio-pci/new_id 
echo 0000:00:1d.0 > /sys/bus/pci/devices/0000\:00\:1d.0/driver/unbind 
echo 0000:00:1d.0 > /sys/bus/pci/drivers/vfio-pci/bind

and this AFTER the vm is shut down:

 

echo 0000:00:14.0 > /sys/bus/pci/devices/0000\:00\:14.0/driver/unbind 
echo 0000:00:14.0 > /sys/bus/pci/drivers/xhci_hcd/bind 


echo 0000:00:1a.0 > /sys/bus/pci/devices/0000\:00\:1a.0/driver/unbind 
echo 0000:00:1a.0 > /sys/bus/pci/drivers/ehci-pci/bind 


echo 0000:00:1d.0 > /sys/bus/pci/devices/0000\:00\:1d.0/driver/unbind 
echo 0000:00:1d.0 > /sys/bus/pci/drivers/ehci-pci/bind

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi!

 

Is somebody have some solution for the virtio-net issue?

I have a 10gbe connection on the host where I would like to play with Yosemite or El Capitan, and only this thing is the dealbreaker. :(

 

The e1000-82545em can push only about 830-850mbits/sec, measured with iperf.... :(

On Windows guests, with the windows version of the virtio-net driver, I can reach 9-9.5Gb/sec.

 

Really no solution for the OS X version virtio-net kext for Yosemite and/or El Capitan? No any chance?

 

Thanks for reply!

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I have been trying to get 10.11 running on QEMU/KVM and been looking everywhere for instructions

 

So far i have a working install on VMware (not vanilla).

 

I have used that to download a vanilla image and i would like to install that on my QEMU system.

 

So far i have tried:

Convert VDI to RAW and boot using UEFI (OVMF) BIOS

Use script to make 10.11 ISO and boot that (Script in original post)

Try to Boot ISO in legacy, kept saying "/mach_kernel" not found (clover) and for OSX installer it kept saying "/System/Kernels/kernel" not found

 

Neither of these methods have worked.

 

I have working:

UEFI bios booting (clover)

 

Host: Arch linux, 64bit, Kernel 4.2.5

 

You mentioned that we can use the createinstallmedia thing.

 

Can you please explain the process on how to use it, what ever it is. (i assume its a script that generates a bootable iso?)

 

Here is my launch script.

Note: This script has been throught many changes just trying to get it to boot. There may be redundant stuff, or something that may break it. Please let me know.

qemu-system-x86_64 -enable-kvm -m 4096 \
          -cpu core2duo,kvm=off,vendor=GenuineIntel \
          -machine q35 \
          -bios OVMF-pure-efi.fd \
          -kernel ./clover-debug-test.dd \
          -usb -device usb-kbd -device usb-mouse \
          -device isa-applesmc,osk="Derp" \
          -device ide-drive,bus=ide.2,drive=MacHDD \
          -drive id=MacHDD,if=none,file=./vm.raw,format=raw \
          -netdev user,id=hub0port0 \
          -device e1000-82545em,netdev=hub0port0,id=mac_vnet0 \
          -monitor stdio \
          -smp 2 \
          -device ide-drive,bus=ide.3,drive=Clover \
          -drive id=Clover,if=none,file=./clover-debug-test.dd,format=raw

In this case, vm.raw is the VDI (post installiation and setup OSX, default bootloader) file converted to RAW using  "VmwareManage clone...."

  • Like 1
Link to comment
Share on other sites

@pscosx

I haven't managed to do it so far. I have no idea what the problem with the old driver is. I would be willing to donate a few bucks to anyone getting this working... 

 

@Maclarentosh

The 'createinstallmedia'-method creates a bootable USB drive. It's described here: https://support.apple.com/en-us/HT201372 .

 

@NSCXP2005

You need to use a Linux host and the main keywords you need to look for are 'VGA passthrough' or 'PCI passthrough'. AFAIK you need a CPU with VT-d support and a few other hardware requirements related to IOMMU. Just google for a guide and get comfortable with passing through your graphics card to a Linux or Windows guest. There seems to be a special linux distribution called unRAID that was made for this scenario, but it isn't free. I got it working with Arch and Ubuntu, but it needs some work...

Also look for a guide on how to use the Intel HD 4000 on OSX. 

Link to comment
Share on other sites

Have you tried passing through USB devices individually rather than the entire controller? This works for me.

 

 

  1. <hostdev mode=’subsystem’ type=’usb’ managed=’no’>

    <source>

    <vendor id=’0x0500’/>

    <product id=’0x14f7/>

    </source>

    </hostdev>

My system refuses to boot when I passthrough the entire USB controller, It might be a hardware/osx compatibility problem.

 

Hey, using virt-manager (libvirt) and it won't allow me to pass through just a usb device without an associated virtual controller being defined in the guest.  Problem is I cannot get El Cap to boot when a virtual USB controller is added into the guest spec's...can you confirm how your config is setup with the above?

 

I've gotten this fully working just using qemu on its own, am simply trying to transition to libvirt as I use virt-manager for everything (yes lazy I know)!  From my works so far I can see that the 'qemu -usbdevice host:x:x' is legacy and whilst this works for qemu alone libvirt updates this to 'qemu -device usb-host:bus:addr:id'...this introduces the problem where qemu then complains about not having a usb bus to attach the pass thru usb-host to.  <_<

 

Any suggestions appreciated.

 

EDIT:

So actually the problem was to do with OVMF causing a system hang, 'qemu -bios OVMF.fd' works fine, however libvirt/virt-manager attempts to get too clever and overcomplicated the equivalent...regressing the libvirt xml to '<loader type='rom'>OVMF.fd</loader>' resolved my boot hang.  Then I just used a simple usb2 controller and my problems were all resolved...for now :-)

Link to comment
Share on other sites

Hi

 

How did you create the bootable live image?

 

I used the createinstallmedia tool and wrote it out to an virtual hard disk (VMDK) and tried to convert to raw then boot, but this failed.

 

What happens:

Clover sees picks up that there is a parition but when i press enter on it, the qemu-system "reboots" meaning i see the tiano-core logo again and it just boots back into clover

 

Right now i am trying to make a new file throught "qemu-img create live.iso 10G" and will add as a SATA drive in my VM and use the tool again to make this a bootable media

Link to comment
Share on other sites

@KillerKelvUK

 

The ISO i have been using so far has been generated by the commands on that page, but they are in a script.  The iso when attached as a Mac-DVD is not picked up by clover.

Okay so for me this problem wasn't the iso but OVMF...the key for me was that if OVMF couldn't see the drives then Clover could see them.  My problem was that the version of OVMF I was originally using didn't have support for ACHI/SATA devices (only virtio-scsi), upgrading OVMF added the needed ACHI/SATA capability.  After the upgrade whilst OVMF couldn't do anything with the .iso itself it did enable Clover to then find it and boot it as necessary.

 

If you need it the latest builds of OVMF they can be found in Gerd's repo (https://www.kraxel.org/repos/jenkins/edk2/).  Shout if you need more help with this.

Link to comment
Share on other sites

Hi,

 

@KillerKelvUK

 

So what i did:

Remake the entire ISO using the commands provided in the link posted (http://anadoxin.org/blog/creating-a-bootable-el-capitan-iso-image.html)

Download latest OVMF form the link provided in the previous post (Downloaded the x64 OVMF rpm package and extracted OVMF-pure-efi file from ovmf-64 directory) {Is this wrong? do i need to build from source?}

Attached ISO as Mac-DVD and tried to boot it.

 

What happens:

System boots

TianoCore logo pops up

Black screen with text "Boot failed. Efi drive \n Boot failed. Efi drive 1"

Clover loades

Clover does not pick up any drives or partitions

 

Update:

So rather than mounting the ISO as a Mac-dvd i simply mounted it as "-cdrom image.iso"

It is now picked up by clover but when i press enter on it a row of pluses shows up, then the system reboots

Link to comment
Share on other sites

Post back your full command line please, when I'm back on my desktop I'll share mine also. Sounds like a config issue.

So this is my functioning qemu command-line...

qemu-system-x86_64 \
-name Mac_tester \
-enable-kvm \
-bios OVMF.fd \
-m 4096 \
-cpu core2duo,vendor=GenuineIntel \
-smp 4,sockets=1,cores=2,threads=2 \
-machine pc-q35-2.5,accel=kvm,usb=off,vmport=off \
-rtc base=localtime \
-device isa-applesmc,osk="xxx" \
-smbios type=2 \
-vga none \
-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 piix3-usb-uhci,id=usb,bus=pci.2,addr=0x3 \
-device usb-host,hostbus=1,hostaddr=38,id=hostdev1 \
-drive file=/mnt/share/Downloads/qemu_test/Clover_usb.dd,if=none,id=drive-sata0-0-2,format=raw \
-device ide-hd,bus=ide.2,drive=drive-sata0-0-2,id=sata0-0-2,bootindex=1 \
-drive file=/mnt/share/Downloads/qemu_test/Macintosh_HD.qcow2,if=none,media=disk,id=drive-sata0-0-0,format=qcow2 \
-device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0 \
-netdev tap,id=hostnet0,ifname=tap0,script=/mnt/share/Downloads/qemu_test/qemu_br0_ifup.sh,downscript=/mnt/share/Downloads/qemu_test/qemu_br0_ifdown.sh \
-device e1000-82545em,netdev=hostnet0,id=tap0,mac=`source /mnt/share/Downloads/qemu_test/genmac.sh` \
-device vfio-pci,host=01:00.0,id=hostdev2,bus=pci.2,addr=0x1,multifunction=on \
-device vfio-pci,host=01:00.1,id=hostdev3,bus=pci.2,addr=0x2 \
-drive file="/mnt/share/Filestorage/Images/Mac OS X 10.11.2 El Capitan.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

It should be legacy free as I spent a little time updating the arguments to later standards.  Actually I think I've gone a little further and updated the USB Controller to USB2 which replaces the piix3-usb-uchi device...USB3 didn't work once OSX had booted.

 

The network scripts are just to add a tap device to bridge into my local network and add the VM into the same subnet as the rest of my network, that way the VM can easily access a samba server amongst others within my local network.  NOTE:  these are not needed once you transition to libvirt/virt-manager as virt-manager handles the creation and removal of all tap devices itself.

Link to comment
Share on other sites

Hi,

 

The script i am running is:

qemu-system-x86_64 -enable-kvm -m 4096 \
          -cpu core2duo,kvm=off,vendor=GenuineIntel \
	  -machine q35 \
	  -bios OVMF-pure-efi.fd \
	  -usb -device usb-kbd -device usb-mouse \
	  -device isa-applesmc,osk="derp" \
	  -device ide-drive,bus=ide.0,drive=MacHDD \
	  -drive id=MacHDD,if=none,file=./mac_hdd.img,format=raw \
	  -netdev user,id=hub0port0 \
	  -device e1000-82545em,netdev=hub0port0,id=mac_vnet0 \
	  -monitor stdio \
	  -smp 2 \
	  -device ide-drive,bus=ide.3,drive=Clover \
	  -drive id=Clover,if=none,file=./clover.dd,format=raw \
	  -cdrom OSX.iso

clover.dd (version 3330) is a dd dump of clover installed through a VM.

Now the system hangs on a black screen (waited for 5 mins) no output. I always boot with -v

Link to comment
Share on other sites

Hi,

 

The script i am running is:

qemu-system-x86_64 -enable-kvm -m 4096 \
          -cpu core2duo,kvm=off,vendor=GenuineIntel \
	  -machine q35 \
	  -bios OVMF-pure-efi.fd \
	  -usb -device usb-kbd -device usb-mouse \
	  -device isa-applesmc,osk="derp" \
	  -device ide-drive,bus=ide.0,drive=MacHDD \
	  -drive id=MacHDD,if=none,file=./mac_hdd.img,format=raw \
	  -netdev user,id=hub0port0 \
	  -device e1000-82545em,netdev=hub0port0,id=mac_vnet0 \
	  -monitor stdio \
	  -smp 2 \
	  -device ide-drive,bus=ide.3,drive=Clover \
	  -drive id=Clover,if=none,file=./clover.dd,format=raw \
	  -cdrom OSX.iso

clover.dd is a dd dump of clover installed through a VM.

Now the system hangs on a black screen (waited for 5 mins) no output. I always boot with -v

So those lines look like you've sourced them from a legacy seabios/chameleon guide but you've modified them to replace seabios with OVMF and chameleon with clover...however I don't see any passthru device?  Are you wanting to passthru a GFX card?  I'd say part of your problem with the above is you have no GFX hardware at all; neither physical (passthru) or virtual e.g. QXL.  What's your end goal with this?

Link to comment
Share on other sites

 

So those lines look like you've sourced them from a legacy seabios/chameleon guide but you've modified them to replace seabios with OVMF and chameleon with clover...however I don't see any passthru device?  Are you wanting to passthru a GFX card?  I'd say part of your problem with the above is you have no GFX hardware at all; neither physical (passthru) or virtual e.g. QXL.  What's your end goal with this?

 

 

Hi,

 

From what i understand GPU passthrough is only for dedicated GPUs. I looked into this a bit. I would like to do passthrough i simply dont know how to get it working with an intel HD 4000. But so far my aim has just been trying to get the base system installed. My end goal is simply to get a QEMU system running OSX 10.11.

 

Testing with "-vga qxl"

  • Like 1
Link to comment
Share on other sites

Hi,

 

From what i understand GPU passthrough is only for dedicated GPUs. I looked into this a bit. I would like to do passthrough i simply dont know how to get it working with an intel HD 4000. But so far my aim has just been trying to get the base system installed. My end goal is simply to get a QEMU system running OSX 10.11.

 

Testing with "-vga qxl"

Okay then so wrong thread hence the confusion, thought you were on topic about ovmf+clover+vfio...maybe start a new thread if you're still stuck after this...

 

Below is my seabios+chameleon command-line, i didn't update this past Yosemite so you'll need to either grab the latest version of chameleon and amend or butcher from the below and work in OVMF+Clover...I'd say the later is more complicated and if you're new to this then I'd revert right back to basics.  Also not that the qemu arguments are legacy mostly, I've not updated this one so it doesn't translate into libvirt xml very well/if at all...

#Seabios + Chameleon (Non-Passthrough)
qemu-system-x86_64 \
-name Mac_tester \
-enable-kvm \
-m 4096 \
-cpu core2duo,vendor=GenuineIntel \
-smp 4,sockets=1,cores=2,threads=2 \
-machine pc-q35-2.5,accel=kvm,usb=off,vmport=off \
-rtc base=localtime \
-usb -device usb-kbd -device usb-mouse \
-device isa-applesmc,osk="xxx" \
-kernel /mnt/share/Filestorage/Software/Drivers/chameleon_svn2534_boot \
-smbios type=2 \
-vga qxl \
-spice port=5905,disable-ticketing \
-device ide-drive,bus=ide.1,drive=MacHDD \
-drive id=MacHDD,if=none,file=/mnt/share/Downloads/qemu_test/Macintosh_HD.qcow2 \
-netdev tap,id=hostnet0,ifname=tap0,script=/mnt/share/Downloads/qemu_test/qemu_br0_ifup.sh,downscript=/mnt/share/Downloads/qemu_test/qemu_br0_ifdown.sh \
-device e1000-82545em,netdev=hostnet0,id=tap0,mac=`source /mnt/share/Downloads/qemu_test/genmac.sh` \
-device ide-drive,bus=ide.0,drive=MacDVD \
-drive id=MacDVD,if=none,snapshot=on,file="/mnt/share/Filestorage/Images/Mac OS X 10.10.1 Yosemite.iso"
Link to comment
Share on other sites

Hey all,

 

I have a Ubuntu 15.10 based kvm / qemu host trying to boot 10.11 El Capitan from a USB drive that has been passed through to the vm.  The USB drive has Clover (v3330) installed and I am using OVMF (OVMF-X64-r15214).

 

I can see OVMF start, boot to Clover and see the correct USB partition, but when selecting the partition and hitting enter, I get a black screen (similar to Maclarentosh it sounds).

 

 

My goal is to connect over vnc to the machine and to run it headless, using it for a Xcode / Jenkins build machine.

 

My start up is:



sudo qemu-system-x86_64 \
-enable-kvm \
-m 8192 \
-cpu core2duo,kvm=off,vendor=GenuineIntel \
-smp 6,sockets=1,cores=3,threads=2 \
-vga std \
-bios /vm/osx-ovmf-bios/bios.bin \
-usb \
-smbios type=2 \
-net none \
-device isa-applesmc,osk="DEEEEERRRRP" \
-device piix4-usb-uhci,id=usbbus \
-usb -usbdevice disk:format=raw:/dev/sdb \
-device ahci,id=ide \
-device ide-drive,bus=ide.2,drive=MacHDD \
-drive id=MacHDD,if=none,file=/vm/demo1-disk0.qcow2 \
-monitor stdio -S \
-vnc :1 


 

And I have detailed my complete setup instructions here:

 


 

I am at a loss as to the cause of the black screen and I have not been able to get any debug details from Clover or OS X in verbose mode.

 

Any help would be appreciated.

 

Thanks!

Gord.

  • Like 1
Link to comment
Share on other sites

The below works for me, I suspect your problems to be a mixture of using old OVMF images (@ThatGord, your linked OVMF to tinacore's site is ancient, read a few posts further up this thread where I direct to a maintained repo for up-to-date builds) and bad Clover installs.  You need to ensure Clover is configured with "Install for UEFI booting only" and include from the 'Drviers64UEFI' section "DataHubDxe-64" as well as at least one theme. After this you'll need the dsdt noted at the start of this thread as well as the fixes which are all applied using Clover Configurator.  Also using Clover Configurator go to 'Install Drivers' and  from the 'Extra Drivers' section add in "HFSPlus UEFI".

qemu-system-x86_64 \
-name Mac_tester \
-enable-kvm \
-bios OVMF.fd \
-m 4096 \
-cpu core2duo,vendor=GenuineIntel \
-smp 4,sockets=1,cores=2,threads=2 \
-machine pc-q35-2.5,accel=kvm,usb=off,vmport=off \
-rtc base=localtime \
-device isa-applesmc,osk="xxx" \
-smbios type=2 \
-vga qxl \
-spice port=5905,disable-ticketing \
-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=/mnt/share/Filestorage/Software/Drivers/Clover.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,bootindex=1 \
-drive file=./Macintosh_HD.qcow2,if=none,media=disk,id=drive-sata0-0-0,format=qcow2 \
-device ide-hd,bus=sata0.0,drive=drive-sata0-0-0,id=sata0-0-0 \
-netdev tap,id=hostnet0,ifname=tap0,script=./qemu_br0_ifup.sh,downscript=./qemu_br0_ifdown.sh \
-device e1000-82545em,netdev=hostnet0,id=tap0,mac=`source ./genmac.sh` \
-drive file="/mnt/share/Filestorage/Images/Mac OS X 10.11.2 El Capitan.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

NOTE: I've also found it important to ensure the mapped Clover image is set as boot device for qemu to use i.e. bootindex=1, without this I observed OVMF failing to load anything and in some cases not being able to see the Clover image itself.

Link to comment
Share on other sites

 Share

×
×
  • Create New...