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 (
DiagnΓ³stico de discos VMDK y qemu-nbd
Un descriptor VMDK no siempre contiene los datos del disco. Puede declarar varios extents
(FLAT, VMFS, VMFSRAW, SPARSE o VMFSSPARSE) y tambiΓ©n puede apuntar a un disco padre
mediante parentFileNameHint. Todos esos archivos forman parte de la entrada que debe estar
disponible para la inspecciΓ³n.
Cuando falta un componente, vmspect devuelve VmSpectError::MissingDiskComponent en lugar de
VmSpectError::QemuNotFound. El error conserva el nombre declarado, el descriptor principal,
la ruta resuelta y el error original del sistema operativo. Por ejemplo:
Missing VMDK extent 'drive-0-cl2-s001.vmdk' referenced by 'D:\PLC NΒ°4\MΓ‘quinas Virtuales\Windows UE 6.0 ROckWell Revs 9\drive-0-cl2.vmdk'. Resolved path: 'D:\PLC NΒ°4\MΓ‘quinas Virtuales\Windows UE 6.0 ROckWell Revs 9\drive-0-cl2-s001.vmdk'. OS error: The system cannot find the file specified.
qemu-nbd no puede reparar una cadena VMDK incompleta: solo proporciona acceso a una imagen
que ya es coherente. Si falta un extent o un disco padre, hay que recuperar el archivo correcto
desde el almacenamiento original o desde una copia consistente. No se debe renombrar otro
extent para sustituir al faltante, porque eso puede mezclar segmentos distintos y producir una
imagen silenciosamente corrupta.
Los errores de resoluciΓ³n del ejecutable (qemu_nbd, QEMU_NBD o PATH) se reportan como
QemuNotFound. Los fallos del proceso ya iniciado βcΓ³digo de salida distinto de cero,
stderr, handshake o timeout NBDβ se reportan como Nbd y conservan el contexto de ejecuciΓ³n.
π 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.5.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.