abiosoft/colima · error
overlapping mounts not supported: %w
Error message
overlapping mounts not supported: %w
What it means
Error from checkOverlappingMounts during Lima config generation: two mounts' cleaned paths prefix each other (strings.HasPrefix both ways), which Lima cannot handle (lima-vm/lima#302). It fires only when conf.Mounts is non-empty; an empty/nil slice gets the default '~' writable mount instead.
Source
Thrown at environment/vm/lima/yaml.go:387
})
}
// grow partition in case disk size has increased
l.Provision = append(l.Provision, limaconfig.Provision{
Mode: limaconfig.ProvisionModeSystem,
Script: "resize2fs " + diskByLabelPath(config.CurrentProfile().ID) + " || true",
})
/* end */
if conf.Mounts != nil && len(conf.Mounts) == 0 {
l.Mounts = append(l.Mounts,
limaconfig.Mount{Location: "~", Writable: true},
)
} else {
// overlapping mounts are problematic in Lima https://github.com/lima-vm/lima/issues/302
if err = checkOverlappingMounts(conf.Mounts); err != nil {
err = fmt.Errorf("overlapping mounts not supported: %w", err)
return
}
for _, m := range conf.Mounts {
var location, mountPoint string
location, err = util.CleanPath(m.Location)
if err != nil {
return
}
mountPoint, err = util.CleanPath(m.MountPoint)
if err != nil {
return
}
mount := limaconfig.Mount{Location: location, MountPoint: mountPoint, Writable: m.Writable}
l.Mounts = append(l.Mounts, mount)
}View on GitHub (pinned to c3a5f9184d)
Solutions
- Drop the redundant ancestor mount and keep only the deepest path you need
- Reorder your intent: mount the common parent once with the desired writability instead of layering children
- If you only want the home directory, pass no --mount at all — colima defaults to mounting '~' writable
- Ensure paths are cleaned/absolute so '~/foo' and '/Users/x/foo' are not accidentally compared as distinct
Example fix
# before colima start --mount ~/src:ro --mount ~/src/writable # after: single mount, adjust writability at the parent colima start --mount ~/src
Defensive patterns
Strategy: validation
Validate before calling
// mirror checkOverlappingMounts before start
func mountsOverlap(mounts []config.Mount) bool {
paths := make([]string, 0, len(mounts))
for _, m := range mounts {
p, _ := util.CleanPath(firstNonEmpty(m.MountPoint, m.Location))
paths = append(paths, p)
}
for i := range paths {
for j := i + 1; j < len(paths); j++ {
if strings.HasPrefix(paths[i], paths[j]) || strings.HasPrefix(paths[j], paths[i]) {
return true
}
}
}
return false
} Try / catch
In Go: if err := checkOverlappingMountsLike(conf.Mounts); err != nil { reject config early with both offending paths } — the start-time error already names the pair; surface it verbatim. Prevention
- Design mounts as a flat set of disjoint subtrees — never nest one mount under another
- Remember '~' (the default) overlaps every home-relative path: pass explicit mounts or none, not both
- Clean paths before comparing so '~' vs absolute duplicates don't slip through your own checks
When it happens
Trigger: Passing mounts where one location/mount point is a path prefix of another: '~' together with '~/projects', '/Users/me' with '/Users/me/src', or a mountPoint nested under another mount's mountPoint.
Common situations: 'colima start --mount ~/src --mount ~/src/subdir' for IDE convenience; adding a deeper writable mount on top of a read-only parent mount; migrating docker-machine/VirtualBox style nested shares.
Related errors
- mount path with spaces is not supported by the underlying Li
- invalid mountType: '%s'
- relative paths not supported for mount '%s'
- error persisting runtime settings: %w
- error persisting kubernetes settings: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/dbe49b88473fc0ac.
Report an issue: GitHub.