Probably Not gonna update and maintain csharp version for obvious reason Simple, fast VM detection library for C# / .NET — no false positives!
✅ 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
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();| 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 |
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;Just copy VMAware.cs into your project. Done!
dotnet build -c ReleaseInstall-Package VMAware
| 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 |
- Windows
- .NET 6.0+ (or .NET Framework 4.7.2+ with minor changes)
System.Managementreference
Based on VMAware by kernelwernel.
MIT