#5533·lima

krunkit: snapshot the stopped raw boot disk with clonefile

Author: ChengyuZhu6Created Sep 24, 2026Updated Sep 24, 2026
Labelsenhancementarch/ARMhost/macOS

Description

krunkit still returns "unimplemented" for limactl snapshot. libkrun has no snapshot API, and this driver already stores the boot disk as a raw file, so a stopped-VM snapshot can be a clonefile copy of that disk.

The copy is stored at snapshots//disk. create, apply, delete, and list would work only while the instance is stopped. list keeps the current "ID TAG PARENT" text, including a parent tag, so snapshot list --quiet does not need to change. That parent is only for the list output. Each snapshot clones the boot disk as it was, rather than storing a delta from the previous snapshot.

clonefile requires the same APFS volume. If it fails, the operation fails instead of falling back to a full copy. Additional disks are not snapshotted; create and apply print a warning. This does not include a memory snapshot.

Tests: a unit test for the clone, restore, and rejected tags, plus hack/test-krunkit-snapshot.sh (boot Ubuntu, write a file, stop, snapshot, change the file, apply, boot, check the old content).