Skip to content

Consider Rust bindings for vmnet-broker client library #10

Description

@nirs

Overview

This issue proposes the development of Rust bindings for vmnet-broker. This component is responsible for managing privileged network interface creation (via vmnet.framework) for virtual machines, allowing the primary virtualization process to operate without root privileges.

Rationale

Current implementations typically rely on Swift or Go. Introducing Rust bindings addresses specific memory safety and lifecycle concerns inherent in privileged brokerage services.

Potential users

Several projects in the macOS virtualization space could leverage a Rust-based broker:

  • libkrun: can use this if it implements native vmnet network like vfkit
  • OrbStack: Could utilize a standardized Rust broker for its networking backend to enhance memory safety in its privileged components.
  • Rust-based VZ Implementations: Developers building CLI-based virtualization tools in Rust (using crates like virt-fwk or objc2-virtualization) currently lack an idiomatic, safe way to interface with vmnet-broker.
  • Security-Hardened Virtualization: Developers building "minimal" or "hardened" VM runners for macOS can use a Rust broker to minimize the Trusted Computing Base (TCB) of the privileged networking component.

Issues:

  • Initial development requires significant unsafe FFI boilerplate to map vmnet C headers.
  • Maintenance overhead to track changes in Apple's networking frameworks which may not be documented as thoroughly as the core Virtualization API.

Supporting Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions