You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vmnet: support detecting Homebrew's socket_vmnet path
On Homebrew environments, socket_vmnet is installed on:
- /usr/local/opt/socket_vmnet/Cellar/<VERSION>/bin/socket_vmnet (Intel)
- /opt/homebrew/opt/socket_vmnet/Cellar/<VERSION>/bin/socket_vmnet (ARM)
The binary is usually owned by a non-root admin user. (i.e., the homebrew user)
The group is typically set to "admin".
Homebrew/homebrew-core@636ac07
Signed-off-by: Akihiro Suda <[email protected]>
Copy file name to clipboardExpand all lines: docs/network.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,11 +53,23 @@ The configuration steps are different across QEMU and VZ:
53
53
### QEMU
54
54
#### Managed (192.168.105.0/24)
55
55
56
-
Either [`socket_vmnet`](https://github.com/lima-vm/socket_vmnet) (since Lima v0.12) or [`vde_vmnet`](https://github.com/lima-vm/vde_vmnet) (Deprecated)
57
-
is required for adding another guest IP that is accessible from the host and other guests.
56
+
[`socket_vmnet`](https://github.com/lima-vm/socket_vmnet) is required for adding another guest IP that is accessible from the host and other guests.
58
57
59
-
Starting with version v0.7.0 lima can manage the networking daemons automatically. Networks are defined in
60
-
`$LIMA_HOME/_config/networks.yaml`. If this file doesn't already exist, it will be created with these default
58
+
```bash
59
+
# Install socket_vmnet
60
+
brew install socket_vmnet
61
+
62
+
# Set up the sudoers file for launching socket_vmnet from Lima
63
+
limactl sudoers >etc_sudoers.d_lima
64
+
sudo mv etc_sudoers.d_lima /etc/sudoers.d/lima
65
+
```
66
+
67
+
> **Note**
68
+
>
69
+
> Lima before v0.12 used `vde_vmnet` for managing the networks.
70
+
> `vde_vmnet` is still supported but it is deprecated and no longer documented here.
71
+
72
+
The networks are defined in `$LIMA_HOME/_config/networks.yaml`. If this file doesn't already exist, it will be created with these default
61
73
settings:
62
74
63
75
<details>
@@ -114,9 +126,8 @@ Instances can then reference these networks from their `lima.yaml` file:
114
126
115
127
```yaml
116
128
networks:
117
-
# Lima can manage daemons for networks defined in $LIMA_HOME/_config/networks.yaml
118
-
# automatically. The socket_vmnet must be installed into
119
-
# secure locations only alterable by the "root" user.
129
+
# Lima can manage the socket_vmnet daemon for networks defined in $LIMA_HOME/_config/networks.yaml automatically.
130
+
# The socket_vmnet binary must be installed into a secure location only alterable by the admin.
120
131
# The same applies to vde_switch and vde_vmnet for the deprecated VDE mode.
121
132
# - lima: shared
122
133
# # MAC address of the instance; lima will pick one based on the instance name,
@@ -126,18 +137,10 @@ networks:
126
137
# interface: ""
127
138
```
128
139
129
-
The network daemons are started automatically when the first instance referencing them is started,
140
+
The network daemon is started automatically when the first instance referencing them is started,
130
141
and will stop automatically once the last instance has stopped. Daemon logs will be stored in the
131
142
`$LIMA_HOME/_networks`directory.
132
143
133
-
Since the commands to start and stop the `socket_vmnet` daemon (or the `vde_vmnet` daemon) requires root, the user either must
134
-
have password-less `sudo` enabled, or add the required commands to a `sudoers` file. This can
returnfmt.Errorf("sudoers file %q is out of sync and must be regenerated", sudoersFile)
107
+
// Happens on upgrading socket_vmnet with Homebrew
108
+
returnfmt.Errorf("sudoers file %q is out of sync and must be regenerated (Hint: run `%s sudoers >etc_sudoers.d_lima && sudo mv etc_sudoers.d_lima %q`)",
returnfmt.Errorf(`%s %q is not owned by %q (uid: %d), but by uid %d`, file, path, root.User, root.Uid, stat.Uid)
107
+
// Not ideal, but very typical on Homebrew set up
108
+
logrus.Warnf(`%s %q is not owned by %q (uid: %d), but by uid %d (Hint: No action is necessary if uid %d is an admin, but beware that uid %d can take the root)`,
0 commit comments