tpt-virtual

Rust

An open-source, Rust-based microkernel VMM unifying VMs, containers, and WebAssembly workloads with hardware-level GPU/NPU virtualization. Built for the AI era and the post-Broadcom/VMware era of infrastructure freedom.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust89.3%TypeScript4.6%Shell2.2%HCL1.3%CSS1.2%Starlark0.8%Dockerfile0.2%Ruby0.2%Go Template0.2%HTML0.0%
README

TPT Virtual

Infrastructure Freedom Through Technical Excellence

License: MIT License: Apache 2.0 CI

TPT Virtual is an open-source virtualization platform built in Rust. It provides a microkernel-style VMM that unifies VMs, containers, and WebAssembly workloads, plus a distributed orchestrator, storage/networking layers, and a VMware migration toolchain.

What's Implemented

These features are wired end-to-end through the CLI (tpt):

  • VM lifecycle — create, start, stop, delete, snapshot via VmManager with KVM acceleration (feature-gated, Linux only)
  • CLItpt binary with subcommands for vm, snapshot, storage, network, cluster, migrate, gpu, container, wasm, policy, backup, and monitoring
  • Networking — virtual bridges, TAP devices, SDN/policy layer (tpt-networking)
  • Storage — disk images, pools, replication, snapshots, block devices (tpt-storage)
  • Monitoring — centralized logging, metrics collection, health checks, alerting (tpt-common observability)
  • Cluster orchestration — multi-node scheduling, HA, migration coordination over gRPC (tpt-orchestrator)
  • Backup/DR — full/incremental backups with disaster recovery (tpt-storage)
  • GPU discovery — PCI enumeration on Linux via sysfs with IOMMU group detection
  • Container/Wasm stubsContainerManager, WasmManager exist with placeholder implementations

What's Planned (Deep Runtime Integration)

  • Real cgroups/namespace integration for containers (currently stubs)
  • Real Wasmtime runtime integration (currently stubs)
  • Real vCenter API client for VMware migration (currently stubs)
  • Full gRPC transport for orchestrator communication
  • Live migration with actual memory transfer
  • Hardware GPU passthrough with VFIO binding

See spec.txt for the full design document and todo.md for the phased roadmap.

Architecture

┌─────────────────────────────────────────────────────────────┐
│                  TPT Virtual Control Plane                   │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐       │
│  │   Web UI     │  │   REST API   │  │   CLI Tool   │       │
│  └──────────────┘  └──────────────┘  └──────────────┘       │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                  TPT Virtual Orchestrator                    │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐       │
│  │  Scheduler   │  │  Networking  │  │   Storage    │       │
│  └──────────────┘  └──────────────┘  └──────────────┘       │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                    TPT Virtual VMM (Rust)                    │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐       │
│  │  VM Manager  │  │ ContainerMgr │  │  Wasm Runtime│       │
│  │  (KVM accel) │  │  (stub)      │  │  (stub)      │       │
│  └──────────────┘  └──────────────┘  └──────────────┘       │
└─────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────┐
│                    Host OS (Minimal Linux)                   │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐       │
│  │   Kernel     │  │  Device Mgr  │  │  Telemetry   │       │
│  └──────────────┘  └──────────────┘  └──────────────┘       │
└─────────────────────────────────────────────────────────────┘

Crates

CrateDescription
tpt-commonShared types, Workload trait, config, error, platform, monitoring
tpt-vmmVMM binary/lib — VmManager, KVM device emulation, GPU/container/Wasm backends
tpt-orchestratorMulti-node control plane, scheduler, HA, migration over gRPC
tpt-storageDisk images, pools, replication, snapshots, backup/DR, VMware migration
tpt-networkingVirtual bridges, TAP devices, SDN/policy layer
tpt-cliclap-derived tpt binary — one subcommand tree per domain
tpt-guest-agentIn-guest agent (heartbeat, shutdown) replacing VMware Tools
web-ui/React + TypeScript + Vite SPA

Build

Prerequisites

  • Rust 1.86.0+ (see rust-toolchain.toml)
  • Linux with KVM support (for VMM acceleration)
  • Bazel 7.6.1+ (optional, for Bazel builds)
# Clone
git clone https://github.com/tpt-solutions/tpt-virtual.git
cd tpt-virtual

# Build (default features)
cargo build --workspace

# Build with KVM support (Linux only)
cargo build -p tpt-vmm --features kvm

# Or build with Bazel
bazel build //...

Test

cargo test --workspace
cargo test -p tpt-vmm vm_integration

Lint

cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo fmt --all -- --check

Run

cargo run -- tpt vm list
cargo run -- tpt --help

CLI Usage

# VM lifecycle
tpt vm list
tpt vm create --name my-vm --cpus 2 --memory 2048
tpt vm start <vm-id>
tpt vm stop <vm-id>
tpt vm stats <vm-id>
tpt vm summary

# Snapshots
tpt snapshot list <vm-id>
tpt snapshot create <vm-id> my-snapshot
tpt snapshot restore <snapshot-id>

# Storage
tpt storage list
tpt storage create-disk my-disk --size 10G

# Networking
tpt network create my-net --ip 192.168.100.1/24 --dhcp
tpt network connect <vm-id> my-net

# GPU
tpt gpu scan
tpt gpu assign 0000:01:00.0 <vm-id>

# Containers / WebAssembly / Policies / Backup / Migration / Monitoring
tpt container list
tpt wasm load --name api --file api.wasm --wasi
tpt policy list
tpt backup create daily-full --type full --vms vm-001
tpt migrate connect vcenter.example.com --username admin
tpt monitor health
tpt monitor metrics

Development Phases

PhaseFocusStatus
Phase 1Foundation — VMM, VM lifecycle, CLI, web UIComplete
Phase 2Clustering — multi-node, storage, networking, HAComplete
Phase 3VMware Migration — vCenter, VMDK, guest agentsComplete
Phase 4Advanced — GPU, containers, Wasm, SDN, backupIn progress (stubs wired)

License

TPT Virtual is dual-licensed under:

You may choose either license for your use. All source files carry the SPDX identifier:

SPDX-License-Identifier: MIT OR Apache-2.0