lima-vm/lima · error

sudoers command is only supported on macOS right now

Error message

sudoers command is only supported on macOS right now

What it means

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.

Source

Thrown at cmd/limactl/sudoers_nodarwin.go:15

//go:build !darwin

// SPDX-FileCopyrightText: Copyright The Lima Authors
// SPDX-License-Identifier: Apache-2.0

package main

import (
	"errors"

	"github.com/spf13/cobra"
)

func sudoersAction(_ *cobra.Command, _ []string) error {
	return errors.New("sudoers command is only supported on macOS right now")
}

View on GitHub (pinned to dd909d0973)

Solutions

  1. Skip this command on Linux — it is unnecessary there (socket_vmnet/launchd are macOS-only)
  2. Gate any automation on runtime GOOS (`[[ $(uname) == Darwin ]]`)
  3. Use the Linux-equivalent network setup docs instead of sudoers

Example fix

// before (script)
limactl sudoers | sudo tee /etc/sudoers.d/lima
// after
if [[ $(uname) == Darwin ]]; then
  limactl sudoers | sudo tee /etc/sudoers.d/lima
fi
Defensive patterns

Strategy: fallback

Validate before calling

[[ $(uname) == Darwin ]] || { echo 'sudoers is macOS-only; skipping'; exit 0; }

Try / catch

if ! limactl sudoers; then
  [[ $(uname) != Darwin ]] && echo 'expected on non-macOS; ignoring' || exit 1
fi

Prevention

When it happens

Trigger: Running `limactl sudoers` on Linux (or any non-Darwin build of limactl).

Common situations: 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.

Related errors


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