lima-vm/lima · error
failed to run load disk %#q: %w
Error message
failed to run load disk %#q: %w
What it means
attachDisks looks up each additional disk by name (and FSType) in Lima's disk store via store.InspectDisk; if the lookup fails (disk not found, store corrupted, wrong FSType), the error is wrapped with this message. It is the first step of attaching an additional disk, so it fires before any VM configuration is touched.
Source
Thrown at pkg/driver/vz/vm_darwin.go:588
}
isoAttachment, err := vz.NewDiskImageStorageDeviceAttachment(isoPath, true)
if err != nil {
return err
}
isoDev, err := vz.NewUSBMassStorageDeviceConfiguration(isoAttachment)
if err != nil {
return err
}
configurations = append(configurations, isoDev)
}
diskUtil := proxyimgutil.NewDiskUtil(ctx)
for _, d := range inst.Config.AdditionalDisks {
diskName := d.Name
disk, err := store.InspectDisk(diskName, d.FSType)
if err != nil {
return fmt.Errorf("failed to run load disk %#q: %w", diskName, err)
}
logrus.Infof("Mounting disk %#q on %#q", diskName, disk.MountPoint)
if err = disk.LockForInstance(inst.Dir); err != nil {
return fmt.Errorf("failed to attach disk %#q: %w", diskName, err)
}
extraDiskPath := filepath.Join(disk.Dir, filenames.DataDisk)
// ConvertToRaw is a NOP if no conversion is needed
logrus.Debugf("Converting extra disk %#q to a raw disk (if it is not a raw)", extraDiskPath)
if err = diskUtil.Convert(ctx, raw.Type, extraDiskPath, extraDiskPath, nil, true); err != nil {
return fmt.Errorf("failed to convert extra disk %#q to a raw disk: %w", extraDiskPath, err)
}
extraDiskPathAttachment, err := vz.NewDiskImageStorageDeviceAttachmentWithCacheAndSync(extraDiskPath, false, diskImageCachingMode, vz.DiskImageSynchronizationModeFsync)
if err != nil {
return fmt.Errorf("failed to create disk attachment for extra disk %#q: %w", extraDiskPath, err)
}
extraDisk, err := vz.NewVirtioBlockDeviceConfiguration(extraDiskPathAttachment)View on GitHub (pinned to dd909d0973)
Solutions
- Create the missing disk: `limactl disk create <name> --size <size>` (with matching --fs)
- Fix the disk name/FSType in lima.yaml to match an existing disk (`limactl disk list`)
- Remove the additionalDisks entry from the instance config
Example fix
// before additionalDisks: ["missing-disk"] // after $ limactl disk create missing-disk --size 10G # then keep the config, or remove the entry
Defensive patterns
Strategy: validation
Validate before calling
out, _ := exec.Command("limactl", "disk", "list").Output()
if !strings.Contains(string(out), diskName) {
return fmt.Errorf("disk %q does not exist; run: limactl disk create %s --size 10G", diskName, diskName)
} Try / catch
if err := startInstance(cfg); err != nil {
if strings.Contains(err.Error(), "failed to run load disk") {
// create the disk or fix the config entry
}
} Prevention
- Always `limactl disk create` before referencing a disk in lima.yaml
- Cross-check names/FSType with `limactl disk list`
- Recreate disk store when moving LIMA_HOME between machines
When it happens
Trigger: lima.yaml lists an additionalDisk whose name has no matching record in ${LIMA_HOME}/_disks (never created via `limactl disk create`, or deleted), or FSType mismatch causes InspectDisk to error.
Common situations: Template referencing a disk name that was never created; disk directory removed manually or after `limactl delete --force`; typo in disk name; sharing a config between machines without recreating disks.
Related errors
- failed to attach disk %#q: %w
- failed to convert extra disk %#q to a raw disk: %w
- disk format %#q not supported, use `qcow2` or `raw` instead
- disk %#q already exists (%#q)
- failed to remove a directory %#q: %w
AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01).
Data as JSON: /api/errors/2f1717d3fafb715b.
Report an issue: GitHub.