An open API service indexing awesome lists of open source software.

https://github.com/perrywerneck/vmdetect

A comprehensive toolkit for detecting virtual machine environments
https://github.com/perrywerneck/vmdetect

available-on-pypi linux virtual-machine windows

Last synced: 13 days ago
JSON representation

A comprehensive toolkit for detecting virtual machine environments

Awesome Lists containing this project

README

        

# 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](https://img.shields.io/badge/Platform-Linux/Windows-blue.svg)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![CodeQL Advanced](https://github.com/PerryWerneck/vmdetect/actions/workflows/codeql.yml/badge.svg)](https://github.com/PerryWerneck/vmdetect/actions/workflows/codeql.yml)
[![build result](https://build.opensuse.org/projects/home:PerryWerneck:udjat/packages/vmdetect/badge.svg?type=percent)](https://build.opensuse.org/package/show/home:PerryWerneck:udjat/vmdetect)
[![PyPI version](https://badge.fury.io/py/virtualmachine.svg)](https://badge.fury.io/py/virtualmachine)

## Installation

### Pre build packages

You can download installation package for supported linux distributions in [Open Build Service](https://software.opensuse.org/download.html?project=home%3APerryWerneck%3Audjat&package=vmdetect)

[Download from open build service](https://software.opensuse.org/download.html?project=home%3APerryWerneck%3Audjat&package=vmdetect)
[Download from githut](https://github.com/PerryWerneck/vmdetect/releases)
[Download from pypi](https://pypi.org/project/virtualmachine)

## Examples:

### Command line

```shell
vmdetect
echo $?
```

```shell
vmdetect -n
Bare Metal
```

```shell
vmdetect -i
0
```

### Python

```python
import virtualmachine
print(virtualmachine.name())
```

```python
import virtualmachine
print(virtualmachine.id())
```

### C++

```C
#include
#include

using namespace std;

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

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

return 0;
}
```