Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
vmspect
vmspect is a Rust library and CLI tool for ultra-fast static inspection, forensic analysis and information extraction of virtual machine disk images (VMDK, RAW, QCOW2, VHD, VHDX, VDI, etc.).
It can examine partition-table structures (MBR/GPT), identify the guest operating system (Windows/Linux), extract complete lists of installed software and detect integration tools (Guest Tools) in a non-invasive way (without booting the virtual machine or requiring mount privileges on the host) in less than 70 ms even for virtual disks larger than 80 GiB.
🚀 Key Features
- Extreme performance and lightweight streaming (<70 ms for 80 GiB images):
- Native Rust parser: Direct, ultra-low-latency reading for
RAWandVMDKimages (monolithicSparse,monolithicFlat,twoGbMaxExtentFlat/Sparse, etc.) without external dependencies or child processes. - Integrated
qemu-nbdserver: For complex formats (QCOW2,VHDX,VDI, compressed/streamOptimized VMDK), connects over a local TCP socket (127.0.0.1) or UNIX sockets using the standard NBD protocol, with direct block streaming and no temporary files on disk.
- Native Rust parser: Direct, ultra-low-latency reading for
- Resilience against dirty registries and NTFS fallback (Graceful Degradation):
- Permissive Windows Registry reading: Tolerance for dirty or damaged registry hives (
SequenceNumberMismatchcaused by abrupt shutdowns or hot snapshots) usingHive::without_validationand isolating internal panics from third-party libraries viacatch_unwind. - NTFS fallback inspection: If the Registry hives are totally inaccessible,
vmspectgracefully degrades by inspecting the PE header of\Windows\System32\ntoskrnl.exedirectly to extract the OS build and version, and scans\Program Files, tagging applications assource: Some("FallbackFS"). - Non-fatal warnings list: Reports issues in the
warningsfield of the report without aborting the inspection pipeline.
- Permissive Windows Registry reading: Tolerance for dirty or damaged registry hives (
- Multi-hypervisor, hypervisor-agnostic Guest Tools detection:
- Full and typed support in the
GuestToolsstruct to identify and extract the version of:- VMware Tools / open-vm-tools
- VirtualBox Guest Additions
- QEMU Guest Agent
- Hyper-V Integration Services
- Full and typed support in the
- Supported guest operating systems:
- Windows (NTFS): Extracts Registry hives (
SOFTWAREandSYSTEM) by parsing uninstall keys (32 and 64-bit), operating system version, build number, Service Pack and Guest Tools. - Linux (ext2 / ext3 / ext4): Reads
/etc/os-release,/etc/hostnameand analyzes the/var/lib/dpkg/statuspackage database along with virtualization agents.
- Windows (NTFS): Extracts Registry hives (
- Scheme and file-system detection:
- Partition schemes: MBR, GPT and Volumes without a partition table.
- Signature recognition: NTFS, FAT12/16/32, ext2/3/4, XFS, Btrfs, LVM2 PV, Linux Swap.
- Agnostic and complete extraction:
- Default, complete collection of all applications and system information without noise filters or proprietary categorizations.
- Support for
--no-apps(disables application collection) and--no-system(disables OS metadata collection) flags.
- Designed for UI and CLI:
- Emits progress events in structured percentages (
0%to100%) ideal for Tauri, egui or Electron. - Cancellation support via atomic tokens (
Arc<AtomicBool>/CancellationToken) while preserving partial results.
- Emits progress events in structured percentages (
📂 Crate Structure
The project follows the standard Rust library package convention:
vmspect/
├── Cargo.toml # Crate configuration, metadata and dependencies
├── readme.md # Main documentation
├── LICENSE # MIT / Apache-2.0 license
├── src/
│ ├── lib.rs # Library entry point (public API and re-exports)
│ ├── models/ # Domain types (InspectionReport, GuestInfo, Partition, etc.)
│ │ ├── image.rs
│ │ ├── options.rs # Inspection options, progress and cancellation
│ │ ├── partition.rs
│ │ ├── software.rs # Program and GuestInfo models
│ │ └── traits.rs # Abstract traits (OsInspector, VmDriver, MemoryMapper)
│ ├── parsers/ # Per-OS analyzers
│ │ ├── mod.rs # OsInspector trait and polymorphic factory
│ │ ├── windows.rs # NTFS extraction and Registry parsing (nt-hive)
│ │ ├── linux.rs # ext4 superblock reading and DPKG database
│ │ └── desconocido.rs # Handling of unrecognized operating systems
│ └── vms/ # Disk access and virtualization layer
│ ├── mod.rs # Disk access module
│ ├── detector.rs # MBR/GPT detection and FS signatures
│ ├── nbd.rs # Native NBD client and qemu-nbd connector
│ ├── stream.rs # DiskReader facade and VirtualDisk view (Read + Seek)
│ └── vmdk.rs # Native VMDK parser (sparse and descriptors)
├── tests/ # Integration tests
│ └── integration_test.rs
└── examples/ # Ready-to-run usage examples
└── basic_inspection.rs
📦 Installation
Add vmspect to your Cargo.toml:
[]
= "0.4.0"
💡 Examples as a Library
1. Full Inspection with Guest Tools, Warnings and Progress
use Path;
use ;
2. Advanced Extraction Options
use Options;
// Disable application or system extraction depending on performance needs:
let light_options = Options ;
assert!;
assert!;
3. Concurrent Processing and Result Preservation on Cancellation
ConcurrentProcessor and InspectionEngine provide clean shutdown (Graceful Shutdown) with partial-result preservation. When the cancellation token is triggered, worker threads do not accept new images, safely finish the in-progress analysis and return all successfully processed reports:
use PathBuf;
use *;
4. Tauri / Async Runtime Integration
use Emitter;
use ;
async
🖥️ Command-Line Interface (CLI) Usage
vmspect ships a high-performance terminal binary:
# Standard inspection with human-formatted output:
# Structured JSON output (ideal for scripts, CI/CD pipelines and forensic analysis):
# Concurrent recursive scan of a full VM directory:
# Fast inspection skipping application extraction:
# Inspection skipping OS metadata:
🛠️ Running Tests and Examples
Run Unit and Integration Tests:
Run Example with a Real Disk:
📄 License
This project is licensed under the MIT or Apache-2.0 license at your option.