{"record":{"id":"f78cb905210595a6","repo":"lima-vm/lima","slug":"failed-to-read-instance-state-for-instance-q-bec-f78cb9","errorCode":null,"errorMessage":"failed to read instance state for instance %#q because there is no WSL kernel installed,this usually happens when WSL was installed for another user, but never for your user.Try running `wsl --install -d Ubuntu` and `wsl --update`, and then re-running Lima","messagePattern":"failed to read instance state for instance %#q because there is no WSL kernel installed,this usually happens when WSL was installed for another user, but never for your user\\.Try running `wsl --install -d Ubuntu` and `wsl --update`, and then re-running Lima","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/driver/wsl2/vm_windows.go","lineNumber":230,"sourceCode":"\t\t\"--list\",\n\t\t\"--verbose\",\n\t}, executil.WithContext(ctx))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to run `wsl --list --verbose`, err: %w (out=%#q)\", err, out)\n\t}\n\n\tif out == \"\" {\n\t\treturn limatype.StatusBroken, fmt.Errorf(\"failed to read instance state for instance %#q, try running `wsl --list --verbose` to debug, err: %w\", instName, err)\n\t}\n\n\t// Check for edge cases first\n\tif strings.Contains(out, \"Windows Subsystem for Linux has no installed distributions.\") {\n\t\tif strings.Contains(out, \"Wsl/WSL_E_DEFAULT_DISTRO_NOT_FOUND\") {\n\t\t\treturn limatype.StatusBroken, fmt.Errorf(\n\t\t\t\t\"failed to read instance state for instance %#q because no distro is installed,\"+\n\t\t\t\t\t\"try running `wsl --install -d Ubuntu` and then re-running Lima\", instName)\n\t\t}\n\t\treturn limatype.StatusBroken, fmt.Errorf(\n\t\t\t\"failed to read instance state for instance %#q because there is no WSL kernel installed,\"+\n\t\t\t\t\"this usually happens when WSL was installed for another user, but never for your user.\"+\n\t\t\t\t\"Try running `wsl --install -d Ubuntu` and `wsl --update`, and then re-running Lima\", instName)\n\t}\n\n\tvar instState string\n\twslListColsRegex := regexp.MustCompile(`\\s+`)\n\t// wsl --list --verbose may have different headers depending on localization, just split by line\n\tfor rows := range strings.SplitSeq(strings.ReplaceAll(out, \"\\r\\n\", \"\\n\"), \"\\n\") {\n\t\tcols := wslListColsRegex.Split(strings.TrimSpace(rows), -1)\n\t\tnameIdx := 0\n\t\t// '*' indicates default instance\n\t\tif cols[0] == \"*\" {\n\t\t\tnameIdx = 1\n\t\t}\n\t\tif cols[nameIdx] == distroName {\n\t\t\tinstState = cols[nameIdx+1]\n\t\t\tbreak","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/pkg/driver/wsl2/vm_windows.go#L212-L248","documentation":"Variant of the no-distro case: the output says no distributions are installed but without WSL_E_DEFAULT_DISTRO_NOT_FOUND, meaning the WSL kernel itself is missing — typically WSL was registered for another Windows user but never initialized for the current one.","triggerScenarios":"getWslStatus sees 'Windows Subsystem for Linux has no installed distributions.' without the DEFAULT_DISTRO_NOT_FOUND code — the WSL kernel/user registration is absent for the current user.","commonSituations":"Multi-user Windows machines where another admin installed WSL; per-user WSL registration missing; WSL update never run for this user profile.","solutions":["Run `wsl --install -d Ubuntu` for the current Windows user","Run `wsl --update` to install/update the WSL kernel","Reboot if prompted, then verify `wsl --list --verbose` works","Re-run `limactl start <instance>`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Per-user WSL health check before Lima use\ntry { execSync('wsl.exe --status'); } catch { throw new Error('WSL not initialized for this user; run wsl --install -d Ubuntu && wsl --update'); }","typeGuard":"null","tryCatchPattern":"try {\n  await limactlStart(inst);\n} catch (e) {\n  if (/no WSL kernel installed/.test(String(e))) {\n    console.error('Fix per-user WSL: wsl --install -d Ubuntu && wsl --update, then reboot');\n  } else throw e;\n}","preventionTips":["On multi-user Windows machines, run `wsl --install` under each user account that uses Lima","Run `wsl --update` after Windows updates","Reboot after WSL feature installation before running limactl"],"tags":["wsl2","kernel-missing","per-user-install"],"backgroundTag":"wsl-no-installed-distributions","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}