Skip to content

Commit ca219f5

Browse files
author
Dhiru Kholia
committed
OSX-KVM - March 2021 - Batch Update 1
Changes: - Upgrade to OpenCore 0.6.7-RELEASE - Big Sur image building script updates (Nick) - See kholia#169 for details. - Removed history to reduce repository size
0 parents  commit ca219f5

File tree

109 files changed

+20573
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+20573
-0
lines changed

.github/issue_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#### Notes
2+
3+
- Please, DO NOT create a new issue if your issue is already known.
4+
- Carefully read the documentation included in the repository.
5+
- Look closely at the closed and open issues.
6+
7+
- Attach details about your host OS (distribution, kernel, QEMU version) and
8+
host CPU (vendor and model number).
9+
10+
- Remove this template message after reading it ;)

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.iso
2+
mac_hdd.img
3+
mac_hdd_ng.img
4+
*.sha256sum
5+
*.sucatalog
6+
*.img
7+
*.dmg
8+
*.dist
9+
*.smd
10+
*.dmg
11+
OVMF_VARS-1024x768.fd

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "resources/OcBinaryData"]
2+
path = resources/OcBinaryData
3+
url = https://github.com/acidanthera/OcBinaryData.git

CREDITS.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
### Credits
2+
3+
- [UPSTREAM] https://github.com/acidanthera/OpenCorePkg + https://dortania.github.io/ - for making all this possible!
4+
5+
* RehabMan, th3joker and others - FakeSMC.kext, https://bitbucket.org/RehabMan
6+
7+
* Chuck Remes (chuckremes) - better documentation
8+
9+
* Meissa - better networking documentation
10+
11+
* PJ Meyer (pjmeyer) - compatibility with modern versions of GNU mktemp
12+
13+
* Robert DeRose (RobertDeRose) and Dirk Bajohr (isolution-de) - macOS support
14+
15+
* Fritz Elfert (felfert) - cleanups, better documentation, and nicer ISO creation script
16+
17+
* Ian McDowell (IMcD23) - more documentation, and better ISO creation script
18+
19+
* voobscout - libvirt XML file
20+
21+
* Evgeny Grin (Karlson2k) - for the original ISO creation script
22+
23+
* Gabriel L. Somlo - for getting things started and going
24+
25+
* http://www.insanelymac.com/ - Enoch bootloader
26+
27+
* Nicholas Sherlock - UEFI, Clover, and other hacks
28+
29+
* Phil Dennis-Jordan - virtio-net-osx, usb-tablet and other hacks
30+
31+
* Nikolay Dimitrov (nikidim) - Docker for Mac
32+
33+
* Francisco de la Peña - libvirt XML file for macOS High Sierra
34+
35+
* Christian Giliberto - libvirt XML tweaks
36+
37+
* José Roberto Meza Cabrera - AMD Ryzen testing
38+
39+
* Paweł BB Drozd - UEFI resolution
40+
41+
* Jan Kuri (jkuri) - Mojave ISO creation fixes
42+
43+
* Mike Hardy (mikehardy) - Network documentation improvements
44+
45+
* CuriousTommy + pickled_monkey - Information on vmxnet3 network adapter
46+
47+
* Povilas Kanapickas (p12tic) - Flexible ISO generation
48+
49+
* Dick Marinus (meeuw) - Allow usage of latest Clover
50+
51+
* Foxlet (foxlet) - Allow installation without existing macOS
52+
53+
* Ralph Kühnert (redradrat) - Debug fetch-macOS.py script
54+
55+
* Pellegrino Prevete (tallero) - Better documentation
56+
57+
* Niklas Korz (niklaskorz) - Stop using brctl
58+
59+
* Mike Bybee (stereoplegic) - Higher resolution documentation
60+
61+
* Yarkhan - Passthrough for making iDevices work
62+
63+
* Yu-Chen Lin (npes87184) - Virtio and qemu-img notes
64+
65+
* Wen-He - Catalina related fixes
66+
67+
* Alexander Galato (alet) - OVMF build documentation fixes
68+
69+
* zimbatm - portability enhancements, cool crazy ideas (thanks!)
70+
71+
* https://github.com/Leoyzen/KVM-Opencore - OpenCore support
72+
73+
* Kyle Dayton - UEFI, Clover, and GPU passthrough notes
74+
75+
- foxtrotdragon - OpenCore language fixes
76+
77+
- hoshsadiq (Hosh) - fetch-macOS.py improvements
78+
79+
- philffm - Typo fix in `Big-Sur.md`
80+
81+
- jviotti - Headless mode fixes
82+
83+
- offlinehacker - libvirt support
84+
85+
- hellodeibu - Big Sur support
86+
87+
- kittywhiskers - Large number of changes - thank you!
88+
89+
- zimbatm - Thank you!
90+
91+
- Peter Asanov (ink-splatters) - Fixes for the OS-fetch script
92+
93+
- Sangwhan "fish" Moon - Big Sur doc enhancements
94+
95+
- ADawesomeguy - Big Sur doc enhancements, Xcode + OSX-KVM tutorial
96+
97+
- shmsh9 - Python 3.9.x support
98+
99+
- Gelma (Andrea Gelmini) - Typo fixes
100+
101+
- ivy-rew (Reguel) - Greatly improved Big-Sur notes
102+
103+
- Broly1 - Greatly improved Big-Sur notes
104+
105+
- mikkeyboi (Michael Leung) - Greatly improved Big-Sur notes
106+
107+
- CyberShadow (Vladimir Panteleev) - Documentation fixes
108+
109+
- mikehardy (Mike Hardy) - Docker on macOS notes, CPU support notes
110+
111+
- Dogr95 - macOS-libvirt-Catalina.xml fixes
112+
113+
- headkaze - AppleVirtualGraphics.kext tip
114+
115+
- aydenbottos - macOS-libvirt-Catalina.xml fixes
116+
117+
- mikkeyboi - Unraid OS stuff
118+
119+
Note: Individual files have more specific 'credits' in them.

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
clean:
2+
rm -rf content || true

OVMF-notes.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Current OVMF blobs are borrowed from the following URL,
2+
3+
http://download.proxmox.com/debian/dists/buster/pve-no-subscription/binary-amd64/pve-edk2-firmware_2.20200531-1_all.deb
4+
5+
OVMF for non-OpenCore boot loaders: https://github.com/kholia/edk2/tree/macOS-NG-v3.
6+
7+
Building OVMF
8+
-------------
9+
10+
# Add tools and build dependencies:
11+
apt-get update
12+
apt-get install build-essential git lintian debhelper iasl nasm \
13+
python uuid-dev -y
14+
15+
16+
git clone https://github.com/tianocore/edk2
17+
cd edk2
18+
git submodule update --init
19+
make -C BaseTools
20+
. edksetup.sh BaseTools
21+
build -a X64 -t GCC5 -p OvmfPkg/OvmfPkgX64.dsc -b RELEASE
22+
23+
References
24+
----------
25+
26+
* https://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/
27+
28+
* https://www.nicksherlock.com/2018/04/patch-ovmf-to-support-macos-in-proxmox-5-1/
29+
30+
* https://github.com/thenickdude/edk2 (macos-support branch)

OVMF_CODE.fd

1.88 MB
Binary file not shown.

OVMF_VARS-1024x768.fd

128 KB
Binary file not shown.

OpenCore-Boot-CD.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
3+
# Special thanks to:
4+
# https://github.com/Leoyzen/KVM-Opencore
5+
# https://github.com/thenickdude/KVM-Opencore/
6+
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt
7+
#
8+
# qemu-img create -f qcow2 mac_hdd_ng.img 128G
9+
#
10+
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)
11+
12+
############################################################################
13+
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
14+
############################################################################
15+
16+
MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
17+
18+
# This script works for Big Sur, Catalina, Mojave, and High Sierra. Tested with
19+
# macOS 10.15.6, macOS 10.14.6, and macOS 10.13.6
20+
21+
ALLOCATED_RAM="3072" # MiB
22+
CPU_SOCKETS="1"
23+
CPU_CORES="2"
24+
CPU_THREADS="4"
25+
26+
REPO_PATH="./"
27+
OVMF_DIR="."
28+
29+
# shellcheck disable=SC2054
30+
args=(
31+
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
32+
-machine q35
33+
-usb -device usb-kbd -device usb-tablet
34+
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
35+
-device usb-ehci,id=ehci
36+
# -device usb-kbd,bus=ehci.0
37+
# -device usb-mouse,bus=ehci.0
38+
# -device nec-usb-xhci,id=xhci
39+
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
40+
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
41+
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
42+
-smbios type=2
43+
-device ich9-intel-hda -device hda-duplex
44+
-device ich9-ahci,id=sata
45+
# -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore-nopicker.qcow2"
46+
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore.qcow2"
47+
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
48+
-device ide-hd,bus=sata.3,drive=InstallMedia
49+
-drive id=InstallMedia,if=none,file="$REPO_PATH/os.dmg",format=raw
50+
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
51+
-device ide-hd,bus=sata.4,drive=MacHDD
52+
# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
53+
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
54+
-monitor stdio
55+
-device VGA,vgamem_mb=128
56+
)
57+
58+
qemu-system-x86_64 "${args[@]}"

OpenCore-Boot.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
# Special thanks to:
4+
# https://github.com/Leoyzen/KVM-Opencore
5+
# https://github.com/thenickdude/KVM-Opencore/
6+
# https://github.com/qemu/qemu/blob/master/docs/usb2.txt
7+
#
8+
# qemu-img create -f qcow2 mac_hdd_ng.img 128G
9+
#
10+
# echo 1 > /sys/module/kvm/parameters/ignore_msrs (this is required)
11+
12+
############################################################################
13+
# NOTE: Tweak the "MY_OPTIONS" line in case you are having booting problems!
14+
############################################################################
15+
16+
MY_OPTIONS="+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
17+
18+
# This script works for Big Sur, Catalina, Mojave, and High Sierra. Tested with
19+
# macOS 10.15.6, macOS 10.14.6, and macOS 10.13.6
20+
21+
ALLOCATED_RAM="3072" # MiB
22+
CPU_SOCKETS="1"
23+
CPU_CORES="2"
24+
CPU_THREADS="4"
25+
26+
REPO_PATH="."
27+
OVMF_DIR="."
28+
29+
# This causes high cpu usage on the *host* side
30+
# qemu-system-x86_64 -enable-kvm -m 3072 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,hypervisor=off,vmx=on,kvm=off,$MY_OPTIONS\
31+
32+
# shellcheck disable=SC2054
33+
args=(
34+
-enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
35+
-machine q35
36+
-usb -device usb-kbd -device usb-tablet
37+
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
38+
-device usb-ehci,id=ehci
39+
# -device usb-kbd,bus=ehci.0
40+
# -device usb-mouse,bus=ehci.0
41+
# -device nec-usb-xhci,id=xhci
42+
-device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
43+
-drive if=pflash,format=raw,readonly,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
44+
-drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1024x768.fd"
45+
-smbios type=2
46+
-device ich9-intel-hda -device hda-duplex
47+
-device ich9-ahci,id=sata
48+
# -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore-nopicker.qcow2"
49+
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore-Catalina/OpenCore.qcow2"
50+
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
51+
-device ide-hd,bus=sata.3,drive=InstallMedia
52+
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
53+
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
54+
-device ide-hd,bus=sata.4,drive=MacHDD
55+
# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
56+
-netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27
57+
-monitor stdio
58+
-device VGA,vgamem_mb=128
59+
)
60+
61+
qemu-system-x86_64 "${args[@]}"

0 commit comments

Comments
 (0)