- Ubuntu 15.10
- kvm and qemu packages installed
- VM images and resources in
/vm/
- On Linux kvm host, download OVMF:
http://www.tianocore.org/ovmf/
- Create an OVMF BIOS directory for OSX:
sudo mkdir /vm/osx-ovmf-bios
sudo mv ~/Downloads/OVMF.fd /vm/osx-ovmf-bios/bios.bin
- On an Apple computer running OS X, SMC osk value, see:
KVM OSX Guest SMC Read.md - 2015-12-09: The value appears to be a constant string:
DEEEERP!
- On an Apple computer running OS X, create install USB drive, see:
OSX Creating USB Install - OSX.md
- On an Apple computer running OS X, download
Clover_v2.3k_r3330.pkgfrom:
http://sourceforge.net/projects/cloverefiboot/files/?source=typ_redirect
-
Run
Clover_v2.3k_r3330.pkg -
Click
ContinueuntilInstallation Typescreen -
On
Installation Typescreen, clickChange Install Location... -
On
Destination Selectscreen, select the Install USB drive as destination, clickContinue -
Back on
Installation Typescreen, clickCustomize -
On
Custom Install on "..."screen selectInstall for UEFI booting only- This should automatically select
Install Clover in the ESP - This should automatically unselect
Bootloader, Don't update MBR and PBR sectors - This should automatically unselect
CloverEFI, CloverEFI 64-bits SATA
- This should automatically select
-
On
Custom Install on "..."screen selectThemes -
On
Custom Install on "..."screen selectDrivers64UEFI, OsxAptioDrv-64 -
Reference:
- Remove install USB drive from Apple computer running OS X and plug in to Linux kvm host.
- Determine usb device
- After plug in, run dmesg:
dmesg
[1129574.519912] kvm: zapping shadow pages for mmio generation wraparound
[1129718.445605] kvm [27208]: vcpu0 ignored rdmsr: 0x199
[1129718.446369] kvm [27208]: vcpu0 ignored rdmsr: 0x199
[1129752.993074] kvm [27208]: vcpu0 ignored rdmsr: 0x199
[1129752.993818] kvm [27208]: vcpu0 ignored rdmsr: 0x199
[1129766.396092] kvm [27208]: vcpu0 ignored rdmsr: 0x199
[1129766.396841] kvm [27208]: vcpu0 ignored rdmsr: 0x199
[1129826.468043] kvm: zapping shadow pages for mmio generation wraparound
[1129870.277371] kvm [27218]: vcpu0 ignored rdmsr: 0x199
[1129870.278097] kvm [27218]: vcpu0 ignored rdmsr: 0x199
[1130438.919198] sdb: sdb1 sdb2
- Add to qemu startup, where /dev/sdb is device:
-hdb /dev/sdb
- Reference:
http://www.linux-kvm.org/page/USB_Host_Device_Assigned_to_Guest http://unix.stackexchange.com/questions/37779/how-do-i-boot-from-a-liveusb-using-qemu-kvm
- On Linux kvm host, create a disk image:
sudo qemu-img create -f qcow2 /vm/osx-disk0.qcow2 200G
- Ignore MSR readout on host by VM:
sudo su -
echo 1 > /sys/module/kvm/parameters/ignore_msrs
- NOTE: This was included by Gabriel L. Somlo for Yosemite:
http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/
- On Linux kvm host, start qemu:
cd /vm/
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="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" \
-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
- Connect a VNC client to Linux kvm host
- Tunnel 5901 over ssh:
ssh -L 5910:127.0.0.1:5901 kvm2
-
Connect a VNC client to 127.0.0.1 5710
-
At
boot, type:
"KernelBooter_kexts"="Yes" "CsrActiveConfig"="103"
- At Clover boot screen, choose
Boot OS X Install from OS X Install OS X El Capitan
Please ensure you have at least EFI/CLOVER/drivers64UEFI/DataHubDxe-64.efi in your clover image
By adding this driver, the KVM internal error should dissapear