1 hour ago · 10 min read2040 words · Tech · hide · 0 comments

Increasing a UTM virtual disk's size does not automatically expand the guest's APFS container. If a Recovery partition lies between the container's partition and the added free space, it blocks direct expansion. This Codex/Astra-crafted script uses Python 3.9+ standard library and macOS diskutil, cp, and lsof; no pip packages, Go, Homebrew, or QEMU are required. It targets macOS 26+ with diskutil image support and an APFS host filesystem for copy-on-write backups: #!/usr/bin/env python3 # Grow an offline Apple Silicon UTM image. Python stdlib + macOS diskutil/cp. import argparse import hashlib import json import os from pathlib import Path import plistlib import re import struct import subprocess import sys import uuid import zlib RECOVERY = uuid.UUID('52637672-7900-11aa-aa11-00306543ecac').bytes_le APFS = uuid.UUID('7c3457ef-0000-11aa-aa11-00306543ecac').bytes_le ISC = uuid.UUID('69646961-6700-11aa-aa11-00306543ecac').bytes_le CHUNK = 8 * 1024 * 1024 def require(ok, message): if not…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.