A linked clone forks a VM without copying its disk. The source's disk becomes a read-only base, and each VM writes to its own layer on top. A linked clone is instant and takes no extra space, whether the disk holds 60 GB or 600 GB.
Use them for a test matrix, a VM per branch, or CI workers from one golden image. Every VM made from a cloud image is already a linked clone of that image's template.
Create one
Right-click a stopped VM and choose Linked Clone…, or run mvz clone <vm> <name> --linked. The source must be stopped, have no suspended session, and have an ASIF boot disk. To convert a raw disk, see Storage and sharing. You can clone a clone.
A linked clone's Overview names its base: the Storage card says Linked clone of "ubuntu-base", and its notes start with what it was made from and when. Click the name to select the base. mvz show <vm> prints the same as Made from.
What changes for the source
The source VM keeps working, but its disk is now shared, which limits a few operations on both sides.
| Operation | Source VM | Linked clone |
|---|---|---|
| Start, stop, suspend, snapshot | Yes | Yes |
| Resize the boot disk | Grow only | Grow only |
| Full clone, or convert to a template | Yes | Only if made from a template |
| Export | Yes | After mvz flatten |
| Clone from one of its snapshots | No | Only if made from a template |
| Delete, or revert to a snapshot | After its clones are deleted | Yes |
A VM made from a template can be full-cloned or made into a template because templates never change while VMs use them. A clone of an ordinary VM can't, because part of its disk lives in that VM's package.
Delete in the right order
Delete clones before their source. MacVisor refuses to delete or revert a VM while clones depend on it, and names them.
When you delete the last clone, and it has left the Trash, the source gets its own layer back, as long as it hasn't run since the fork and has no snapshots from that time. Otherwise the VM's Overview shows how much space unused layers hold, with Flatten Disk to merge them. mvz flatten <vm> does the same for a stopped VM without snapshots. Layers nothing reads any more go to the Trash, or are deleted on a drive with no Trash, such as a network share.
A clone in the Trash
A linked clone you move to the Trash can be put back, and it still starts: its source keeps the shared layers the clone reads for as long as the clone is in the Trash, or in a storage location you removed from MacVisor's list. Meanwhile:
- the source can't be reverted to a snapshot, and a template the clone was made from can't be turned back into a VM. MacVisor names the clone, with "(in the Trash)";
- Flatten Disk on the source keeps the layers the clone reads.
Empty the clone from the Trash, or put it back and flatten its disk, to lift this.
Which kind of copy
| Linked clone | Full clone | Template | |
|---|---|---|---|
| Disk cost | None | A copy of the disk | A copy per VM |
| Speed | Instant | As fast as the copy | As fast as the copy |
| Independent of its source | No | Yes | Yes |
| Best for | Many short-lived VMs | A VM you keep and move | A base you stamp copies from |
A full clone on the same APFS volume is copy-on-write too, so it is cheaper than it sounds. A linked clone's base stays shared as both VMs change, so it stays cheap over time.
mvz clone <vm> <name> # full copy
mvz clone <vm> <name> --linked # linked clone
mvz clone <vm> <name> --snapshot <id> # a copy of the VM at that snapshot
mvz flatten <vm> # make a layered disk self-contained; asks first, --yes in a script
DeltaSync