Skip to content

Commit 6759b52

Browse files
committed
vde_vmnet: add more docs
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 93d9512 commit 6759b52

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ The current default spec:
202202
- ["Port forwarding does not work"](#port-forwarding-does-not-work)
203203
- [stuck on "Waiting for the essential requirement 1 of X: "ssh"](#stuck-on-waiting-for-the-essential-requirement-1-of-x-ssh)
204204
- ["permission denied" for `limactl cp` command](#permission-denied-for-limactl-cp-command)
205+
- [Networking](#networking)
206+
- ["Cannot access the guest IP 192.168.5.15 from the host"](#cannot-access-the-guest-ip-192168515-from-the-host)
205207
- ["Hints for debugging other problems?"](#hints-for-debugging-other-problems)
206208

207209
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -304,6 +306,15 @@ The `copy` command only works for instances that have been created by lima 0.5.0
304306
< ~/.lima/_config/user.pub limactl shell INSTANCE sh -c 'tee -a ~/.ssh/authorized_keys'
305307
```
306308

309+
### Networking
310+
#### "Cannot access the guest IP 192.168.5.15 from the host"
311+
312+
The default guest IP 192.168.5.15 is not accessible from the host and other guests.
313+
314+
To add another IP address that is accessible from the host and other virtual machines, enable [`vde_vmnet`](https://github.com/lima-vm/vde_vmnet).
315+
316+
See [`./docs/network.md`](./docs/network.md).
317+
307318
### "Hints for debugging other problems?"
308319
- Inspect logs:
309320
- `limactl --debug start`

docs/internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ The directory contains the following files:
8585

8686
- `user-data`: [Cloud-init user-data](https://cloudinit.readthedocs.io/en/latest/topics/format.html)
8787
- `meta-data`: [Cloud-init meta-data](https://cloudinit.readthedocs.io/en/latest/topics/instancedata.html)
88+
- `network-config`: [Cloud-init Networking Config Version 2](https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html)
8889
- `lima.env`: the environment variables
8990
- `lima-guestagent`: Lima guest agent binary
9091
- `nerdctl-full.tgz`: [`nerdctl-full-<VERSION>-linux-<ARCH>.tar.gz`](https://github.com/containerd/nerdctl/releases)

docs/network.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Network
2+
3+
## user-mode network (192.168.5.0/24)
4+
5+
By default Lima only enables the user-mode networking aka "slirp".
6+
7+
### Guest IP (192.168.5.15)
8+
9+
The guest IP address is typically set to 192.168.5.15.
10+
11+
This IP address is not accessible from the host by design.
12+
13+
Use `vde_vmnet` to allow accessing the guest IP from the host and other guests.
14+
15+
### Host IP (192.168.5.2)
16+
17+
The loopback addresses of the host is accessible from the guest as 192.168.5.2.
18+
19+
### DNS (192.168.5.3)
20+
21+
The DNS.
22+
23+
## `vde_vmnet` (192.168.105.0/24)
24+
25+
[`vde_vmnet`](https://github.com/lima-vm/vde_vmnet) is required for adding another guest IP that is accessible from
26+
the host and other guests.
27+
28+
To enable `vde_vmnet` (in addition the user-mode network), add the following lines to the YAML after installing `vde_vmnet`.
29+
30+
```yaml
31+
network:
32+
# The instance can get routable IP addresses from the vmnet framework using
33+
# https://github.com/lima-vm/vde_vmnet. Both vde_switch and vde_vmnet
34+
# daemons must be running before the instance is started. The interface type
35+
# (host, shared, or bridged) is configured in vde_vmnet and not lima.
36+
vde:
37+
# url points to the vde_switch socket directory
38+
- url: "/var/run/vde.ctl"
39+
# MAC address of the instance; lima will pick one based on the instance name,
40+
# so DHCP assigned ip addresses should remain constant over instance restarts.
41+
macAddress: ""
42+
# Interface name, defaults to "vde0", "vde1", etc.
43+
name: ""
44+
```
45+
46+
The IP address range is typically `192.168.105.0/24`, but depends on the configuration of `vde_vmnet`.
47+
See [the documentation of `vde_vmnet`](https://github.com/lima-vm/vde_vmnet) for further information.

pkg/limayaml/default.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ disk: "100GiB"
3333

3434
network:
3535
# The instance can get routable IP addresses from the vmnet framework using
36-
# https://github.com/AkihiroSuda/vde_vmnet. Both vde_switch and vde_vmnet
36+
# https://github.com/lima-vm/vde_vmnet. Both vde_switch and vde_vmnet
3737
# daemons must be running before the instance is started. The interface type
3838
# (host, shared, or bridged) is configured in vde_vmnet and not lima.
3939
vde:

0 commit comments

Comments
 (0)