Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions website/content/en/docs/faq/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ weight: 6
Password is disabled and locked by default.
You have to use `limactl shell bash` (or `lima bash`) to open a shell.

Alternatively, you may also directly ssh into the guest: `ssh -p <PORT> -i ~/.lima/_config/user -o NoHostAuthenticationForLocalhost=yes 127.0.0.1`.
The port number can be inspected by running `limactl list`.
e.g.,
```bash
limactl list --format '{{ .SSHLocalPort }}' default
```
{{% fixlinks %}}
Try virtiofs. See [`Usage » SSH`]({{< ref "/docs/usage/ssh" >}})
{{% /fixlinks %}}

#### "Does Lima work on ARM Mac?"
Yes
Expand Down
22 changes: 0 additions & 22 deletions website/content/en/docs/usage/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,6 @@ lima uname -a
```
The `lima` command also accepts the instance name as the environment variable `$LIMA_INSTANCE`.


SSH can be used too:
```console
$ limactl ls --format='{{.SSHConfigFile}}' default
/Users/example/.lima/default/ssh.config

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

#### Using SSH without the `-F` flag

To connect directly without specifying the config file, add this to your `~/.ssh/config`:

```
Include ~/.lima/*/ssh.config
```

Then you can connect directly:
```bash
ssh lima-default
```

### Shell completion
- To enable bash completion, add `source <(limactl completion bash)` to `~/.bash_profile`.
- To enable zsh completion, see `limactl completion zsh --help`
45 changes: 45 additions & 0 deletions website/content/en/docs/usage/ssh.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFC: this should be under https://lima-vm.io/docs/usage/ ("Must read") or https://lima-vm.io/docs/config/ ("Read on demand")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having SSH on a separate page looks much better

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: SSH
weight: 3
---

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

```console
$ 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`:
```bash
ssh lima-default
```

This configuration is notably useful for the Remote Development mode of [Visual Studio Code](../examples/vscode.md).

## Using SSH without a config file

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

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

The port number can be inspected as follows:
```bash
limactl list --format '{{ .SSHLocalPort }}' default
```

See also `.lima/default/ssh.config`.