@@ -13,9 +13,10 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
13
13
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14
14
15
15
- [ Install] ( #install )
16
+ - [ From binary] ( #from-binary )
17
+ - [ From source] ( #from-source )
16
18
- [ From Homebrew] ( #from-homebrew )
17
19
- [ From MacPorts] ( #from-macports )
18
- - [ From source] ( #from-source )
19
20
- [ Usage] ( #usage )
20
21
- [ QEMU] ( #qemu )
21
22
- [ Lima] ( #lima )
@@ -39,30 +40,51 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
39
40
40
41
Requires macOS 10.15 or later.
41
42
42
- ### From Homebrew
43
+ ### From binary
43
44
44
45
``` bash
45
- brew install socket_vmnet
46
+ VERSION=" $( curl -fsSL https://api.github.com/repos/lima-vm/socket_vmnet/releases/latest | jq -r .tag_name) "
47
+ FILE=" socket_vmnet-${VERSION: 1} -$( uname -m) .tar.gz"
48
+
49
+ # Download the binary archive
50
+ curl -OSL " https://github.com/lima-vm/socket_vmnet/releases/download/${VERSION} /${FILE} "
51
+
52
+ # (Optional) Attest the GitHub Artifact Attestation using GitHub's gh command (https://cli.github.com)
53
+ gh attestation verify --owner=lima-vm " ${FILE} "
54
+
55
+ # (Optional) Preview the contents of the binary archive
56
+ tar tzvf " ${FILE} "
57
+
58
+ # Install /opt/socket_vmnet from the binary archive
59
+ sudo tar Cxzvf / " ${FILE} " opt/socket_vmnet
46
60
```
47
61
48
- The binaries will be installed onto the following paths:
62
+ This downloads and installs the latest release from < https://github.com/lima-vm/socket_vmnet/releases > .
49
63
50
- - ` ${HOMEBREW_PREFIX}/opt/socket_vmnet/bin/socket_vmnet `
51
- - ` ${HOMEBREW_PREFIX}/opt/socket_vmnet/bin/socket_vmnet_client `
64
+ ### From source
65
+ ``` bash
66
+ sudo make install.bin
67
+ ```
52
68
53
- The ` ${HOMEBREW_PREFIX} ` path defaults to ` /opt/homebrew ` on ARM, ` /usr/local ` on Intel.
69
+ This installs binaries using ` PREFIX= /opt/socket_vmnet ` :
54
70
55
- The ` ${HOMEBREW_PREFIX}/opt/socket_vmnet ` directory is usually symlinked to ` ../Cellar/socket_vmnet/${VERSION} ` .
71
+ - ` /opt/socket_vmnet/bin/socket_vmnet `
72
+ - ` /opt/socket_vmnet/bin/socket_vmnet_client `
73
+
74
+ You can customize the install location using the ` PREFIX ` environment variable,
75
+ however, it is highly recommended to set the prefix to a directory that can be
76
+ only written by the root. Note that ` /usr/local/bin ` is sometimes chowned for a
77
+ non-admin user, so ` /usr/local ` is _ not_ an appropriate prefix.
56
78
57
79
Run the following command to start the daemon:
58
80
59
81
``` bash
60
- mkdir -p ${HOMEBREW_PREFIX} /var/run
61
- sudo ${HOMEBREW_PREFIX} /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 ${HOMEBREW_PREFIX} /var/run/socket_vmnet
82
+ sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
62
83
```
63
84
64
- > [ !WARNING]
65
- > Typically, the ` socket_vmnet ` binary in the ` ${HOMEBREW_PREFIX} ` can be replaced by any user in the ` admin ` group.
85
+ > [ !TIP]
86
+ > ` sudo make install ` is also available in addition to ` sudo make install.bin ` .
87
+ > The former one installs the launchd service (see below) too.
66
88
67
89
<details >
68
90
@@ -73,48 +95,59 @@ sudo ${HOMEBREW_PREFIX}/opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.16
73
95
To install the launchd service:
74
96
75
97
``` bash
76
- # sudo is necessary for the next line
77
- sudo ${HOMEBREW_PREFIX} /bin/brew services start socket_vmnet
98
+ sudo make install.launchd
78
99
```
79
100
80
- The launchd unit file will be installed as ` /Library/LaunchDaemons/homebrew.mxcl .socket_vmnet.plist ` .
101
+ The launchd unit file will be installed as ` /Library/LaunchDaemons/io.github.lima-vm .socket_vmnet.plist ` .
81
102
82
103
Default configuration:
83
104
84
- | Config | Value |
85
- | ------- | ------------------------------------------------ |
86
- | Socket | ` ${HOMEBREW_PREFIX} /var/run/socket_vmnet` |
87
- | Stdout | ` ${HOMEBREW_PREFIX} /var/log/socket_vmnet/stdout` |
88
- | Stderr | ` ${HOMEBREW_PREFIX} /var/log/socket_vmnet/stderr` |
89
- | Gateway | 192.168.105.1 |
105
+ | Config | Value |
106
+ | ------- | ------------------------------ |
107
+ | Socket | ` /var/run/socket_vmnet ` |
108
+ | Stdout | ` /var/log/socket_vmnet/stdout ` |
109
+ | Stderr | ` /var/log/socket_vmnet/stderr ` |
110
+ | Gateway | 192.168.105.1 |
90
111
91
112
To uninstall the launchd service:
92
113
93
114
``` bash
94
- sudo ${HOMEBREW_PREFIX} /bin/brew services stop socket_vmnet
115
+ sudo make uninstall.launchd
95
116
```
96
117
97
118
</p >
98
119
99
120
</details >
100
121
101
- ### From MacPorts
122
+ ### From Homebrew
123
+
124
+ <details >
125
+
126
+ <p >
102
127
103
128
``` bash
104
- sudo port install socket_vmnet
129
+ brew install socket_vmnet
105
130
```
106
131
107
132
The binaries will be installed onto the following paths:
108
133
109
- - ` /opt/local /bin/socket_vmnet `
110
- - ` /opt/local /bin/socket_vmnet_client `
134
+ - ` ${HOMEBREW_PREFIX} /opt/socket_vmnet /bin/socket_vmnet`
135
+ - ` ${HOMEBREW_PREFIX} /opt/socket_vmnet /bin/socket_vmnet_client`
111
136
112
- Run the following command to start the daemon manually:
137
+ The ` ${HOMEBREW_PREFIX} ` path defaults to ` /opt/homebrew ` on ARM, ` /usr/local ` on Intel.
138
+
139
+ The ` ${HOMEBREW_PREFIX}/opt/socket_vmnet ` directory is usually symlinked to ` ../Cellar/socket_vmnet/${VERSION} ` .
140
+
141
+ Run the following command to start the daemon:
113
142
114
143
``` bash
115
- sudo /opt/local/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
144
+ mkdir -p ${HOMEBREW_PREFIX} /var/run
145
+ sudo ${HOMEBREW_PREFIX} /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 ${HOMEBREW_PREFIX} /var/run/socket_vmnet
116
146
```
117
147
148
+ > [ !WARNING]
149
+ > Typically, the ` socket_vmnet ` binary in the ` ${HOMEBREW_PREFIX} ` can be replaced by any user in the ` admin ` group.
150
+
118
151
<details >
119
152
120
153
<summary >Launchd (optional, not needed for Lima)</summary >
@@ -124,54 +157,54 @@ sudo /opt/local/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_
124
157
To install the launchd service:
125
158
126
159
``` bash
127
- sudo port load socket_vmnet
160
+ # sudo is necessary for the next line
161
+ sudo ${HOMEBREW_PREFIX} /bin/brew services start socket_vmnet
128
162
```
129
163
130
- The launchd unit file will be installed as
131
- ` /Library/LaunchDaemons/org.macports.socket_vmnet.plist ` .
164
+ The launchd unit file will be installed as ` /Library/LaunchDaemons/homebrew.mxcl.socket_vmnet.plist ` .
132
165
133
166
Default configuration:
134
167
135
- | Config | Value |
136
- | ------- | --------------------------- |
137
- | Socket | ` /var/run/socket_vmnet ` |
138
- | Stdout | ` /var/log/socket_vmnet.log ` |
139
- | Gateway | 192.168.105.1 |
168
+ | Config | Value |
169
+ | ------- | ------------------------------------------------ |
170
+ | Socket | ` ${HOMEBREW_PREFIX}/var/run/socket_vmnet ` |
171
+ | Stdout | ` ${HOMEBREW_PREFIX}/var/log/socket_vmnet/stdout ` |
172
+ | Stderr | ` ${HOMEBREW_PREFIX}/var/log/socket_vmnet/stderr ` |
173
+ | Gateway | 192.168.105.1 |
140
174
141
175
To uninstall the launchd service:
142
176
143
177
``` bash
144
- sudo port unload socket_vmnet
178
+ sudo ${HOMEBREW_PREFIX} /bin/brew services stop socket_vmnet
145
179
```
146
180
147
181
</p >
148
182
149
183
</details >
150
184
151
- ### From source
185
+ </p >
186
+
187
+ </details >
188
+
189
+ ### From MacPorts
152
190
153
191
<details >
154
192
155
193
<p >
156
194
157
195
``` bash
158
- sudo make install.bin
196
+ sudo port install socket_vmnet
159
197
```
160
198
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 `
199
+ The binaries will be installed onto the following paths:
165
200
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.
201
+ - ` /opt/local/bin/socket_vmnet `
202
+ - ` /opt/local/bin/socket_vmnet_client `
170
203
171
- Run the following command to start the daemon:
204
+ Run the following command to start the daemon manually :
172
205
173
206
``` bash
174
- sudo /opt/socket_vmnet /bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
207
+ sudo /opt/local /bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
175
208
```
176
209
177
210
<details >
@@ -183,24 +216,24 @@ sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/s
183
216
To install the launchd service:
184
217
185
218
``` bash
186
- sudo make install.launchd
219
+ sudo port load socket_vmnet
187
220
```
188
221
189
- The launchd unit file will be installed as ` /Library/LaunchDaemons/io.github.lima-vm.socket_vmnet.plist ` .
222
+ The launchd unit file will be installed as
223
+ ` /Library/LaunchDaemons/org.macports.socket_vmnet.plist ` .
190
224
191
225
Default configuration:
192
226
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 |
227
+ | Config | Value |
228
+ | ------- | --------------------------- |
229
+ | Socket | ` /var/run/socket_vmnet ` |
230
+ | Stdout | ` /var/log/socket_vmnet.log ` |
231
+ | Gateway | 192.168.105.1 |
199
232
200
233
To uninstall the launchd service:
201
234
202
235
``` bash
203
- sudo make uninstall.launchd
236
+ sudo port unload socket_vmnet
204
237
```
205
238
206
239
</p >
0 commit comments