Skip to content

Windows/Linux library and tool to detect when running under virtual machine

License

Notifications You must be signed in to change notification settings

PerryWerneck/vmdetect

Repository files navigation

vmdetect

C++/python libraries and simple command line tool designed to detect when running under virtual machine.

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

Platform: Linux/Windows License: GPL v3 CodeQL 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;
}

About

Windows/Linux library and tool to detect when running under virtual machine

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published