abiosoft/colima · error
error checking vmnet process: %w
Error message
error checking vmnet process: %w
What it means
Thrown by vmnetProcess.Alive() while Colima's daemon checks whether the rootful socket_vmnet process is healthy. If the pidfile exists, it runs `sudo /usr/bin/pkill -0 -F <pidfile>` (signal 0 = existence check only); a non-zero exit means the recorded process is dead, the pid was recycled, sudo failed, or pkill could not read the pidfile — all wrapped into this error.
Source
Thrown at daemon/process/vmnet/vmnet.go:49
mode: mode,
netInterface: netInterface,
}
}
type vmnetProcess struct {
mode string
netInterface string
}
func (*vmnetProcess) Alive(ctx context.Context) error {
info := Info()
pidFile := info.PidFile
socketFile := info.Socket.File()
if _, err := os.Stat(pidFile); err == nil {
cmd := exec.CommandContext(ctx, "sudo", "/usr/bin/pkill", "-0", "-F", pidFile)
if err := cmd.Run(); err != nil {
return fmt.Errorf("error checking vmnet process: %w", err)
}
}
if _, err := os.Stat(socketFile); err != nil {
return fmt.Errorf("vmnet socket file not found error: %w", err)
}
if n, err := net.Dial("unix", socketFile); err != nil {
return fmt.Errorf("vmnet socket file error: %w", err)
} else {
if err := n.Close(); err != nil {
logrus.Debugln(fmt.Errorf("error closing ping socket connection: %w", err))
}
}
return nil
}
// Name implements process.BgProcessView on GitHub (pinned to c3a5f9184d)
Solutions
- Restart cleanly: `colima stop --vz-rosetta` no — use `colima stop` then `colima start` so the daemon re-spawns vmnet and rewrites the pidfile
- Remove the stale pidfile: `sudo rm /opt/colima/run/vmnet-<profile>.pid` (check `pgrep -l socket_vmnet` first)
- If socket_vmnet keeps dying, capture logs: run colima with `--verbose` (sets DEBUG=1 for the daemon) and inspect output
- Reinstall the vmnet binaries if corrupted: `sudo rm -rf /opt/colima` then start again
- Escalate to the colima GitHub issues if the crash reproduces deterministically
Example fix
# before: stale pidfile makes Alive() fail colima status # reports vmnet down # after pgrep -l socket_vmnet || sudo rm -f /opt/colima/run/vmnet-*.pid colima stop && colima start
Defensive patterns
Strategy: validation
Validate before calling
// Cheap liveness check without sudo/pkill
func vmnetLooksAlive(pidFile string) bool {
b, err := os.ReadFile(pidFile)
if err != nil {
return false // no pidfile: Alive() skips the pkill check anyway
}
pid, err := strconv.Atoi(strings.TrimSpace(string(b)))
if err != nil {
return false // malformed pidfile will break pkill -F
}
p, err := os.FindProcess(pid)
return err == nil && p != nil && p.Signal(syscall.Signal(0)) == nil
} Try / catch
if err := vmnet.Alive(ctx); err != nil {
if strings.Contains(err.Error(), "error checking vmnet process") {
// pidfile exists but process is dead or sudo failed — treat as not-alive
log.Debug("vmnet process check failed; assuming dead: ", err)
_ = os.Remove(stalePidFileCleanup()) // after confirming process absence
}
// other Alive errors (socket) mean daemon needs restart
return restartVmnetDaemon(ctx)
} Prevention
- Always stop colima cleanly (colima stop) so pidfiles are removed
- After host reboots/sleep, expect stale pidfiles: clean /opt/colima/run/*.pid before diagnosing
- Don't manually kill socket_vmnet without removing its pidfile
- Ensure /usr/bin/pkill exists (macOS standard) when running on unusual setups
When it happens
Trigger: The vmnet pidfile exists at /opt/colima/run/vmnet-<profile>.pid but the process is gone (crashed, was killed, machine rebooted); pidfile is stale and the pid now belongs to another process; sudo prompt cancelled during the check; /usr/bin/pkill missing (non-macOS, tampered system).
Common situations: socket_vmnet daemon crashed after a macOS update or sleep/wake cycle; leftover pidfile from an unclean `colima stop -f` or host reboot; user manually pkill'ed socket_vmnet; running colima on a host where /usr/bin/pkill path differs.
Related errors
- pid file not found: %w
- invalid pid: %v
- process signal(0) returned error: %w
- error preparing colima privileged dir: %w
- error extracting vmnet archive: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/df071265e4cead50.
Report an issue: GitHub.