Description of problem: APFS is not supported by libguestfs as of the last time I checked (unfortunately I don't know what version this was on). It would be useful to have it so it is easier to compact virtual machine images for macOS virtual machines on Intel Macs or Apple Silicon. Version-Release number of selected component (if applicable): Unknown as it was a while ago when I last tested it. Happy to re-test if it would be helpful. How reproducible: Reproducible every time. Steps to Reproduce: 1. Create an APFS volume on a virtual disk managed by QEMU/KVM/libvirt. 2. Put some files on the volume. 3. Attempt to compact the volume with "virt-sparsify --compress" and find that it doesn't compress. Actual results: VM image is not compressed. Expected results: VM image is compressed by converting it into a sparse image. Additional info: N/A
I'm not at all familiar with APFS. The only reference I can find is in util-linux. A major problem seems to be that the kernel doesn't support it (unless it is known by another name). libguestfs uses Linux kernel and Linux userspace features, we don't implement filesystems on our own. If there is FUSE support we could use that (as we do for NTFS, sometimes).
As far as I know there isn't support in the kernel, but there is a FUSE driver at https://github.com/sgan81/apfs-fuse
That's very encouraging, and also that it is packaged for Fedora and Debian. I pushed this very minimal change which should allow mounting of APFS filesystems: https://github.com/libguestfs/libguestfs/commit/8cd9adb2399513f3d49df6985c5657b78c9f916e eg using: ./run guestfish -a apfs.img -m /dev/sda1 ll / I couldn't actually *test* it because there seems to be no tool to make these filesystems, and I don't have one around. Also it would need enhancing to support other APFS features like encryption and any other apfs* tools that we would like to use.
Cheers, I shall test it when I have a little time.