To create a fixed-size VHD for Apple Silicon Mac upload to Azure Blob Storage, follow these steps:
-
Install QEMU on your Mac:
brew install qemu -
Create a new VHD file with the desired size (e.g., 128GB):
qemu-img create -f vhdx -o preallocation=metadata myVHD.vhdx 128G -
Convert the VHD file to a format compatible with VirtualBox (VDI):
VBoxManage convertfromraw myVHD.vhdx myVHD.vdi -
Mount the VDI file and create a new macOS installation or clone an existing one.
-
Once the VDI file is ready, convert it back to a VHDX file:
VBoxManage clonehd myVDI.vdi myClonedVDI.vdi --format VHD -
Upload the VHDX file to Azure Blob Storage using Azure CLI or any other preferred method.
References: