lima-vm/lima · error

networks.yaml: %#q (`paths.socketVMNet`) has to be installed

Error message

networks.yaml: %#q (`paths.socketVMNet`) has to be installed

What it means

When validating networks.yaml, Lima detects whether `paths.socketVMNet` points to an installed binary. If the configured path was flagged as not found (or empty), validation fails stating that the socket_vmnet binary has to be installed, quoting the configured path.

Source

Thrown at pkg/networks/validate.go:82

			path = findBaseDirectory(path)
		}
		err := validatePath(path, name == "varRun")
		if err != nil {
			if errors.Is(err, os.ErrNotExist) {
				switch name {
				// sudoers file does not need to exist; otherwise `limactl sudoers` couldn't bootstrap
				case "sudoers":
					continue
				case "socketVMNet":
					socketVMNetNotFound = true
					continue
				}
			}
			return fmt.Errorf("networks.yaml field `paths.%s` error: %w", name, err)
		}
	}
	if socketVMNetNotFound {
		return fmt.Errorf("networks.yaml: %#q (`paths.socketVMNet`) has to be installed", pathsMap["socketVMNet"])
	}
	return nil
}

// findBaseDirectory removes non-existing directories from the end of the path.
func findBaseDirectory(path string) string {
	if _, err := os.Lstat(path); errors.Is(err, os.ErrNotExist) {
		if path != "/" {
			return findBaseDirectory(filepath.Dir(path))
		}
	}
	return path
}

func validatePath(path string, allowDaemonGroupWritable bool) error {
	if path == "" {
		return nil
	}

View on GitHub (pinned to dd909d0973)

Solutions

  1. Install socket_vmnet: `brew install socket_vmnet` and follow lima's instructions to set up the launchd socket.
  2. Update `paths.socketVMNet` in networks.yaml to the real binary path for your architecture (/opt/homebrew/... on Apple Silicon, /usr/local/... on Intel).
  3. If you only need user-v2 networks, avoid shared/bridged modes so socketVMNet is not required.
  4. Re-run `limactl start` after installation.

Example fix

# before (networks.yaml)
paths:
  socketVMNet: ""
# after
paths:
  socketVMNet: /opt/homebrew/opt/socket_vmnet/bin/socket_vmnet
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const p = config.paths?.socketVMNet;
if (!p || !fs.existsSync(p)) {
  console.error(`socket_vmnet must be installed; paths.socketVMNet='${p}' not found. Run: brew install socket_vmnet`);
}

Try / catch

try {
  await validateNetworks(config);
} catch (err) {
  if (err.message.includes('has to be installed')) {
    console.error('Install socket_vmnet and set paths.socketVMNet to its absolute path.');
  }
  throw err;
}

Prevention

When it happens

Trigger: Using network mode `shared`/bridged on macOS requires socket_vmnet; networks.Validate sets socketVMNetNotFound when the stat of paths.socketVMNet fails, then returns this error at the end of validation.

Common situations: Fresh lima install on macOS without `brew install socket_vmnet`; socket_vmnet installed but the networks.yaml path points to the old /usr/local Homebrew prefix; user switched from vde to socket_vmnet and never configured the path.

Related errors


AI-assisted analysis of lima-vm/lima@dd909d0973 (2026-09-01). Data as JSON: /api/errors/3bbe5379149484b5. Report an issue: GitHub.