Bug 2432498 - No support for APFS
Summary: No support for APFS
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-01-23 21:38 UTC by Hamish McIntyre-Bhatty
Modified: 2026-01-30 15:10 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Hamish McIntyre-Bhatty 2026-01-23 21:38:40 UTC
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

Comment 1 Richard W.M. Jones 2026-01-26 18:56:18 UTC
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).

Comment 2 Hamish McIntyre-Bhatty 2026-01-27 15:51:26 UTC
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

Comment 3 Richard W.M. Jones 2026-01-27 16:08:24 UTC
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.

Comment 4 Hamish McIntyre-Bhatty 2026-01-30 15:10:45 UTC
Cheers, I shall test it when I have a little time.


Note You need to log in before you can comment on or make changes to this bug.