{"record":{"id":"c31f85c33ed94cc6","repo":"lima-vm/lima","slug":"sudoers-command-is-only-supported-on-macos-right-n","errorCode":null,"errorMessage":"sudoers command is only supported on macOS right now","messagePattern":"sudoers command is only supported on macOS right now","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/sudoers_nodarwin.go","lineNumber":15,"sourceCode":"//go:build !darwin\n\n// SPDX-FileCopyrightText: Copyright The Lima Authors\n// SPDX-License-Identifier: Apache-2.0\n\npackage main\n\nimport (\n\t\"errors\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nfunc sudoersAction(_ *cobra.Command, _ []string) error {\n\treturn errors.New(\"sudoers command is only supported on macOS right now\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":17,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/sudoers_nodarwin.go#L1-L17","documentation":"The `limactl sudoers` subcommand only exists meaningfully on macOS (it manages /etc/sudoers entries for the Lima network daemon). On all other platforms a stub build (sudoers_nodarwin.go) returns this error unconditionally when the command is invoked.","triggerScenarios":"Running `limactl sudoers` on Linux (or any non-Darwin build of limactl).","commonSituations":"Following macOS documentation on a Linux machine; cross-compiled limactl binaries used on the wrong OS; CI scripts that run the same commands across platforms.","solutions":["Skip this command on Linux — it is unnecessary there (socket_vmnet/launchd are macOS-only)","Gate any automation on runtime GOOS (`[[ $(uname) == Darwin ]]`)","Use the Linux-equivalent network setup docs instead of sudoers"],"exampleFix":"// before (script)\nlimactl sudoers | sudo tee /etc/sudoers.d/lima\n// after\nif [[ $(uname) == Darwin ]]; then\n  limactl sudoers | sudo tee /etc/sudoers.d/lima\nfi","handlingStrategy":"fallback","validationCode":"[[ $(uname) == Darwin ]] || { echo 'sudoers is macOS-only; skipping'; exit 0; }","typeGuard":null,"tryCatchPattern":"if ! limactl sudoers; then\n  [[ $(uname) != Darwin ]] && echo 'expected on non-macOS; ignoring' || exit 1\nfi","preventionTips":["Guard platform-specific commands with uname/GOOS checks","Split install scripts per OS","Consult Linux network setup docs instead"],"tags":["cli","platform-limitation","macos","sudoers"],"backgroundTag":"platform-not-supported","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}