-
Some notes about this approach:
- An OSX Installer USB drive for
Install OS X El Capitanis created - Clover is then installed on the USB drive
- Clover Configurator is then run on the USB drive
- The USB drive contents are copied to the VM host
- VNC is used to connect to the guest UI
- The qxl virtual video device is used (part of the standard kvm qemu install)
- No video card PCI passthrough is used
- At then of the install OSX Screen Sharing is turned on
- An OSX Installer USB drive for
-
VM Host Ubuntu 15.10 (x86_64) server
-
Standard kvm, qemu packages installed
-
All updates applied (2016-02-20)
-
VM images and resources in
/vm/ -
Supporting MacBook Air used to create USB keys and perform most of work
-
OSX 10.11.3
-
All updated applied (2016-02-20)
- qemu documentation:
http://wiki.qemu.org/download/qemu-doc.html
- clover documentation:
http://clover-wiki.zetam.org/Configuration
A quick not about screen resolution.
OVMF and Clover screen sizes must match otherwise the screen will appear mangeled or distorted.
For purposes of these instructions a resolution of 800x600 will be used.
TODO: Change OVMF and Clover resolutions to 1024x768 or 1280x1024
- On Linux kvm host, build OVMF, please see:
https://gist.github.com/gordonturner/85dcc321d2099d610e67
- On OS X running on Apple hardare, to get the value please see:
https://gist.github.com/gordonturner/c33bcc935e32f9fa6695
-
NOTE: 2016-02-20 The value appears to be a constant string
-
Reference:
http://www.osxbook.com/book/bonus/chapter7/tpmdrmmyth/
-
On an Apple computer running OS X, create install USB drive.
-
Run
Disk Utilty -
If on 10.11 or later:
- Select the USB device (not a partition of the device) in the left pane
- Click
Partitiontab, ensure there is a single partition, clickCancelor create single partition - With the USB device selected, click
Erase - Set Name to
Untitled, Format toOS X Extended (Journaled), Scheme toGUID Partition Map - Click
Erasebutton - Confirm
Partition Mapis set toGUID Partition Map
-
If on 10.10 or earler:
- Select the USB device (not a partition of the device) in the left pane
- Click
Partitiontab - In
Partition Layout, select1 Partition - Confirm
Partition Mapis set toGUID Partition Map - Click
Optionsbutton, selectGUID Partition Table, click OK - Change Name to
Untitled - Change Format type to
Mac OS Extended (Journaled) - Click Apply, then Partition
-
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:
export MOVED_LOCATION=~/Documents/Disk\ Images/Apple\ OS\ X/10.11\ El\ Capitan
sudo "$MOVED_LOCATION"/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia \
--volume /Volumes/Untitled \
--applicationpath "$MOVED_LOCATION"/Install\ OS\ X\ El\ Capitan.app \
--nointeraction
- On an Apple computer running OS X, download Clover from:
http://sourceforge.net/projects/cloverefiboot/files/?source=typ_redirect
-
NOTE: 2016-02-20 Current download was
Clover_v2.3k_r3346.pkg -
Run
Clover_v2.3k_r3346.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, BootCamp(or your theme of choice) -
On
Custom Install on "..."screen, selectDrivers64UEFI, DataHubDxe-64 -
On
Custom Install on "..."screen, clickInstall -
Install should take about 3 min on USB 3 device
-
When complete, click
Close -
Two volumes should be mounted when complete:
EFIInstall OS X El Capitan
-
Leave volumes mounted
- Download
q35-acpi-dsdt.aml(clickView Raw):
https://github.com/qemu/qemu/blob/master/pc-bios/q35-acpi-dsdt.aml
-
2016-02-20: commit value
385724e7887670e17865d97cd8106a235f113faa -
Copy to
EFI/CLOVER/ACPI/originon USB boot drive:
cp ~/Downloads/q35-acpi-dsdt.aml /Volumes/ESP/EFI/CLOVER/ACPI/origin/
- Download
HFSPlus.efi(clickView Raw):
https://github.com/JrCs/CloverGrowerPro/blob/master/Files/HFSPlus/X64/HFSPlus.efi
-
2016-02-20: commit value
9fc3991c7a82be1a0d096c3a2179098f35b69264 -
Copy to
EFI/EFI/CLOVER/drivers64UEFI/on USB boot drive:
cp ~/Downloads/HFSPlus.efi /Volumes/ESP/EFI/CLOVER/drivers64UEFI/
- NOTE: No source, license is unclear, free to use
- Download:
http://mackie100projects.altervista.org/
-
NOTE: 2016-01-16 current version is 4.25.0
-
Run
Clover Configurator.appand edit:EFI/EFI/CLOVER/config.plist -
If presented with multiple
config.plistfiles at the bottom of the app screen, select:
EFI/EFI/CLOVER/config.plist
-
Clover Configurator, Acpi
-
See
Clover Configurator-1-Acpi.png -
Root/ACPI/DSDTDictionary-
DebugBoolean YES (Debug) -
NameString q35-acpi-dsdt.aml (DSDT name) -
ReuseFFFFBoolean NO (ReuseFFFF) -
FixesDictionaryNewWay_80000000Boolean YES (New wayNewWay)FixRegions_10000000Boolean YES (New wayFixRegions)FIX_RTC_20000Boolean YES (New wayFIX_RTC)FiX_TMR_40000Boolean YES (New wayFIX_TMR)DeleteUnused_400000Boolean YES (New wayDeleteUnused)FIX_ADP1_800000Boolean YES (New wayFIX_ADP1)AddPNLF_1000000Boolean YES (New wayAddPNLF)FIX_S3D_2000000Boolean YES (New wayFIX_S3D)FIX_ACST_4000000Boolean YES (New wayFIX_ACST)FixSBUS_0080Boolean YES (Unclear)
-
Drop OEM_DSMBoolean NO (Drop OEM_DSM)- NOTE: Not required, remove from config.plist - `Root/ACPI/DropTables` Array (Drop Tables) - `Item0` Dictionary (`Signature*, Type/key, String/Number`) - `Signature` String `SSDT` (`SSDT, TableId, CpuPm`) - `TableId` String `CpuPm` - `Item1` Dictionary (`Signature*, Type/key, String/Number`) - `Signature` String `DMAR` (`DMAR, ,`) - `Item2` Dictionary (`Signature*, Type/key, String/Number`) - `Signature` String `SSDT` (`SSDT, TableId, Cpu0Ist`) - `TableId` String `Cpu0Ist` - `Root/ACPI/SSDT` Dictionary - `DropOem` Boolean NO (`Drop OEM`) - `Generate` Boolean NO (Unclear `Generate PStates`) - NOTE: Not required, remove from config.plist - `MaxMultiplier` Number 40 (`Min Multiplier`) - `MinMultiplier` Number 40 (`Max Multiplier`)
-
-
Clover Configurator, Boot
-
See
Clover Configurator-2-Boot.png -
Root/BootDictionaryTimeoutNumber 5 (Timeout)ArgumentsString `` (Custom Flags)DebugBoolean NO (Debug)DefaultLoaderStringboot.efi(Default Loader)DefaultVolumeStringOSX(Default Boot Volume)LegacyStringPBR(Legacy)SecureBoolean NO (Secure)XMPDetectionString YES (XMPDetection)
-
NOTE: Uncheck
kext-dev-mode=1rootless=0 -
Clover Configurator, Cpu
-
See
Clover Configurator-3-Cpu.png -
Root/CpuDictionaryQEMUBoolean YES (QEMU)
-
Clover Configurator, Devices
-
See
Clover Configurator-4-Devices.png -
Root/DevicesDictionaryUSBDictionaryInjectBoolean NO (USB, Inject)Add ClockIDBoolean NO (USB, Add ClockID)FixOwnershipBoolean NO (USB, FixOwnership)ResetHDABoolean NO (USB, ResetHDA)
-
NOTE: Uncheck
ResetHDA, setAudioto empty, uncheckAdd ClockID -
Clover Configurator, Disabled Devices
-
See
Clover Configurator-5-Disabled Devices.png -
NOTE: All default values, nothing configured
-
Clover Configurator, Gui
-
See
Clover Configurator-6-Gui.png -
Root/GuiDictionaryMouseDictionaryDoubleClickNumber 500 (Double Click, default value)EnabledBoolean NO (Enabled, default value)MirrorBoolean NO (Mirror, default value)SpeedNumber 8 (Speed, default value)
ScanBoolean YES (Scan, default value)ScreenResolutionString800x600(Screen Resolution, default value)ThemeStringbootcamp(Theme, set from Clover install)
-
NOTE: All default values
-
Clover Configurator, Graphics
-
See
Clover Configurator-7-Graphics.png -
Root/GraphicsDictionaryInjectDictionaryATIBoolean NO (Inject ATI, default value)IntelBoolean NO (Inject Intel, default value)NVidiaBoolean NO (Inject NVidia, default value)
NVidiaSingleBoolean NO (Inject NVidiaSingle, default value)
-
NOTE: All default values
-
Clover Configurator, Kernel and Kext Patches
-
See
Clover Configurator-8-Kernel and Kext Patches.png -
Root/KernelAndKextPatchesDictionaryAppleRTCBoolean NO (Apple RTC)AsusAICPUPMBoolean NO (Asus AICPUPM, default value)DebugBoolean NO (Debug, default value)KernelCpuBoolean NO (Kernel CPU, default value)KernelHaswellEBoolean NO (Kernel HaswellE, default value)KernelLapicBoolean NO (Kernel LAPIC, default value)KernelPmBoolean NO (Kernel Pm, default value)
-
NOTE: All default values, except
Apple RTC, disableApple RTC -
Clover Configurator, Rt Variables
-
See
Clover Configurator-9-RtVariables.png -
Root/RtVariablesDictionaryROMStringUseMacAddr0(ROM, default value)MLBString `` (MLB, deleted value)BooterConfigString0x28(BooterConfig, default value)CsrActiveConfigString0x67(CsrActiveConfig, default value)
-
NOTE: All default values, except
MLB, waschbenzin had value missing in config.plist -
Clover Configurator, SMBIOS
- See `Clover Configurator-10-SMBIOS.png` - `Root/SMBIOS` Dictionary - `ProductName` String `MacPro2,1` (`Product Name`) - `Family` String `Mac Pro` (`Family`) - `Manufacturer` String `Apple Inc.` (`Manufacturer`, default value) - `BiosReleaseDate` String `07/02/07` (`Bios Release Date`) - `BiosVendor` String `Apple Inc.` (`Bios Vendor`) - `Version` String `1.0` (`Version`) - `ChassisManufacturer` String `Apple Inc.` (`Chassis Manufacturer`) - `ChassisAssetTag` String `Pro-Enclosure` (`Chassis Asset Tag`) - `ChassisType` String `06` (`Chassis Type`) - `BoardType` Number `11` (`BoardType`) - `BoardManufacturer` String `Apple Inc.` (`Board Manufacturer`) - `Trust` Boolean NO (`Trust`, default value) - NOTE: MacPro2,1 corresponds to the original Mac Pro: http://www.everymac.com/systems/apple/mac_pro/specs/mac-pro-eight-core-3.0-specs.html -
Root/SMBIOSDictionaryManufacturerStringApple Inc.(Manufacturer, default value)
-
NOTE: All default values
-
Clover Configurator, System Parameters
-
See
Clover Configurator-11-System Parameters.png -
Root/SystemParametersDictionaryProductNameStringDetect(Inject Kexts, default value)InjectSystemIDBoolean YES (Inject System ID, default value)
-
NOTE: All default values
-
Save and exit Clover Configrator
-
Manually edit
EFI/EFI/CLOVER/config.plist:- Paste into
Root/ACPI:
- Paste into
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Debug</key>
<false/>
<key>DropOEM_DSM</key>
<false/>
<key>Fixes</key>
<dict>
<key>AddPNLF_1000000</key>
<true/>
<key>DeleteUnused_400000</key>
<true/>
<key>FIX_ACST_4000000</key>
<true/>
<key>FIX_ADP1_800000</key>
<true/>
<key>FIX_RTC_20000</key>
<true/>
<key>FIX_S3D_2000000</key>
<true/>
<key>FiX_TMR_40000</key>
<true/>
<key>FixRegions_10000000</key>
<true/>
<key>FixSBUS_0080</key>
<true/>
</dict>
<key>Name</key>
<string>q35-acpi-dsdt.aml</string>
<key>ReuseFFFF</key>
<false/>
</dict>
<key>SSDT</key>
<dict>
<key>DropOem</key>
<false/>
<key>Generate</key>
<false/>
</dict>
</dict>
<key>Boot</key>
<dict>
<key>Arguments</key>
<string>-v</string>
-
Remove BusSpeedkHz (Root/CPU/BusSpeedkHz)
-
Keep cpu qemu, confirm YES (Root/CPU/QEMU Boolean YES)
-
Edit ScreenResolution to 800x600:
<key>GUI</key>
<dict>
[...]
<key>ScreenResolution</key>
<string>800x600</string>
- After complete, eject the USB drive.
-
Either dd the USB drive on OSX or use dd on the Linux KVM host, these instructions are for OS X.
-
Plugin the USB drive
-
Find disk:
diskutil list
diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 499.4 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1 (internal, virtual):
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS Macintosh HD +499.0 GB disk1
Logical Volume on disk0s2
653675B9-F842-47A2-A6FD-234EFB6B7648
Unencrypted
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *16.0 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS Install OS X El Capitan 15.7 GB disk2s2
- Run
dd, takes about 10 min on USB 3 device:
sudo dd if=/dev/rdisk2 of=./clover-usb-disk.dd bs=1m
- Copy to host:
scp clover-usb-disk.dd USER@HOST:/home/USER/Downloads
- On kvm host
sudo mv /home/USER/Downloads/clover-usb-disk.dd /vm/
-
Either dd the USB drive on OSX or use dd on the Linux KVM host, these instructions are for Linux.
-
Login to KVM host and run tail on the kernel log to determine device name:
tail -f /var/log/kern.log
- Plugin the USB drive
- Observe the device name:
Feb 20 14:40:58 kvm2 kernel: [13158.166032] usb 4-1.4: new high-speed USB device number 7 using ehci-pci
Feb 20 14:40:58 kvm2 kernel: [13158.261978] usb 4-1.4: New USB device found, idVendor=05dc, idProduct=a833
Feb 20 14:40:58 kvm2 kernel: [13158.261984] usb 4-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 20 14:40:58 kvm2 kernel: [13158.261989] usb 4-1.4: Product: USB Flash Drive
Feb 20 14:40:58 kvm2 kernel: [13158.261992] usb 4-1.4: Manufacturer: Lexar
Feb 20 14:40:58 kvm2 kernel: [13158.261995] usb 4-1.4: SerialNumber: AA7OY8PQBU1UVGRJ
Feb 20 14:40:58 kvm2 kernel: [13158.329307] usb-storage 4-1.4:1.0: USB Mass Storage device detected
Feb 20 14:40:58 kvm2 kernel: [13158.329475] scsi host6: usb-storage 4-1.4:1.0
Feb 20 14:40:58 kvm2 kernel: [13158.329639] usbcore: registered new interface driver usb-storage
Feb 20 14:40:58 kvm2 kernel: [13158.345857] usbcore: registered new interface driver uas
Feb 20 14:41:00 kvm2 kernel: [13159.878847] scsi 6:0:0:0: Direct-Access Lexar USB Flash Drive 1100 PQ: 0 ANSI: 6
Feb 20 14:41:00 kvm2 kernel: [13159.879522] sd 6:0:0:0: Attached scsi generic sg1 type 0
Feb 20 14:41:00 kvm2 kernel: [13159.881104] sd 6:0:0:0: [sdb] 31285248 512-byte logical blocks: (16.0 GB/14.9 GiB)
Feb 20 14:41:00 kvm2 kernel: [13159.882187] sd 6:0:0:0: [sdb] Write Protect is off
Feb 20 14:41:00 kvm2 kernel: [13159.882190] sd 6:0:0:0: [sdb] Mode Sense: 22 00 00 00
Feb 20 14:41:00 kvm2 kernel: [13159.883331] sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Feb 20 14:41:00 kvm2 kernel: [13159.902183] sdb: sdb1 sdb2
Feb 20 14:41:00 kvm2 kernel: [13159.908483] sd 6:0:0:0: [sdb] Attached SCSI removable disk
- In this example
sdbis the device - Run
dd, takes about 10 min on USB 3 device:
sudo dd if=/dev/sdb of=./clover-usb-disk.dd
- 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 appears to reset after a hard reboot, may need to be run as part of a script.
- On Linux kvm host, start qemu:
sudo qemu-system-x86_64 \
-m 4096 \
-enable-kvm \
-cpu core2duo,vendor=GenuineIntel \
-rtc base=localtime \
-smbios type=2 \
-machine q35,accel=kvm,usb=off,vmport=off \
-bios /vm/osx-ovmf-bios-src-build/bios.bin \
-smp 4,sockets=1,cores=2,threads=2 \
-device isa-applesmc,osk="REDACTED" \
\
-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 \
\
-drive file=/vm/clover-usb-disk.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=/vm/osx-disk0.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 \
\
-device e1000-82545em,netdev=Mac,mac=52:54:00:00:00:02 -netdev tap,id=Mac \
\
-usb \
-device usb-mouse \
-device usb-kbd \
-serial stdio \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16 \
-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 Clover boot screen, choose
Boot OS X Install from OS X Install OS X El Capitan
-
During install, first use
Disk Utilityto configure the QEMU drive. -
NOTE: Using vnc to perform the install, there is a frustrating bug with vnc and the OS X installer, the mouse.
-
It is possible to use the Tab key to select and Spacebar to select on most of the inputs, but in some situations it becomes a bit of a game to move the mouse in the guest to the button.
-
Don't worry, once installed and connecting over vnc directly to the guest this is not an issue.
-
On restart, be sure to select the "XXXXXXXX" boot option in Clover.
-
System Preferences,Sharing, enableScreen Sharingand set password -
System Preferences,Energy Saving,Computer sleepset toNever -
System Preferences,Energy Saving,Display sleepset toNever -
Connect to the guest directly, rather then through the host.
-
Rather then constantly editing the USB drive then dd'ing and copying the image around, it is possible to directly edit the disk image
-
First, create a mount points, this step only has to happen once:
sudo mkdir /media/loop
sudo mkdir /media/efi
- Run fdisk to determine the offset of the efi partition:
parted /vm/clover-usb-disk.dd
WARNING: You are not superuser. Watch out for permissions.
GNU Parted 3.2
Using /vm/clover-usb-disk.dd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit
Unit? [compact]? B
(parted) print
Model: (file)
Disk /vm/clover-usb-disk.dd: 16018046976B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 20480B 209735679B 209715200B fat32 EFI System Partition boot, esp
2 209735680B 15883808767B 15674073088B hfs+ Untitled
-
NOTE: The offset, in this case
20480 -
Next, mount the
EFI System Partition:
sudo mount -o rw,loop,offset=20480 /vm/clover-usb-disk.dd /media/loop
- Make changes, ie to edit
config.plist:
sudo vi /media/loop/EFI/CLOVER/config.plist
- Unmount the partition:
sudo umount /media/loop
- Reference: http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux https://major.io/2010/12/14/mounting-a-raw-partition-file-made-with-dd-or-dd_rescue-in-linux/
- Run fdisk to determine the offset of the efi partition:
fdisk -l /vm/clover-usb-disk.dd
- Output:
Disk /vm/clover-usb-disk.dd: 14.9 GiB, 16018046976 bytes, 31285248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2FAED1FF-5343-4827-8FD8-5477D188EA2D
Device Start End Sectors Size Type
/vm/clover-usb-disk.dd1 40 409639 409600 200M EFI System
/vm/clover-usb-disk.dd2 409640 31023063 30613424 14.6G Apple HFS/HFS+
- FYI, possible to run
partedon the disk image too:
sudo parted /vm/clover-usb-disk.dd print
- Output:
Model: (file)
Disk /vm/clover-usb-disk.dd: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 20.5kB 210MB 210MB fat32 EFI System Partition boot, esp
2 210MB 15.9GB 15.7GB hfs+ Untitled
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