This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Usage

Starting a Linux instance

Run limactl start <INSTANCE> to create and start the first instance. The <INSTANCE> name defaults to “default”.

$ limactl start
? Creating an instance "default"  [Use arrows to move, type to filter]
> Proceed with the current configuration
  Open an editor to review or modify the current configuration
  Choose another template (docker, podman, archlinux, fedora, ...)
  Exit
...
INFO[0029] READY. Run `lima` to open the shell.

Choose Proceed with the current configuration, and wait until “READY” to be printed on the host terminal.

For automation, --tty=false flag can be used for disabling the interactive user interface.

Customization

To create an instance “default” from a template “docker”:

limactl create --name=default template://docker
limactl start default

See also the command reference:

Executing Linux commands

Run limactl shell <INSTANCE> <COMMAND> to launch <COMMAND> on the VM:

limactl shell default uname -a

See also the command reference:

For the “default” instance, this command can be shortened as lima <COMMAND>.

lima uname -a

The lima command also accepts the instance name as the environment variable $LIMA_INSTANCE.

Shell completion

  • To enable bash completion, add source <(limactl completion bash) to ~/.bash_profile.
  • To enable zsh completion, see limactl completion zsh --help

1 - SSH

Instead of the limactl shell command, SSH can be used too:

$ limactl ls --format='{{.SSHConfigFile}}' default
/Users/example/.lima/default/ssh.config

$ ssh -F /Users/example/.lima/default/ssh.config lima-default

This is useful for interoperability with other software that expects the SSH connectivity.

Using SSH without additional options

Add the following line to your ~/.ssh/config:

Include ~/.lima/*/ssh.config

Then you can connect directly without specifying -F:

ssh lima-default

This configuration is notably useful for the Remote Development mode of Visual Studio Code.

Using SSH without a config file

If your SSH client does not support a config file, try specifying an equivalent of the following command:

ssh -p <PORT> -i ~/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes 127.0.0.1

The port number can be inspected as follows:

limactl list --format '{{ .SSHLocalPort }}' default

See also .lima/default/ssh.config.