Skip to content

TomGousseau/VMAwarecsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VMAware C# 🔍

Probably Not gonna update and maintain csharp version for obvious reason Simple, fast VM detection library for C# / .NET — no false positives!

Features

No Hyper-V False Positives - Won't flag Windows hosts with Hyper-V enabled
Simple API - Just 3 functions: Detect(), Percentage(), Brand()
Fast - Cached results, runs detection once
Modern - Works with .NET 6.0+
Single File - Just copy VMAware.cs into your project

Quick Start

using VMDetection;

// Check if running in VM
if (VMAware.Detect())
{
    Console.WriteLine("Running in a VM!");
}

// Get confidence (0-100%)
int confidence = VMAware.Percentage();

// Get VM brand name ("VMware", "VirtualBox", etc.)
string brand = VMAware.Brand();

Detected VMs

Brand Detection
VMware Registry, WMI, files, drivers, MAC
VirtualBox Registry, WMI, files, drivers, MAC
QEMU/KVM Registry, WMI, disk serial, VirtIO
Xen WMI, BIOS, MAC
Parallels Registry, WMI, processes
Sandboxie DLL, processes
Wine ntdll export
Cuckoo Files, pipes
AWS BIOS vendor
Google Cloud BIOS vendor
Azure BIOS vendor

Why No Hyper-V Detection?

Windows 10/11 with Hyper-V enabled shows hypervisor signatures even on bare metal. This causes false positives. We skip these checks to ensure reliability.

If you NEED Hyper-V detection, check this manually:

// Only use if you're sure you're not on a Windows host with Hyper-V enabled!
bool hyperVGuest = Registry.LocalMachine
    .OpenSubKey(@"SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters") != null;

Installation

Option 1: Copy the file

Just copy VMAware.cs into your project. Done!

Option 2: Build as DLL

dotnet build -c Release

Option 3: NuGet (coming soon)

Install-Package VMAware

API Reference

Method Returns Description
VMAware.Detect() bool True if VM detected (score ≥ 150)
VMAware.Percentage() int Confidence 0-100%
VMAware.Brand() string VM name ("VMware", "Unknown", etc.)
VMAware.BrandEnum() VMBrand Enum value for brand
VMAware.Reset() void Force re-detection

Requirements

  • Windows
  • .NET 6.0+ (or .NET Framework 4.7.2+ with minor changes)
  • System.Management reference

Credits

Based on VMAware by kernelwernel.

License

MIT

About

Csharp version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages