diff --git a/OVMF_VARS-1920x1080.fd b/OVMF_VARS-1920x1080.fd index 3b8bb9b..d6de773 100644 Binary files a/OVMF_VARS-1920x1080.fd and b/OVMF_VARS-1920x1080.fd differ diff --git a/OpenCore-Boot.sh b/OpenCore-Boot.sh index e027851..d3d0190 100755 --- a/OpenCore-Boot.sh +++ b/OpenCore-Boot.sh @@ -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 diff --git a/README.md b/README.md index ae8f30a..ee40e5d 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,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 🚀 @@ -236,6 +240,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). diff --git a/macOS-libvirt-Catalina.xml b/macOS-libvirt-Catalina.xml index 05cb13f..612c44b 100644 --- a/macOS-libvirt-Catalina.xml +++ b/macOS-libvirt-Catalina.xml @@ -61,16 +61,16 @@ /usr/bin/qemu-system-x86_64 - + - +
- + - +