Skip to content

Commit

Permalink
README.md: prioritize source installation
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AkihiroSuda committed Dec 2, 2024
1 parent 2349471 commit c02bb24
Showing 1 changed file with 67 additions and 60 deletions.
127 changes: 67 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Unlike `vde_vmnet`, `socket_vmnet` does not depend on VDE.
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Install](#install)
- [From source](#from-source)
- [From Homebrew](#from-homebrew)
- [From MacPorts](#from-macports)
- [From source](#from-source)
- [Usage](#usage)
- [QEMU](#qemu)
- [Lima](#lima)
Expand All @@ -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
```

<details>

<summary>Launchd (optional, not needed for Lima)</summary>

<p>

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
```

</p>

</details>

### From Homebrew

<details>

<p>

```bash
brew install socket_vmnet
```
Expand Down Expand Up @@ -98,8 +156,16 @@ sudo ${HOMEBREW_PREFIX}/bin/brew services stop socket_vmnet

</details>

</p>

</details>

### From MacPorts

<details>

<p>

```bash
sudo port install socket_vmnet
```
Expand Down Expand Up @@ -148,65 +214,6 @@ sudo port unload socket_vmnet

</details>

### From source

<details>

<p>

```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
```

<details>

<summary>Launchd (optional, not needed for Lima)</summary>

<p>

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
```

</p>

</details>

</p>

</details>
Expand Down

0 comments on commit c02bb24

Please sign in to comment.