Skip to content

docs(vm-isolation): a recommendation, not a menu - #118

Merged
GeiserX merged 2 commits into
mainfrom
docs/vm-isolation-recommendation
Aug 6, 2026
Merged

docs(vm-isolation): a recommendation, not a menu#118
GeiserX merged 2 commits into
mainfrom
docs/vm-isolation-recommendation

Conversation

@GeiserX

@GeiserX GeiserX commented Aug 6, 2026

Copy link
Copy Markdown
Owner

CashPilot-Desktop-bam asked for research and a recommendation. The research was already here and it's excellent — measured on real hardware, not quoted from vendor docs. This adds the conclusion it was missing.

The recommendation

Two options were on the table: Desktop spawns a VM per service, or document "run Desktop itself in a VM." They differ by roughly two orders of magnitude in cost.

The measurements point at neither. Don't build a VM orchestrator — on macOS and Windows the boundary already exists, and the work is making it visible.

Why

Docker Desktop doesn't run containers on the host. It runs them inside a Linux VM — LinuxKit under Virtualization.framework on macOS, WSL2 on Windows. This page already records the Windows half, including that Salad ships its own WSL2 distribution.

So on the two platforms where anyone actually runs Desktop, every third-party earning binary is already in a virtual machine. A second layer would rebuild, at considerable cost, a boundary the platform hands you free.

That reframes the whole feature. The gap isn't isolation — it's that nothing tells the user which boundary they're behind, and the answer differs per platform in a way nobody could guess:

Platform What contains the binaries Shares the user's kernel?
macOS + Docker Desktop a LinuxKit VM no
macOS + Colima / Lima a Lima VM no
Windows + Docker Desktop a WSL2 VM no
Windows + Salad its own WSL2 distro no
Linux + Docker/Podman namespaces and cgroups only yes

Linux is the one row that differs, and it differs in the direction that matters: an escape there lands on the user's own kernel.

What to build, in order

  1. Say which boundary is in force. internal/runtime already distinguishes docker-desktop-macos, docker-desktop-windows, colima and the rest. Turning that into an honest sentence — "your services run inside a Linux VM" vs "your services share this machine's kernel" — is a small change on existing code, and it's the entire remaining value on macOS and Windows.
  2. On Linux, document the VM path rather than automating it. The only platform where a VM adds a boundary that isn't already there — and, per the measurements above, it costs nothing in GPU earnings.
  3. Only automate if someone asks, at which point it's a Linux-only feature: far smaller than the cross-platform VM manager originally imagined.

What this avoids

Per-platform hypervisor backends, guest image lifecycle and updates, VM networking that must preserve each service's egress IP (providers cap per IP — CashPilot-5qc), GPU passthrough plumbing, and a UI for all of it.

One claim I did not measure

That Docker Desktop on macOS uses a LinuxKit VM. It's the documented architecture and matches the Windows behaviour measured on this page — but every other claim here was verified on hardware and this one wasn't, so it's flagged in the text rather than blended in. docker info on a Mac settles it in one line: a Linux kernel, not Darwin.

Docker wasn't running locally this session, which is exactly why it's marked rather than asserted.

Summary by CodeRabbit

  • Documentation
    • Added research and recommendations on cross-platform virtual machine isolation.
    • Clarified how Docker Desktop, Colima/Lima, WSL2, and managed virtual machines isolate services across operating systems.
    • Recommended documenting Linux container isolation and exposing the active isolation boundary.
    • Deferred Linux-only VM orchestration pending further validation.
    • Noted that the macOS Docker Desktop architecture requires additional verification.

Two options were on the table -- Desktop spawns a VM per service, or
document 'run Desktop itself in a VM' -- differing by roughly two orders
of magnitude in cost. The measurements point at neither.

DO NOT BUILD A VM ORCHESTRATOR. On macOS and Windows the boundary already
exists: Docker Desktop runs containers inside a Linux VM (LinuxKit under
Virtualization.framework; WSL2 on Windows), and this page already records
that Salad ships its own WSL2 distribution. On the two platforms where
anyone actually runs Desktop, every third-party binary is ALREADY in a
virtual machine. A second layer rebuilds, expensively, what the platform
gives away.

That reframes the feature. The gap is not isolation -- it is that nothing
tells the user which boundary they are behind, and the answer differs per
platform in a way nobody could guess. Linux is the one row where
containers share the user's kernel, and it is the only place a VM adds
something that is not already there.

So, in order: say which boundary is in force (internal/runtime already
distinguishes the providers, so this is a sentence on top of existing
code); document the VM path for Linux rather than automating it; and only
automate if someone asks, at which point it is Linux-only -- far smaller
than the cross-platform VM manager originally imagined.

What that avoids: per-platform hypervisor backends, guest image
lifecycle, VM networking that must preserve each service's egress IP
(providers cap per IP, CashPilot-5qc), GPU passthrough, and a UI for all
of it.

One claim is flagged as NOT measured this session -- that Docker Desktop
on macOS uses a LinuxKit VM. It is the documented architecture and
matches the measured Windows behaviour, but every other claim on this
page was verified on hardware and this one was not. Client: Docker Engine - Community
 Version:    29.7.1
 Context:    colima
 Debug Mode: false
 Plugins:
  scout: Docker Scout (Docker Inc.)
    Version:  v1.22.0
    Path:     /Users/sergio/.docker/cli-plugins/docker-scout

Server: on a
Mac settles it in one line.

Refs: CashPilot-Desktop-bam
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cf7256f-ad99-41be-92ac-418de3d522fa

📥 Commits

Reviewing files that changed from the base of the PR and between 0f5bc0f and 822893a.

📒 Files selected for processing (1)
  • docs/vm-isolation-research.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/vm-isolation-research.md

📝 Walkthrough

Walkthrough

The research document compares service isolation across macOS, Windows, and Linux. It recommends documenting existing isolation boundaries, deferring Linux-only automation, and verifying the macOS Docker Desktop claim.

Changes

VM isolation research

Layer / File(s) Summary
Platform isolation findings
docs/vm-isolation-research.md
The document describes VM-backed isolation through Docker Desktop, Colima/Lima, WSL2, and Salad. It contrasts these environments with Linux containers that share the host kernel.
Recommendation and validation
docs/vm-isolation-research.md
The document recommends exposing the active boundary, documenting Linux VM usage, and deferring Linux-only automation. It lists avoided VM-manager infrastructure and requires docker info verification for the macOS claim.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies a documentation recommendation about VM isolation and matches the pull request's main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/vm-isolation-recommendation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/vm-isolation-research.md`:
- Around line 115-118: Update the discussion of “Desktop spawns a VM per
service” and “run Desktop itself inside a VM” to remove the unsupported
two-orders-of-magnitude cost claim, or add documented resource/cost measurements
that substantiate it; preserve the conclusion that the measurements support
neither option.
- Around line 160-166: Update the Linux VM recommendation in the documented
option section to qualify the GPU-cost statement: replace the claim that it
costs nothing in GPU earnings with wording that Linux VM GPU impact is
unmeasured unless supported by Linux-specific measurements. Do not extend the
macOS Metal or Windows WSL2 results to Linux.
- Around line 125-128: Update the macOS Docker Desktop verification section and
its “not measured” footnote to state that docker info was not run on Mac
hardware, and require selecting or validating the local Docker Desktop context
with docker context show before checking docker info --format '{{.OSType}}'.
Ensure the Linux OSTType conclusion is only based on the local context, not a
remote Linux context.
- Around line 130-133: Revise the VM-boundary claims in the referenced
discussion, including lines 152–158, to apply only to Docker-backed container
workloads rather than every earning binary. Preserve the per-provider dashboard
statement, and explicitly represent mixed or unknown runtime boundaries when
services use different or unsupported execution modes, including native
Mysterium and hybrid deployments.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f53563f-292b-40fc-8fd1-b1b0fa1423c3

📥 Commits

Reviewing files that changed from the base of the PR and between a986acd and 0f5bc0f.

📒 Files selected for processing (1)
  • docs/vm-isolation-research.md

Comment thread docs/vm-isolation-research.md Outdated
Comment on lines +125 to +128
Docker Desktop does not run containers on the host. It runs them inside a Linux
VM: a LinuxKit guest under Virtualization.framework on macOS, and a WSL2 guest on
Windows. The section above already records the Windows half of this, and notes
that Salad ships its own WSL2 distribution.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

docker context show
docker info --format 'OSType={{.OSType}} KernelVersion={{.KernelVersion}}'

Repository: GeiserX/CashPilot-Desktop

Length of output: 247


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== repo files matching vm-isolation-research.md =="
git ls-files | rg '(^|/)vm-isolation-research\.md$' || true

file="$(git ls-files | rg '(^|/)vm-isolation-research\.md$' | head -n 1 || true)"
if [ -n "${file:-}" ]; then
  echo "== file: $file =="
  wc -l "$file"
  echo "== lines 110-135 =="
  sed -n '110,135p' "$file" | nl -ba -v110
  echo "== lines 170-195 =="
  sed -n '170,195p' "$file" | nl -ba -v170
fi

echo "== broader docker context/command references =="
rg -n "docker (context|info)|OSType|KernelVersion|LinuxKit|Docker Desktop" . -g '!*node_modules*' -g '!*dist*' -g '!*build*' || true

Repository: GeiserX/CashPilot-Desktop

Length of output: 381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== relevant doc sections =="
awk 'NR>=110 && NR<=190 { printf "%5d %s\n", NR, $0 }' docs/vm-isolation-research.md

echo
echo "== broader docker command/context references =="
rg -n "docker (context|info)|OSType|KernelVersion|LinuxKit|Docker Desktop|LinuxKit" docs/vm-isolation-research.md || true

Repository: GeiserX/CashPilot-Desktop

Length of output: 5230


🌐 Web query:

Docker context shows current context docker context show docker info current context OSType

💡 Result:

To manage and inspect your current Docker environment, you can use several commands depending on the specific information you need [1][2][3]. Current Docker Context The primary command to display the name of your currently active Docker context is: docker context show [1] If you encounter an error or if this command is unavailable in your version of the Docker CLI, you can alternatively use: docker version --format='{{.Client.Context}}' [4][5] To see all available contexts and identify which one is currently in use (indicated by an asterisk *), use: docker context ls [6] OSType and System Information The OSType of the Docker daemon (the environment where the engine is running) is included in the output of the docker info command [3][7]. You can retrieve this specifically using: docker info --format '{{.OSType}}' The docker info command provides comprehensive system-wide information, including the Operating System, OSType, architecture, and the current context [3][7]. Note that the OSType refers to the engine's host OS, while your client's OS/Arch can be found in the output of docker version [3][8]. Summary of Commands: - Show current context name: docker context show [1] - List all contexts: docker context ls [6] - Show system information (including OSType): docker info [3] - Extract OSType only: docker info --format '{{.OSType}}' [3]

Citations:


Make the macOS Docker Desktop verification check the local daemon.

The docs rely on the LinuxKit premise, but the caveat says docker info was not executed on Mac hardware. Add it to the “not measured” footnote, and require docker context show/docker info --format '{{.OSType}}' for the local Docker Desktop context before using the Linux OSType result. A remote Linux context also makes that docker info check insufficient.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/vm-isolation-research.md` around lines 125 - 128, Update the macOS
Docker Desktop verification section and its “not measured” footnote to state
that docker info was not run on Mac hardware, and require selecting or
validating the local Docker Desktop context with docker context show before
checking docker info --format '{{.OSType}}'. Ensure the Linux OSTType conclusion
is only based on the local context, not a remote Linux context.

Comment on lines +130 to +133
So on the two platforms where anyone actually runs CashPilot Desktop, **every
third-party earning binary is already inside a virtual machine.** A second VM
layer would be rebuilding, at considerable cost, a boundary the platform hands
you for free.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

fd -t f -E .git | while IFS= read -r file; do
  rg -n -C 4 \
    'internal/runtime|native-process|docker-desktop-macos|docker-desktop-windows|colima|lima|salad' \
    "$file" || true
done

Repository: GeiserX/CashPilot-Desktop

Length of output: 29967


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- docs/vm-isolation-research.md relevant sections ---\n'
nl -ba docs/vm-isolation-research.md | sed -n '60,85p;110,170p'

printf '\n--- docs/BRANCH-2-RUNTIME.md native/runtime section ---\n'
nl -ba docs/BRANCH-2-RUNTIME.md | sed -n '1,90p;36,72p;125,147p;130,158p'

printf '\n--- runtime catalog/provider declarations mentioning native ---\n'
rg -n 'NativeConfig|native:|NativeProcess|native-process|Image|image|docker:' internal/docs services -S || true

printf '\n--- files likely containing runtime/provider/service YAML images/natives ---\n'
fd -t f . services internal | sed -n '1,120p'

Repository: GeiserX/CashPilot-Desktop

Length of output: 254


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- docs/vm-isolation-research.md relevant sections ---'
nl -ba docs/vm-isolation-research.md | sed -n '60,85p;110,170p'

printf '%s\n' ''
printf '%s\n' '--- docs/BRANCH-2-RUNTIME.md native/runtime section ---'
nl -ba docs/BRANCH-2-RUNTIME.md | sed -n '1,90p;36,72p;125,147p;188,202p'

printf '%s\n' ''
printf '%s\n' '--- source runtime/service declarations mentioning native and image fields ---'
rg -n -C 3 'NativeConfig|native:|NativeProcess|native-process|Image:|Image=|image:|docker:' internal services docs || true

printf '%s\n' ''
printf '%s\n' '--- service YAML files with native and/or image/docker fields ---'
for f in $(fd -t f '\.ya?ml$' services | sort); do
  if rg -q -e '^(name|slug|native:|docker:|image:|command:|Image:)' "$f"; then
    printf '%s\n' "## $f"
    nl -ba "$f" | sed -n '1,100p;1,80p'
  fi
done

Repository: GeiserX/CashPilot-Desktop

Length of output: 259


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- docs/vm-isolation-research.md relevant sections ---'
awk 'NR>=60 && NR<=85 {printf "%5d:%s\n", NR, $0} NR>=110 && NR<=170 {printf "%5d:%s\n", NR, $0}' docs/vm-isolation-research.md

echo ''
echo '--- docs/BRANCH-2-RUNTIME.md native/runtime section ---'
awk 'NR>=1 && NR<=90 {printf "%5d:%s\n", NR, $0} NR>=36 && NR<=72 {printf "%5d:%s\n", NR, $0} NR>=125 && NR<=147 {printf "%5d:%s\n", NR, $0} NR>=188 && NR<=202 {printf "%5d:%s\n", NR, $0}' docs/BRANCH-2-RUNTIME.md

echo ''
echo '--- source runtime/service declarations mentioning native and image fields ---'
rg -n -C 3 'NativeConfig|native:|NativeProcess|native-process|Image:|Image=|image:|docker:' internal services docs || true

echo ''
echo '--- service YAML files with native and/or image/docker fields ---'
python3 <<'PY'
import os
import re
from pathlib import Path

for root, dirs, files in os.walk('services'):
    for f in files:
        if not f.endswith(('.yml', '.yaml')):
            continue
        path = os.path.join(root, f)
        text = Path(path).read_text()
        if re.search(r'^(name|slug|native:|docker:|image:|command:|Image:)', text, re.M):
            print(f'## {path}')
            for i, line in enumerate(text.splitlines(), 1):
                if i <= 100 or i <= 80:
                    print(f'{i:5d}:{line}')
PY

Repository: GeiserX/CashPilot-Desktop

Length of output: 50384


Scope the VM boundary claim to Docker-backed services.

docs/BRANCH-2-RUNTIME.md makes native process support explicit for Mysterium and the hybrid path. Line [130] then says every earning binary is inside a VM, even when users run native-only mixed deployments. Limit this text to Docker-backed container workloads, keep the dashboard sentence per provider, and show mixed/unknown when services run under different runtime boundaries.

Applies to lines 152-158 as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/vm-isolation-research.md` around lines 130 - 133, Revise the VM-boundary
claims in the referenced discussion, including lines 152–158, to apply only to
Docker-backed container workloads rather than every earning binary. Preserve the
per-provider dashboard statement, and explicitly represent mixed or unknown
runtime boundaries when services use different or unsupported execution modes,
including native Mysterium and hybrid deployments.

Comment on lines +160 to +166
2. **On Linux, document the VM option rather than automating it.** This is the
only platform where a VM adds a boundary that is not already there. But it is
also where CashPilot most often runs on a server that does nothing else, which
is the "calculated risk" this page opens by acknowledging. A page describing
how to run the whole stack inside a VM — and being honest that it costs
nothing in GPU earnings, per the measurements above — serves the users who
want it without committing the project to a hypervisor abstraction.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate and inspect the referenced documentation around the claim and nearby context.
fd -a 'vm-isolation-research\.md$' . | sed 's#^\./##' | while read -r file; do
  echo "=== FILE: $file ==="
  wc -l "$file"
  echo "--- lines 130-185 ---"
  sed -n '130,185p' "$file" | nl -ba -v130
done

echo "--- references to Linux VM, GPU, WSL, Tart, measurements ---"
rg -n -i "linux|vm|gpu|wsl|tart|measurement|earnings|passthrough|hypervisor" "$(fd 'vm-isolation-research\.md$' . | tr '\n' ' ')"

Repository: GeiserX/CashPilot-Desktop

Length of output: 341


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="docs/vm-isolation-research.md"

echo "=== lines 130-185 ==="
awk 'NR>=130 && NR<=185 { printf "%4d\t%s\n", NR, $0 }' "$FILE"

echo "--- references to Linux VM, GPU, WSL, Tart, measurements ---"
rg -n -i "linux|vm|gpu|wsl|tart|measurement|earnings|passthrough|hypervisor|qemu|virtual" "$FILE"

echo "--- file section outlines by heading ---"
rg -n '^#+ ' "$FILE"

Repository: GeiserX/CashPilot-Desktop

Length of output: 8713


Qualify the Linux VM GPU-cost claim.

The Linux recommendation extends macOS Metal and Windows WSL2 measurements to a Linux VM option, but Linux GPU passthrough/VM GPU behavior is unmeasured. Replace “it costs nothing in GPU earnings, per the measurements above” with “GPU impact is unmeasured unless Linux-specific measurements support it” before relying on this guidance.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/vm-isolation-research.md` around lines 160 - 166, Update the Linux VM
recommendation in the documented option section to qualify the GPU-cost
statement: replace the claim that it costs nothing in GPU earnings with wording
that Linux VM GPU impact is unmeasured unless supported by Linux-specific
measurements. Do not extend the macOS Metal or Windows WSL2 results to Linux.

The page recorded GPU throughput and CUDA visibility. It never measured the
resource or cost difference between 'Desktop spawns a VM per service' and
'run Desktop inside a VM', so 'roughly two orders of magnitude' was a number
with nothing behind it.

State the difference qualitatively -- one is a subsystem on three platforms,
the other is a docs page -- and keep the conclusion, which the measurements do
support: neither option is justified.
@GeiserX

GeiserX commented Aug 6, 2026

Copy link
Copy Markdown
Owner Author

Good catch, and fixed — the claim was unsupported.

The page measured GPU throughput and CUDA visibility. It never measured resource or cost for "Desktop spawns a VM per service" versus "run Desktop inside a VM", so "roughly two orders of magnitude" was a number with nothing behind it.

Replaced with a qualitative statement of the real asymmetry — one option is a subsystem to build and support on three platforms, the other is a documentation page — and kept the conclusion, which the measurements do support: neither is justified.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.45%. Comparing base (a986acd) to head (822893a).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   74.45%   74.45%           
=======================================
  Files          18       18           
  Lines        3785     3785           
=======================================
  Hits         2818     2818           
  Misses        761      761           
  Partials      206      206           

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GeiserX
GeiserX merged commit fed7e93 into main Aug 6, 2026
6 of 7 checks passed
@GeiserX
GeiserX deleted the docs/vm-isolation-recommendation branch August 6, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant