utmapp / utmapp/UTM

Add support for sparsebundles and sparseimages in AppleVM utm bundles

Open
#3,478 4 comments 4 reactions 0 assignees View on GitHub
enhancement macOS
Dominant language
Swift
Stars
35.5k
Forks
1.8k
Avg merge
5d 5h
Merged PRs (30d)
7

Description

For QEMU images, we have qcow2 support. It would be great to also have sparsebundle/sparseimage support for AppleVM mode.

I personally also use sparsebundles in hand-rolled QEMU with the following method:

hdiutil attach -nomount
then use -drive file="/dev/",format-raw,media=disk with QEMU.

When QEMU quits, I call hdiutil detach to unmount.

But it should be fairly trivial to add native sparse support as well, and even image snapshot support. Emulators such as Basilisk II and SheepShaver have this built-in. You can view this at https://github.com/cebix/macemu/blob/4671258ba36cac1a19545b5f666916a30cd91581/BasiliskII/src/Unix/disk_sparsebundle.cpp for a sample implementation (it doesn't implement snapshots).

Sparse snapshots are useful because they're outside the VM implementation; you can set up a disk image the way you want, enable snapshot mounting of the image, and any changes get applied to a second file, so you can always revert to the original.

For that matter, QEMU has this feature with QCOW2 images too, and it will work even on qemu-system-ppc-screamer builds like UTM uses that break VM snapshotting. So while you can't snapshot a PPC-screamer image runtime, you CAN still create a drive snapshot that you can revert to. I guess this is a second embedded feature request: drive snapshotting for both QEMU and AppleVM.

Of course, APFS ALSO supports snapshotting, so people can technically snapshot from within the VM. But I'd argue that it's better to control snapshots from the UTM interface than from the macOS terminal.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.