Skip to content

fix(local): isolate native disk state and preserve startup ownership - #814

Open
hqhq1025 wants to merge 1 commit into
scaleapi:mainfrom
hqhq1025:fix/local-native-disk-state
Open

hqhq1025 wants to merge 1 commit into
scaleapi:mainfrom
hqhq1025:fix/local-native-disk-state

Conversation

@hqhq1025

@hqhq1025 hqhq1025 commented Nov 19, 2026 •

Copy link
Copy Markdown

Local native-disk preparation can reject a usable KVM device because the CLI
user cannot open it directly, even though Docker can. VM overlays also need
an owned host directory and reliable cleanup when container startup finishes
late or times out.

This change:

  • Detects the KVM character device and lets Docker enforce device access.
  • Stores each guest's writable state under its sandbox work directory, runs
    the launcher with the directory owner's UID/GID, and grants its KVM group.
  • Separates startup and query deadlines, records ownership before launch,
    and preserves state when creation or cleanup has an unknown outcome.
  • Exposes prepare_bundle(..., emulate=False) so callers can prepare native
    forms without enabling emulation; the default remains unchanged.

This is a generic local Docker disk change and has no HCU or model dependency.

Validation

  • make lint passes.
  • Full framework and protocol unit suites: 17,292 passed, 8 skipped.
  • Focused preparation and disk regressions: 119 passed.
  • Plugin API check reports no breaking change.
  • A real local Windows desktop boots and tears down with these provider
    changes. Its staged driver installation, AX query and screenshot complete.

The docs should describe the native preparation option, Docker's KVM access,
and the sandbox-owned VM state directory.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

This PR gives each local disk VM its own writable folder and records container ownership before startup. It also adds native-only bundle preparation.

  • Local disk support no longer depends on CLI device permissions.
  • Each local disk launcher keeps writable VM state in its sandbox folder.
  • Local disk startup keeps its ownership record until Docker confirms the outcome.
  • Bundle preparation can skip foreign-architecture builds.

No actionable issues found.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Prepare disk launcher] --> B[Create sandbox-owned VM state]
    B --> C[Record ownership and pending start]
    C --> D[Start Docker container]
    D -->|Success| E[Clear pending start]
    D -->|Failure or cancellation| F[Attempt teardown]
    F -->|Container found and removed| G[Remove work folder]
    F -->|Start outcome unknown| H[Keep folder for later teardown]
Loading

Reviews (1) · Last reviewed commit: "fix(local): isolate native disk state an..." · Reviewed by Greptile

This branch has not been deployed

No deployments
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