Skip to content

Commit f5c0990

Browse files
committed
README.md: clarify motivation, etc.
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 4faadbf commit f5c0990

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

README.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ Lima can be considered as a some sort of unofficial "macOS subsystem for Linux",
2525

2626
Related project: [sshocker (ssh with file sharing and port forwarding)](https://github.com/AkihiroSuda/sshocker)
2727

28+
This project is unrelated to [The Lima driver project (driver for ARM Mali GPUs)](https://gitlab.freedesktop.org/lima).
29+
30+
## Motivation
31+
32+
The goal of Lima is to promote [containerd](https://containerd.io) including [nerdctl (contaiNERD ctl)](https://github.com/containerd/nerdctl)
33+
to Mac users, but Lima can be used for non-container applications as well.
34+
2835
## Examples
2936

3037
### uname
@@ -60,7 +67,7 @@ $ lima nerdctl run -d --name nginx -p 127.0.0.1:8080:80 nginx:alpine
6067
http://127.0.0.1:8080 is accessible from both macOS and Linux.
6168

6269
> **NOTE**
63-
> Privileged ports (0-1023) cannot be forwarded
70+
> Privileged ports (1-1023) cannot be forwarded
6471
6572
For the usage of containerd and nerdctl (contaiNERD ctl), visit https://github.com/containerd/containerd and https://github.com/containerd/nerdctl.
6673

@@ -151,7 +158,7 @@ The current default spec:
151158
## How it works
152159

153160
- Hypervisor: QEMU with HVF accelerator
154-
- Filesystem sharing: [reverse sshfs](https://github.com/AkihiroSuda/sshocker/blob/v0.1.0/pkg/reversesshfs/reversesshfs.go)
161+
- Filesystem sharing: [reverse sshfs](https://github.com/AkihiroSuda/sshocker/blob/v0.1.0/pkg/reversesshfs/reversesshfs.go) (planned to be replaced with 9p soon)
155162
- Port forwarding: `ssh -L`, automated by watching `/proc/net/tcp` in the guest
156163

157164
## Developer guide
@@ -173,17 +180,18 @@ The current default spec:
173180
- VirtFS to replace the current reverse sshfs (work has to be done on QEMU repo)
174181
- [vsock](https://github.com/apple/darwin-xnu/blob/xnu-7195.81.3/bsd/man/man4/vsock.4) to replace SSH (work has to be done on QEMU repo)
175182

176-
## FAQs
177-
### "What's my login password?"
183+
## FAQs & Troubleshooting
184+
### Generic
185+
#### "What's my login password?"
178186
Password is disabled and locked by default.
179187
You have to use `limactl shell bash` (or `lima bash`) to open a shell.
180188

181189
Alternatively, you may also directly ssh into the guest: `ssh -p 60022 -o NoHostAuthenticationForLocalhost=yes 127.0.0.1`.
182190

183-
### "Does Lima work on ARM Mac?"
191+
#### "Does Lima work on ARM Mac?"
184192
Yes, it should work, but not tested on ARM.
185193

186-
### "Can I run non-Ubuntu guests?"
194+
#### "Can I run non-Ubuntu guests?"
187195
Fedora is also known to work, see [`./examples/fedora.yaml`](./examples/fedora.yaml).
188196
This file can be loaded with `limactl start ./examples/fedora.yaml`.
189197

@@ -198,53 +206,56 @@ An image has to satisfy the following requirements:
198206
- `newuidmap` and `newgidmap`
199207
- `apt-get` or `dnf` (if you want to contribute support for another package manager, run `git grep apt-get` to find out where to modify)
200208

201-
### "Can I run other container engines such as Podman?"
209+
#### "Can I run other container engines such as Podman?"
202210
Yes, if you install it.
203211

204212
containerd can be stopped with `systemctl --user disable --now containerd`.
205213

206-
### "Can I run Lima with a remote Linux machine?"
214+
#### "Can I run Lima with a remote Linux machine?"
207215
Lima itself does not support connecting to a remote Linux machine, but [sshocker](https://github.com/AkihiroSuda/sshocker),
208216
the predecessor or Lima, provides similar features for remote Linux machines.
209217

210218
e.g., run `sshocker -v /Users/foo:/home/foo/mnt -p 8080:80 <USER>@<HOST>` to expose `/Users/foo` to the remote machine as `/home/foo/mnt`,
211219
and forward `localhost:8080` to the port 80 of the remote machine.
212220

213-
### "QEMU crashes with `HV_ERROR`"
221+
### QEMU
222+
#### "QEMU crashes with `HV_ERROR`"
214223
You have to add `com.apple.security.hypervisor` entitlement to `qemu-system-x86_64` binary.
215224
See [Getting started](#getting-started).
216225

217-
### "QEMU is slow"
226+
#### "QEMU is slow"
218227
- Make sure that HVF is enabled with `com.apple.security.hypervisor` entitlement. See [Getting started](#getting-started).
219228
- Emulating non-native machines (ARM-on-Intel, Intel-on-ARM) is slow by design.
220229

221-
### "Port forwarding does not work"
222-
Privileged ports (0-1023) cannot be forwarded. e.g., you have to use 8080, not 80.
230+
#### error "killed -9"
231+
- make sure qemu is codesigned, see [Getting started](#getting-started).
232+
- if you are on macOS 10.15.7 or 11.0 or later make sure the entitlement `com.apple.vm.hypervisor` is **not** added. It only works on older macOS versions. You can clear the codesigning with `codesign --remove-signature /usr/local/bin/qemu-system-x86_64` and [start over](#getting-started).
233+
234+
235+
### SSH
236+
#### "Port forwarding does not work"
237+
Privileged ports (1-1023) cannot be forwarded. e.g., you have to use 8080, not 80.
223238

224-
### error "field SSHPubKeys must be set"
239+
#### error "field SSHPubKeys must be set"
225240

226241
Make sure you have a ssh keypair in `~/.ssh`. To create:
227242
```
228243
ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa <<<n 2>&1 >/dev/null
229244
```
230245

231-
### error "hostkeys_foreach failed: No such file or directory"
246+
#### error "hostkeys_foreach failed: No such file or directory"
232247
Make sure you have a ssh `known_hosts` file:
233248
```
234249
touch ~/.ssh/known_hosts
235250
```
236251

237-
### error "failed to execute script ssh: [...] Permission denied (publickey)"
252+
#### error "failed to execute script ssh: [...] Permission denied (publickey)"
238253
If you have a `~/.ssh/config` with a username overwrite for all hosts, exclude `127.0.0.1` from it. Example:
239254
```
240255
Host * !127.0.0.1
241256
User root
242257
```
243258

244-
### error "killed -9"
245-
- make sure qemu is codesigned, see [Getting started](#getting-started).
246-
- if you are on macOS 10.15.7 or 11.0 or later make sure the entitlement `com.apple.vm.hypervisor` is **not** added. It only works on older macOS versions. You can clear the codesigning with `codesign --remove-signature /usr/local/bin/qemu-system-x86_64` and [start over](#getting-started).
247-
248259
### "Hints for debugging other problems?"
249260
- Inspect logs:
250261
- `limactl --debug start`

0 commit comments

Comments
 (0)