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
You can download installation package for supported linux distributions in Open Build Service
vmdetect
echo $?
vmdetect -n
Bare Metal
vmdetect -i
0
import virtualmachine
print(virtualmachine.name())
import virtualmachine
print(virtualmachine.id())
#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;
}