shell

limactl shell

在 Lima 中执行 shell

概述

在 Lima 中执行 shell

lima 命令是 limactl shell $LIMA_INSTANCE 的别名。$LIMA_INSTANCE 默认为 “default”。

默认情况下,使用在主机 PATH 中找到的第一个 ‘ssh’ 可执行文件连接到 Lima 实例。 可以通过设置 $SSH 环境变量来使用自定义的 ssh 别名。

Environment Variables: –preserve-env: Propagates host environment variables to the guest instance. Use LIMA_SHELLENV_ALLOW to specify which variables to allow. Use LIMA_SHELLENV_BLOCK to specify which variables to block (extends default blocklist with +).

Hint: try –debug to show the detailed logs, if it seems hanging (mostly due to some SSH issue).

limactl shell [flags] INSTANCE [COMMAND...]

选项

  -h, --help             help for shell
      --preserve-env     Propagate environment variables to the shell
      --reconnect        Reconnect to the SSH session
      --shell string     Shell interpreter, e.g. /bin/bash
      --workdir string   Working directory

从父命令继承的选项

      --debug               调试模式
      --log-format string   设置日志格式 [text, json] (default "text")
      --log-level string    设置日志级别 [trace, debug, info, warn, error]
      --tty                 启用 TUI 交互,如打开编辑器。默认在终端时为 true。自动化时设为 false。
  -y, --yes                 --tty=false 的别名

另请参见