abiosoft/colima · error
error creating runtime disk: %w
Error message
error creating runtime disk: %w
What it means
Returned by createRuntimeDisk when limautil.CreateDisk(conf.Disk) fails during 'colima start' provisioning: colima creates a dedicated Lima data disk (limactl disk create) to hold container runtime data (docker/containerd/incus) and attach it as an additional disk. The wrapped error comes from limactl and usually reflects host-side qemu-img/disk issues, insufficient space, or a leftover disk record.
Source
Thrown at environment/vm/lima/disk.go:40
)
//go:embed disk.sh
var diskScript string
func (l *limaVM) createRuntimeDisk(conf config.Config) error {
if environment.IsNoneRuntime(conf.Runtime) {
// runtime disk is not required when no runtime is in use
return nil
}
disk := dataDisk(conf.Runtime)
s, _ := store.Load()
format := !s.DiskFormatted // only format if not previously formatted
if !limautil.HasDisk() {
if err := limautil.CreateDisk(conf.Disk); err != nil {
return fmt.Errorf("error creating runtime disk: %w", err)
}
format = true // new disk should be formated
}
// when disk is formatted for the wrong runtime, prevent use
if s.DiskFormatted && s.DiskRuntime != "" && s.DiskRuntime != conf.Runtime {
return fmt.Errorf("runtime disk provisioned for %s runtime. Delete container data with 'colima delete --data' before using another runtime", s.DiskRuntime)
}
l.limaConf.Disk = config.Disk(conf.RootDisk).GiB()
l.limaConf.AdditionalDisks = append(l.limaConf.AdditionalDisks, limaconfig.Disk{
Name: config.CurrentProfile().ID,
Format: format,
FSType: disk.FSType,
})
l.mountRuntimeDisk(conf, format)
return nilView on GitHub (pinned to c3a5f9184d)
Solutions
- Check host free space ('df -h ~') and free tens of GB (the disk is created lazily but needs some headroom), then retry 'colima start'.
- Inspect existing lima disks for stale/corrupt entries: 'limactl disk ls'; remove the colima profile's disk ('limactl disk delete <profile>') and retry colima start.
- Fix ownership of the lima data dir if a sudo run owns it: 'sudo chown -R "$(id -u):$(id -g)" ~/.lima'.
- Reinstall/repair qemu if limactl reports qemu-img errors (brew reinstall qemu lima).
- Nuclear option: 'colima delete -f' (removes VM and disks) then 'colima start' to provision everything fresh.
Defensive patterns
Strategy: validation
Validate before calling
// ensure host space and no stale disk before start
if fi, err := os.Stat(limaDisksDir()); err == nil && !fi.IsDir() {
return fmt.Errorf("lima disks path unusable: %s", limaDisksDir())
}
if limautil.HasDisk() {
// disk exists; skip creation entirely
return nil
} Type guard
func diskCreationSafe(freeBytes uint64, requestedGiB int) bool {
// qcow2 is sparse; require modest headroom, e.g. 1GiB + 10% of requested
return freeBytes > uint64(requestedGiB)*1024*1024*1024/10
} Try / catch
if err := limautil.CreateDisk(conf.Disk); err != nil {
// stale disk records are the most recoverable cause
if strings.Contains(err.Error(), "already exists") {
_ = limautil.DeleteDisk()
if err2 := limautil.CreateDisk(conf.Disk); err2 != nil {
return fmt.Errorf("error creating runtime disk: %w", err2)
}
} else {
return fmt.Errorf("error creating runtime disk: %w", err)
}
} Prevention
- Keep >5GiB free on the host volume hosting lima data.
- Use 'limactl disk ls' to spot stale disks after failed deletes.
- Recreate cleanly with 'colima delete -f' rather than hand-editing lima state.
- Never run colima as two different users — lima dirs get ownership-mismatched.
When it happens
Trigger: First start (or start after 'colima delete' without disk cleanup) where limactl disk create runs: host disk full at ~/Library/Containers/.../lima (or ~/.lima) so the qcow2 cannot be created; qemu-img missing/broken; a same-named disk already registered in lima in a bad state; permission problems in the lima data dir after brew/lima upgrades.
Common situations: Machines with nearly-full startup volumes; upgrading lima/colima changed the lima data directory leaving stale disks; running colima under different users so the lima dir is owned by someone else; interrupted previous delete leaving a half-registered disk.
Related errors
- error setting up AI model runner: %w
- dependency check failed for VM: %w
- error starting vm: %w
- error running %s provision script(s)
- error stopping vm: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/ee6b3e5633c55fc4.
Report an issue: GitHub.