Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cat > ~/Library/LaunchAgents/local.$VM_NAME.plist << EOF
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.$VM_NAME</string>
<string>$VM_NAME.local</string>
<key>ProgramArguments</key>
<array>
<string>$(brew --prefix vmnet-helper)/libexec/vmnet-run</string>
Expand Down Expand Up @@ -166,7 +166,7 @@ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/local.$VM_NAME.plist
## Start the Docker VM

```console
launchctl start local.docker
launchctl start docker.local
```

Wait for the VM to boot:
Expand Down Expand Up @@ -195,29 +195,29 @@ EOF
Restart the VM:

```console
launchctl stop local.docker
until launchctl print gui/$(id -u)/local.docker | grep -q 'state = not running'; do sleep 1; done
launchctl start local.docker
launchctl stop docker.local
until launchctl print gui/$(id -u)/docker.local | grep -q 'state = not running'; do sleep 1; done
launchctl start docker.local
until nc -z docker.local 22; do true; done
```

## Add a Docker context

```console
docker context create vmnet \
docker context create docker.local \
--docker "host=ssh://root@docker.local"
```

Verify the connection:

```console
docker --context vmnet version
docker --context docker.local version
```

## Make it your default

```console
docker context use vmnet
docker context use docker.local
```

> [!TIP]
Expand Down Expand Up @@ -300,24 +300,24 @@ docker rm -f speedtest
Start the VM:

```console
launchctl start local.docker
launchctl start docker.local
until nc -z docker.local 22; do true; done
```

Stop the VM:

```console
launchctl stop local.docker
launchctl stop docker.local
```

## Cleanup

To remove the VM:

```console
docker context rm vmnet
launchctl stop local.docker
launchctl bootout gui/$(id -u)/local.docker
docker context rm docker.local
launchctl stop docker.local
launchctl bootout gui/$(id -u)/docker.local
rm ~/Library/LaunchAgents/local.docker.plist
rm -r ~/vms/docker
ssh-keygen -R docker.local
Expand Down
12 changes: 6 additions & 6 deletions docs/launchd.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ cat > ~/Library/LaunchAgents/local.$VM_NAME.plist << EOF
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.$VM_NAME</string>
<string>$VM_NAME.local</string>
<key>ProgramArguments</key>
<array>
<string>$(brew --prefix vmnet-helper)/libexec/vmnet-run</string>
Expand Down Expand Up @@ -215,19 +215,19 @@ available options.
Start the VM:

```console
launchctl start local.$VM_NAME
launchctl start $VM_NAME.local
```

Stop the VM (cleanly terminates vmnet-helper and vfkit):

```console
launchctl stop local.$VM_NAME
launchctl stop $VM_NAME.local
```

### Checking status

```console
launchctl print gui/$(id -u)/local.$VM_NAME | grep "^\tstate"
launchctl print gui/$(id -u)/$VM_NAME.local | grep "^\tstate"
```

When the VM is running:
Expand Down Expand Up @@ -285,8 +285,8 @@ ssh my-vm.local
> This deletes all VM data including the disk image.

```console
launchctl stop local.$VM_NAME
launchctl bootout gui/$(id -u)/local.$VM_NAME
launchctl stop $VM_NAME.local
launchctl bootout gui/$(id -u)/$VM_NAME.local
rm ~/Library/LaunchAgents/local.$VM_NAME.plist
rm -r ~/vms/$VM_NAME
```
Expand Down
Loading
Loading