{"record":{"id":"0c12577c52a9948f","repo":"lima-vm/lima","slug":"no-sudoers-file-defined-in-q","errorCode":null,"errorMessage":"no sudoers file defined in %#q","messagePattern":"no sudoers file defined in %#q","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/sudoers_darwin.go","lineNumber":59,"sourceCode":"\tdefault:\n\t\treturn fmt.Errorf(\"unexpected arguments %v\", args)\n\t}\n\tsudoers, err := networks.Sudoers()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfmt.Fprint(cmd.OutOrStdout(), sudoers)\n\treturn nil\n}\n\nfunc verifySudoAccess(ctx context.Context, nwCfg networks.Config, args []string, stdout io.Writer) error {\n\tvar file string\n\tswitch len(args) {\n\tcase 0:\n\t\tfile = nwCfg.Paths.Sudoers\n\t\tif file == \"\" {\n\t\t\tcfgFile, _ := networks.ConfigFile()\n\t\t\treturn fmt.Errorf(\"no sudoers file defined in %#q\", cfgFile)\n\t\t}\n\tcase 1:\n\t\tfile = args[0]\n\tdefault:\n\t\treturn errors.New(\"can check only a single sudoers file\")\n\t}\n\tif err := nwCfg.VerifySudoAccess(ctx, file); err != nil {\n\t\treturn err\n\t}\n\tfmt.Fprintf(stdout, \"%#q is up-to-date (or sudo doesn't require a password)\\n\", file)\n\treturn nil\n}\n","sourceCodeStart":41,"sourceCodeEnd":72,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/sudoers_darwin.go#L41-L72","documentation":"verifySudoAccess determines which sudoers file to check: an explicit argument, or the path configured in the lima network config (nwCfg.Paths.Sudoers). If no argument is given and the config defines no sudoers path, the check cannot proceed and this error names the lima network config file where the path would be defined.","triggerScenarios":"`limactl sudoers --check` (no file argument) when ~/.lima/_config/networks.yaml has an empty paths.sudoers field.","commonSituations":"Fresh Lima installs where the sudoers path was never configured; users deleting or never creating /etc/sudoers.d/lima and not recording it in networks.yaml; upgrading from versions that didn't manage sudoers.","solutions":["Set paths.sudoers in the network config file named in the error (usually ~/.lima/_config/networks.yaml)","Or pass the file explicitly: `limactl sudoers --check /etc/sudoers.d/lima`","If you never use the vznat/vde network needing sudoers, ignore or remove related config"],"exampleFix":"// before (~/.lima/_config/networks.yaml)\npaths:\n  sudoers: \"\"\n// after\npaths:\n  sudoers: /etc/sudoers.d/lima","handlingStrategy":"validation","validationCode":"grep -A2 'paths:' ~/.lima/_config/networks.yaml | grep sudoers || echo 'set paths.sudoers or pass a file to --check'","typeGuard":null,"tryCatchPattern":"if ! limactl sudoers --check; then echo 'configure paths.sudoers in ~/.lima/_config/networks.yaml'; fi","preventionTips":["Always set paths.sudoers in networks.yaml on macOS","Or always pass an explicit file with --check","After reinstalling Lima, re-check the networks config"],"tags":["cli","macos","sudoers","networks-config"],"backgroundTag":"missing-config-value","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}