sudoers
limactl sudoers
Generate the content of the /etc/sudoers.d/lima file
Synopsis
Generate the content of the /etc/sudoers.d/lima file for macOS host helpers that require privilege escalation.
This includes vmnet.framework support (socket_vmnet). Use --block-device=/dev/rdiskN to also emit opt-in
host block-device helper entries for the listed devices and current user.
Block devices require a root-owned helper and ancestor directories; user-writable
installations need additional setup: https://lima-vm.io/docs/config/disk/#sudoers-setup
--block-device on start/edit selects devices; it does not install sudoers grants.
The content is written to stdout, NOT to the file.
This command must not run as the root user.
See https://lima-vm.io/docs/config/network/vmnet/#socket_vmnet for the usage.
limactl sudoers [--check [SUDOERSFILE-TO-CHECK]] [flags]
Examples
To generate the /etc/sudoers.d/lima file:
$ limactl sudoers | sudo tee /etc/sudoers.d/lima
To validate the existing /etc/sudoers.d/lima file:
$ limactl sudoers --check /etc/sudoers.d/lima
To authorize host block devices for the current user (include every current-user grant you want to keep):
$ limactl sudoers --block-device=/dev/disk4 >etc_sudoers.d_lima
$ less etc_sudoers.d_lima
$ visudo -cf etc_sudoers.d_lima
$ sudo install -o root -g wheel -m 0444 etc_sudoers.d_lima /etc/sudoers.d/lima
Options
--block-device strings include the macOS VZ host block-device helper for the current user and comma-separated devices
--check ~/.lima/_config/networks.yaml check that the sudoers file is up-to-date with ~/.lima/_config/networks.yaml
-h, --help help for sudoers
Options inherited from parent commands
--debug Debug mode
--log-format string Set the logging format [text, json] (default "text")
--log-level string Set the logging level [trace, debug, info, warn, error]
--tty Enable TUI interactions such as opening an editor. Defaults to true when stdout is a terminal. Set to false for automation.
-y, --yes Alias of --tty=false
SEE ALSO
- limactl - Lima: Linux virtual machines