使用
启动 Linux 实例
运行 limactl start <INSTANCE> 来创建并启动第一个实例。<INSTANCE> 名称默认为 “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.
选择 Proceed with the current configuration,并等待在主机终端上打印 “READY”。
对于自动化,可以使用 --tty=false 标志来禁用交互式用户界面。
自定义
从模板 “docker” 创建实例 “default”:
limactl create --name=default template://docker
limactl start default
另请参见命令参考:
执行 Linux 命令
运行 limactl shell <INSTANCE> <COMMAND> 在虚拟机上启动 <COMMAND>:
limactl shell default uname -a
另请参见命令参考:
对于 “default” 实例,此命令可以简化为 lima <COMMAND>。
lima uname -a
Shell completion
- To enable bash completion, add
source <(limactl completion bash)to~/.bash_profile. - To enable zsh completion, see
limactl completion zsh --help