abiosoft/colima · error

error setting up inotify dependencies: %w

Error message

error setting up inotify dependencies: %w

What it means

Thrown in the VM daemon setup chain when conf.MountINotify is enabled and deps.Install(l.host) fails for the inotify dependency inside the guest (l.daemon.Dependency(ctx, conf, inotify.Name) then Install). Colima runs a daemon in the VM that forwards host file-change events (fsevents→inotify) so bind-mounted volumes trigger inotify inside containers; installing its dependencies is a hard step of 'colima start --mount-inotify'.

Source

Thrown at environment/vm/lima/daemon.go:44

		return ctx, nil
	}

	ctxKeyVmnet := daemon.CtxKey(vmnet.Name)
	ctxKeyInotify := daemon.CtxKey(inotify.Name)

	// use a nested chain for convenience
	a := l.Init(ctx)
	log := a.Logger()

	networkInstalledKey := struct{ key string }{key: "network_installed"}

	// add inotify to daemon
	if conf.MountINotify {
		a.Add(func() error {
			ctx = context.WithValue(ctx, ctxKeyInotify, true)
			deps, _ := l.daemon.Dependency(ctx, conf, inotify.Name)
			if err := deps.Install(l.host); err != nil {
				return fmt.Errorf("error setting up inotify dependencies: %w", err)
			}
			return nil
		})
	}

	// add network processes to daemon
	if useVmnet {
		a.Add(func() error {
			if conf.Network.Address {
				a.Stage("preparing network")
				ctx = context.WithValue(ctx, ctxKeyVmnet, true)
			}
			deps, root := l.daemon.Dependency(ctx, conf, vmnet.Name)
			if deps.Installed() {
				ctx = context.WithValue(ctx, networkInstalledKey, true)
				return nil
			}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Retry 'colima stop && colima start --mount-inotify' — transient network failures during dependency fetch often clear.
  2. Check VM connectivity from inside: 'colima ssh -- curl -sI https://github.com' and fix proxy/DNS in the host environment before restarting.
  3. Disable the feature to unblock: 'colima start --mount-inotify=false' (lose inotify forwarding; file watching in containers degrades to polling).
  4. If the guest is wedged, recreate: 'colima delete -f && colima start --mount-inotify'.
Defensive patterns

Strategy: try-catch

Validate before calling

// only enable inotify mounting when the guest can reach the internet
canFetch := guest.Run("sh", "-c", "command -v curl") == nil
if conf.MountINotify && !canFetch {
    log.Warnln("skipping inotify dependency install; guest offline")
    conf.MountINotify = false
}

Try / catch

if err := deps.Install(l.host); err != nil {
    // degrade gracefully: continue start without inotify forwarding
    log.Warnln(fmt.Errorf("error setting up inotify dependencies: %w", err))
    return nil
}

Prevention

When it happens

Trigger: Starting with 'colima start --mount-inotify' (or a config with mountInotify: true) while the guest cannot install/prepare the inotify dependency: apt/apk fetch failure inside the VM during provisioning, guest not fully booted, downloader failing to fetch binaries, or the daemon context wiring failing.

Common situations: First start with inotify forwarding enabled on a fresh VM while offline or behind a corporate proxy; slow networks making the dependency fetch exceed limits; partial previous provisioning leaving the daemon in a bad state; macOS hosts where users enable --mount-inotify for webpack/vite HMR in bind mounts.

Related errors


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