Skip to content

[Feature]: Add vsock-based control plane for microVMs (job exec + results + streaming) #49

@aniketmaurya

Description

@aniketmaurya

Problem statement

We already support SSH access into microVMs for “human debugging / exploration.” SSH is great for interactive usage, but it’s not the right primitive for automated job execution, result collection, and tight security defaults.

We should add a vsock-based control plane to run commands/jobs and return results efficiently without requiring guest IP networking.

Proposed design

In-guest: vsock-agent

A small daemon started at boot (systemd or init), listening on a fixed vsock port, e.g. PORT=5000.

Responsibilities:

  • authenticate requests (token or per-VM secret)
  • spawn commands with policy controls (timeouts, resource limits)
  • stream stdout/stderr
  • implement file transfer endpoints (optional)
  • maintain job registry (job_id → status)

Security requirements:

  • default run as non-root user
  • hard caps:
    • max runtime per request
    • max output bytes
    • max file transfer size
  • require auth token per request (passed on every call)

Host-side: vsock-client

A library + CLI integration used by our control plane:

  • connect to VM CID and port
  • request/response protocol
  • stream logs
  • fetch artifacts

Additional context

Target outcomes

Implement a vsock agent inside the microVM + a host-side client to support:

  1. Command/job execution
  • Run command in guest
  • Return: exit_code, stdout, stderr, duration_ms
  • Optional: env, cwd, stdin
  1. Streaming logs
  • Stream stdout/stderr incrementally for long-running jobs
  • Support cancellation
  1. File transfer (optional but strongly recommended)
  • put_file(local → guest)
  • get_file(guest → local)
    This unlocks “return results” (artifacts) without network.
  1. Health + metadata
  • health
  • get_system_info (kernel version, disk space, mem/cpu)
  • shutdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions