From c02bb2413bfaaedc1250965225c5535a49c5a822 Mon Sep 17 00:00:00 2001
From: Akihiro Suda
Date: Mon, 2 Dec 2024 12:03:39 +0900
Subject: [PATCH 1/3] 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
---
README.md | 127 ++++++++++++++++++++++++++++--------------------------
1 file changed, 67 insertions(+), 60 deletions(-)
diff --git a/README.md b/README.md
index 0607086..217464c 100644
--- a/README.md
+++ b/README.md
@@ -13,9 +13,9 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
- [Install](#install)
+ - [From source](#from-source)
- [From Homebrew](#from-homebrew)
- [From MacPorts](#from-macports)
- - [From source](#from-source)
- [Usage](#usage)
- [QEMU](#qemu)
- [Lima](#lima)
@@ -39,8 +39,66 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
Requires macOS 10.15 or later.
+### From source
+```bash
+sudo make install.bin
+```
+
+This installs binaries using `PREFIX=/opt/socket_vmnet`:
+
+- `/opt/socket_vmnet/bin/socket_vmnet`
+- `/opt/socket_vmnet/bin/socket_vmnet_client`
+
+You can customize the install location using the `PREFIX` environment variable,
+however, it is highly recommended to set the prefix to a directory that can be
+only written by the root. Note that `/usr/local/bin` is sometimes chowned for a
+non-admin user, so `/usr/local` is _not_ an appropriate prefix.
+
+Run the following command to start the daemon:
+
+```bash
+sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
+```
+
+
+
+Launchd (optional, not needed for Lima)
+
+
+
+To install the launchd service:
+
+```bash
+sudo make install.launchd
+```
+
+The launchd unit file will be installed as `/Library/LaunchDaemons/io.github.lima-vm.socket_vmnet.plist`.
+
+Default configuration:
+
+| Config | Value |
+| ------- | ------------------------------ |
+| Socket | `/var/run/socket_vmnet` |
+| Stdout | `/var/log/socket_vmnet/stdout` |
+| Stderr | `/var/log/socket_vmnet/stderr` |
+| Gateway | 192.168.105.1 |
+
+To uninstall the launchd service:
+
+```bash
+sudo make uninstall.launchd
+```
+
+
+
+
+
### From Homebrew
+
+
+
+
```bash
brew install socket_vmnet
```
@@ -98,8 +156,16 @@ sudo ${HOMEBREW_PREFIX}/bin/brew services stop socket_vmnet
+
+
+
+
### From MacPorts
+
+
+
+
```bash
sudo port install socket_vmnet
```
@@ -148,65 +214,6 @@ sudo port unload socket_vmnet
-### From source
-
-
-
-
-
-```bash
-sudo make install.bin
-```
-
-This installs binaries using `PREFIX=/opt/socket_vmnet`:
-
-- `/opt/socket_vmnet/bin/socket_vmnet`
-- `/opt/socket_vmnet/bin/socket_vmnet_client`
-
-You can customize the install location using the `PREFIX` environment variable,
-however, it is highly recommended to set the prefix to a directory that can be
-only written by the root. Note that `/usr/local/bin` is sometimes chowned for a
-non-admin user, so `/usr/local` is _not_ an appropriate prefix.
-
-Run the following command to start the daemon:
-
-```bash
-sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
-```
-
-
-
-Launchd (optional, not needed for Lima)
-
-
-
-To install the launchd service:
-
-```bash
-sudo make install.launchd
-```
-
-The launchd unit file will be installed as `/Library/LaunchDaemons/io.github.lima-vm.socket_vmnet.plist`.
-
-Default configuration:
-
-| Config | Value |
-| ------- | ------------------------------ |
-| Socket | `/var/run/socket_vmnet` |
-| Stdout | `/var/log/socket_vmnet/stdout` |
-| Stderr | `/var/log/socket_vmnet/stderr` |
-| Gateway | 192.168.105.1 |
-
-To uninstall the launchd service:
-
-```bash
-sudo make uninstall.launchd
-```
-
-
-
-
-
From 44e225a19e192f0b8eac5d3c77640f9a9204a240 Mon Sep 17 00:00:00 2001
From: Akihiro Suda
Date: Mon, 2 Dec 2024 12:07:24 +0900
Subject: [PATCH 2/3] README.md: mention `make install`
Signed-off-by: Akihiro Suda
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 217464c..dc5cef4 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,10 @@ Run the following command to start the daemon:
sudo /opt/socket_vmnet/bin/socket_vmnet --vmnet-gateway=192.168.105.1 /var/run/socket_vmnet
```
+> [!TIP]
+> `sudo make install` is also available in addition to `sudo make install.bin`.
+> The former one installs the launchd service (see below) too.
+
Launchd (optional, not needed for Lima)
From b4c1bdf17de0ecced2906dd45757898c713e4753 Mon Sep 17 00:00:00 2001
From: Akihiro Suda
Date: Mon, 2 Dec 2024 12:25:12 +0900
Subject: [PATCH 3/3] README.md: mention the binary releases
Signed-off-by: Akihiro Suda
---
README.md | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/README.md b/README.md
index dc5cef4..49c90bb 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
- [Install](#install)
+ - [From binary](#from-binary)
- [From source](#from-source)
- [From Homebrew](#from-homebrew)
- [From MacPorts](#from-macports)
@@ -39,6 +40,27 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
Requires macOS 10.15 or later.
+### From binary
+
+```bash
+VERSION="$(curl -fsSL https://api.github.com/repos/lima-vm/socket_vmnet/releases/latest | jq -r .tag_name)"
+FILE="socket_vmnet-${VERSION:1}-$(uname -m).tar.gz"
+
+# Download the binary archive
+curl -OSL "https://github.com/lima-vm/socket_vmnet/releases/download/${VERSION}/${FILE}"
+
+# (Optional) Attest the GitHub Artifact Attestation using GitHub's gh command (https://cli.github.com)
+gh attestation verify --owner=lima-vm "${FILE}"
+
+# (Optional) Preview the contents of the binary archive
+tar tzvf "${FILE}"
+
+# Install /opt/socket_vmnet from the binary archive
+sudo tar Cxzvf / "${FILE}" opt/socket_vmnet
+```
+
+This downloads and installs the latest release from .
+
### From source
```bash
sudo make install.bin