abiosoft/colima · warning

unable to resize disk: %w

Error message

unable to resize disk: %w

What it means

During start, Colima compares the Lima instance's current disk size to conf.Disk and attempts limautil.ResizeDisk when the config asks for a larger disk. If resizing fails, it is only logged as a warning and the flow continues with the existing size (conf.Disk is reset to instance.Disk). Note that shrinking is ignored with a different warning, and this specific message appears only when the resize tooling itself errors.

Source

Thrown at environment/vm/lima/disk.go:226

	if err != nil {
		// instance config missing, ignore
		return conf
	}

	resized := func() bool {
		if instance.Disk == conf.Disk {
			// nothing to do
			return false
		}

		size := conf.Disk - instance.Disk
		if size < 0 {
			log.Warnln("disk size cannot be reduced, ignoring...")
			return false
		}

		if err := limautil.ResizeDisk(conf.Disk); err != nil {
			log.Warnln(fmt.Errorf("unable to resize disk: %w", err))
			return false
		}

		log.Printf("resizing disk to %dGiB...", conf.Disk)
		return true
	}()

	if !resized {
		conf.Disk = instance.Disk
	}

	return conf
}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Check the wrapped error in the log for the underlying cause (usually qemu-img output) and fix that: install qemu-utils/qemu-img, free the file lock by stopping the VM first.
  2. If resize cannot work in your setup, create a new profile with the desired disk size: `colima start --profile fresh --disk 100` and migrate workloads.
  3. Verify the disk file is writable by the user and resides on a filesystem with enough space for the grown image.
  4. Accept the current size: the warning is non-fatal, Colima continues with instance.Disk.

Example fix

# before
colima start --disk 100   # resize fails, stays at old size

# after
brew install qemu   # ensure qemu-img present
colima stop && colima start --disk 100
Defensive patterns

Strategy: fallback

Validate before calling

// before requesting a larger disk, ensure the resize tooling exists on the host
if _, err := exec.LookPath("qemu-img"); err != nil {
    log.Warn("qemu-img missing; disk resize will be skipped, VM keeps current size")
}

Try / catch

Non-fatal by design (logged as warning; conf.Disk falls back to the instance's current size). No catch needed; verify actual size with `colima ssh -- df -h` after start.

Prevention

When it happens

Trigger: `colima start --disk <larger>` (or editing disk in config) on an existing profile where the resize helper (qemu-img/vz tooling) fails: missing qemu-img on host, permission issues on the disk file, unsupported VM driver (e.g. vz limitations), or the VM/disk file being locked by a running instance.

Common situations: Growing disk after initial creation with a small --disk value; hosts where qemu-img is not in PATH; switching VM drivers (qemu/vz) on an existing profile.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/9d966e9570cfeb21. Report an issue: GitHub.