Skip to content

Add macOS disk resize support#678

Open
balcsida wants to merge 3 commits into
insidegui:mainfrom
balcsida:feat/macos-disk-resize-compact
Open

Add macOS disk resize support#678
balcsida wants to merge 3 commits into
insidegui:mainfrom
balcsida:feat/macos-disk-resize-compact

Conversation

@balcsida
Copy link
Copy Markdown

@balcsida balcsida commented May 23, 2026

What the resize feature does is that when a guest VM starts the next time, before the guest OS boots, VirtualBuddy inspects the guest disk image by temporarily attaching it on the host with hdiutil and reading the partition layout. If it finds an APFS-on-GPT layout, it treats it as a macOS guest disk and checks for locked APFS volumes / FileVault first:

  • If the disk is encrypted, the resize is blocked. I couldn't find a reliable way to resize FileVault-protected APFS offline, even after trying the recovery key in multiple formats. I may revisit this later.
  • If the disk is not encrypted, the disk image is expanded to the requested size. Then diskutil expands the GPT layout and the APFS container to match. If APFS does not pick up the new ceiling on the first pass, which sometimes happens, the resizer applies a small shrink-and-grow nudge to force APFS to recompute the available space.

@balcsida balcsida force-pushed the feat/macos-disk-resize-compact branch 2 times, most recently from f5ac0a5 to 2cfd5fe Compare May 23, 2026 21:28
@balcsida balcsida mentioned this pull request May 23, 2026
@balcsida balcsida force-pushed the feat/macos-disk-resize-compact branch from 2cfd5fe to 5e9a160 Compare May 23, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant