Skip to content

Commit c02bb24

Browse files
committed
README.md: prioritize source installation
Homebrew is discouraged, as the `socket_vmnet` binary in the `${HOMEBREW_PREFIX}` can be replaced by any user in the `admin` group. Signed-off-by: Akihiro Suda <[email protected]>
1 parent 2349471 commit c02bb24

File tree

1 file changed

+67
-60
lines changed

1 file changed

+67
-60
lines changed

README.md

Lines changed: 67 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
1313
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
1414

1515
- [Install](#install)
16+
- [From source](#from-source)
1617
- [From Homebrew](#from-homebrew)
1718
- [From MacPorts](#from-macports)
18-
- [From source](#from-source)
1919
- [Usage](#usage)
2020
- [QEMU](#qemu)
2121
- [Lima](#lima)
@@ -39,8 +39,66 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
3939

4040
Requires macOS 10.15 or later.
4141

42+
### From source
43+
```bash
44+
sudo make install.bin
45+
```
46+
47+
This installs binaries using `PREFIX=/opt/socket_vmnet`:
48+
49+
- `/opt/socket_vmnet/bin/socket_vmnet`
50+
- `/opt/socket_vmnet/bin/socket_vmnet_client`
51+
52+
You can customize the install location using the `PREFIX` environment variable,
53+
however, it is highly recommended to set the prefix to a directory that can be
54+
only written by the root. Note that `/usr/local/bin` is sometimes chowned for a
55+
non-admin user, so `/usr/local` is _not_ an appropriate prefix.
56+
57+
Run the following command to start the daemon:
58+
59+
```bash
60+
sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
61+
```
62+
63+
<details>
64+
65+
<summary>Launchd (optional, not needed for Lima)</summary>
66+
67+
<p>
68+
69+
To install the launchd service:
70+
71+
```bash
72+
sudo make install.launchd
73+
```
74+
75+
The launchd unit file will be installed as `/Library/LaunchDaemons/io.github.lima-vm.socket_vmnet.plist`.
76+
77+
Default configuration:
78+
79+
| Config | Value |
80+
| ------- | ------------------------------ |
81+
| Socket | `/var/run/socket_vmnet` |
82+
| Stdout | `/var/log/socket_vmnet/stdout` |
83+
| Stderr | `/var/log/socket_vmnet/stderr` |
84+
| Gateway | 192.168.105.1 |
85+
86+
To uninstall the launchd service:
87+
88+
```bash
89+
sudo make uninstall.launchd
90+
```
91+
92+
</p>
93+
94+
</details>
95+
4296
### From Homebrew
4397

98+
<details>
99+
100+
<p>
101+
44102
```bash
45103
brew install socket_vmnet
46104
```
@@ -98,8 +156,16 @@ sudo ${HOMEBREW_PREFIX}/bin/brew services stop socket_vmnet
98156

99157
</details>
100158

159+
</p>
160+
161+
</details>
162+
101163
### From MacPorts
102164

165+
<details>
166+
167+
<p>
168+
103169
```bash
104170
sudo port install socket_vmnet
105171
```
@@ -148,65 +214,6 @@ sudo port unload socket_vmnet
148214

149215
</details>
150216

151-
### From source
152-
153-
<details>
154-
155-
<p>
156-
157-
```bash
158-
sudo make install.bin
159-
```
160-
161-
This installs binaries using `PREFIX=/opt/socket_vmnet`:
162-
163-
- `/opt/socket_vmnet/bin/socket_vmnet`
164-
- `/opt/socket_vmnet/bin/socket_vmnet_client`
165-
166-
You can customize the install location using the `PREFIX` environment variable,
167-
however, it is highly recommended to set the prefix to a directory that can be
168-
only written by the root. Note that `/usr/local/bin` is sometimes chowned for a
169-
non-admin user, so `/usr/local` is _not_ an appropriate prefix.
170-
171-
Run the following command to start the daemon:
172-
173-
```bash
174-
sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
175-
```
176-
177-
<details>
178-
179-
<summary>Launchd (optional, not needed for Lima)</summary>
180-
181-
<p>
182-
183-
To install the launchd service:
184-
185-
```bash
186-
sudo make install.launchd
187-
```
188-
189-
The launchd unit file will be installed as `/Library/LaunchDaemons/io.github.lima-vm.socket_vmnet.plist`.
190-
191-
Default configuration:
192-
193-
| Config | Value |
194-
| ------- | ------------------------------ |
195-
| Socket | `/var/run/socket_vmnet` |
196-
| Stdout | `/var/log/socket_vmnet/stdout` |
197-
| Stderr | `/var/log/socket_vmnet/stderr` |
198-
| Gateway | 192.168.105.1 |
199-
200-
To uninstall the launchd service:
201-
202-
```bash
203-
sudo make uninstall.launchd
204-
```
205-
206-
</p>
207-
208-
</details>
209-
210217
</p>
211218

212219
</details>

0 commit comments

Comments
 (0)