Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified OVMF_VARS-1920x1080.fd
Binary file not shown.
10 changes: 6 additions & 4 deletions OpenCore-Boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ args=(
-smbios type=2
-device ich9-intel-hda -device hda-duplex
-device ich9-ahci,id=sata
-drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore/OpenCore.qcow2"
-device ide-hd,bus=sata.2,drive=OpenCoreBoot
# Setup SSD trim support to keep qcow2 image sparse
-blockdev driver=qcow2,node-name=OpenCoreBoot,file.filename="$REPO_PATH/OpenCore/OpenCore.qcow2",file.aio=threads,file.driver=file,discard=unmap,detect-zeroes=unmap
-device ide-hd,bus=sata.2,drive=OpenCoreBoot,id=oc,rotation_rate=1
-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
-device ide-hd,bus=sata.4,drive=MacHDD
# Again, setup SSD trim so macOS disk qcow2 image remains sparse
-blockdev driver=qcow2,node-name=MacHDD,file.driver=file,file.filename="$REPO_PATH/mac_hdd_ng.img",file.aio=threads,discard=unmap,detect-zeroes=unmap
-device ide-hd,bus=sata.4,drive=MacHDD,id=macssd,rotation_rate=1
# -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
-netdev user,id=net0,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
# -netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27 # Note: Use this line for High Sierra
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ processors work just fine (even for macOS Sonoma).
qemu-img create -f qcow2 mac_hdd_ng.img 256G
```

NOTE: Create this HDD image file on a fast SSD/NVMe disk for best results.
> [!NOTE]
> Create this HDD image file on a fast SSD/NVMe disk for best results.
>
> To enable TRIM support inside macOS, you must run: `sudo trimforce enable` from
> _inside the VM_ after it boots.

* Now you are ready to install macOS 🚀

Expand Down Expand Up @@ -235,6 +239,12 @@ work, patience, and a bit of luck (perhaps?).

### Post-Installation

* Run `sudo trimforce enable` to enable TRIM support on the macOS hard drive.
- NOTE: This is important so the `qcow2` image remains sparse, and does not
keep growing in size, even after deleting files to free space in the VM.
- This is supported by QEMU's `qcow2` image format block driver through the
`discard=unmap,detect-zeroes=unmap` parameters.

* See [networking notes](networking-qemu-kvm-howto.txt) on how to setup networking in your VM, outbound and also inbound for remote access to your VM via SSH, VNC, etc.

* To passthrough GPUs and other devices, see [these notes](notes.md#gpu-passthrough-notes).
Expand Down
8 changes: 4 additions & 4 deletions macOS-libvirt-Catalina.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback' io='threads'/>
<driver name='qemu' type='qcow2' cache='writeback' io='threads' discard='unmap' detect_zeroes='unmap'/>
<source file='/home/CHANGEME/OSX-KVM/OpenCore/OpenCore.qcow2'/>
<target dev='sda' bus='sata'/>
<target dev='sda' bus='sata' rotation_rate='1'/>
<boot order='2'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writeback' io='threads'/>
<driver name='qemu' type='qcow2' cache='writeback' io='threads' discard='unmap' detect_zeroes='unmap'/>
<source file='/home/CHANGEME/OSX-KVM/mac_hdd_ng.img'/>
<target dev='sdb' bus='sata'/>
<target dev='sdb' bus='sata' rotation_rate='1'/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
Expand Down