Guide - Venoty USB with Mac OS Opencore

Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files.
https://www.ventoy.net/en/index.html

This software allows you to create a USB to boot ISO files placed on the first partition. The first partition can be ext4, ntfs, exfat, etc.

Requirements

Ventoy Mac OS to create USB install media WSL on Windows or Linux 

Here are the steps to place Mac OS installer Opencore on a USB drive along with Ventoy.

Install Ventoy to a USB

1) Partition Style -> GPT 2) Partition Configuration -> ✓ Preserve some space at the nd of the disk -> Minimum of 14GB 3) All other settings default 

Gather your EFI folder and open a linux terminal to the directory that contains it. Copy the script below into an sh file to that folder and run it. There are comments in the script to know what to when it opens a prompt asking questions

#!/bin/bash # # Ventoy EFI Image # folder="temp" if [ ! -d "${folder}" ]; then mkdir -p "${folder}/mnt" else rm -R "${folder}" mkdir -p "${folder}/mnt" fi cp -r EFI "${folder}" dd if=/dev/zero of="${folder}/EFI.img" bs=512 count=163750 gdisk "${folder}/EFI.img" # Use these commands, will whipe drive, create new partition to fill space, set partition type to ef00 (EFI system partition), then write changes # o - y - n - default - default - default - ef00 - w - y loop=1 while [ -f "/dev/loop${loop}" ]; do loop=$(("${loop}" + 1)) done sudo losetup --offset 1048576 --sizelimit 83822592 "/dev/loop${loop}" "${folder}/EFI.img" sudo mkdosfs -F 32 "/dev/loop${loop}" sudo mount "/dev/loop${loop}" "${folder}/mnt" sudo cp -r EFI "${folder}/mnt/" sudo umount "${folder}/mnt" sudo losetup -d "/dev/loop${loop}" cp "${folder}/EFI.img" EFI.img 

You will get a EFI.img file next to the EFI folder. This is the bootable img file to be placed into the ISO directory on the Ventoy USB first partition.

Boot into Mac OS and format the last partition on the USB drive to Mac OS Extended (Journaled). Do not have this partition formatted as NTFS before booting or disk utility will complain.

Open a terminal and run the command below (This is for Monterey, if you use something else just replace the .app folder with the correct one.

sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/NEWLYCREATEDUSBPARTITION 

Reboot into Ventoy and select the EFI.img you placed and it should boot Opencore.

The espack plugin provided by Ventoy is broken or this would've been a better solution due to not hard setting the file size. Hours upon hours testing this software and it works 1 every 100th time. Couldn't figure it out, realized it's not worth it.
https://github.com/ventoy/espack

submitted by /u/knuxyl
[link] [comments]