Skip to content

A comprehensive toolkit for detecting virtual machine environments

License

Notifications You must be signed in to change notification settings

PerryWerneck/vmdetect

Repository files navigation

vmdetect

A comprehensive toolkit for detecting virtual machine environments. Available as a cross-platform library (Python, C, C++) and command-line tool for Windows and Linux, it employs multiple techniques to reliably identify various virtualization platforms (e.g., VMware, VirtualBox, Hyper-V, QEMU).

Based on py_vmdetect sources from https://github.com/kepsic/py_vmdetect

Platform: Linux/Windows License: GPL v3 CodeQL Advanced build result PyPI version

Installation

Pre build packages

You can download installation package for supported linux distributions in Open Build Service

Download from open build service Download from githut Download from pypi

Examples:

Command line

vmdetect
echo $?
vmdetect -n
Bare Metal
vmdetect -i
0

Python

import virtualmachine
print(virtualmachine.name())
import virtualmachine
print(virtualmachine.id())

C++

#include <vmdetect/virtualmachine.h>
#include <iostream>

using namespace std;

int main(int argc, char **argv) {
	VirtualMachine vm;

	if(vm) {
		cout << "Running on '" << vm << "' virtual machine" << endl;
		return 1;
	}

	return 0;
}