- 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: http://www.osxbook.com/book/bonus/chapter7/tpmdrmmyth/ https://bbs.archlinux.org/viewtopic.php?id=162768
-
2015-12-09: The value appears to be a constant string
-
On an Apple computer running OS X, create install USB drive.
-
Run Disk Utilty
-
Select the USB device (not a partition of the device) in the left pane
-
If on 10.11 or later:
- Click
Partitiontab, ensure there is a single partition - Set Name to
Untitled, Format toOS X Extended (Journaled) - Click
Applybutton - Confirm
Partition Mapis set toGUID Partition Map
- Click
-
If on 10.10 or earler, confirm
Partition Mapis set toGUID Partition Map- Click
Partitiontab - In
Partition Layout, select1 Partitionin the - Click
Optionsbutton, selectGUID Partition Table, click OK - Change Name to
Untitled - Change Format type to
Mac OS Extended (Journaled) - Click Apply, then Partition
- Click
-
Once partitioning is complete, click
Done -
Close Disk Utility
-
For El Capitan, default Application location:
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia \
--volume /Volumes/Untitled \
--applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app \
--nointeraction
- For El Capitan, after Application moved and renamed:
sudo /Users/USERNAME/Documents/Disk\ Images/Apple\ OS\ X/10.11\ El\ Capitan/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia \
--volume /Volumes/Untitled \
--applicationpath /Users/USERNAME/Documents/Disk\ Images/Apple\ OS\ X/10.11\ El\ Capitan/Install\ OS\ X\ El\ Capitan.app \
--nointeraction
- 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
-
TODO: Complete seciton
-
Mount the EFI partition (if not mounted):
diskutil list
[...]
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *15.6 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS Install OS X El Capitan 15.3 GB disk2s2
diskutil mount /dev/disk2s1
- On the EFI partition edit
/EFI/CLOVER/configur.plistto configure Clover to include:- qemu cpu flag
- HFS efi driver
- 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
- 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="LOOK-IT-UP" \
-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 KVM_HOST
-
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 -
NOTE: Black screen, no progress.
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