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: about 1 year ago
JSON representation
A comprehensive toolkit for detecting virtual machine environments
- Host: GitHub
- URL: https://github.com/perrywerneck/vmdetect
- Owner: PerryWerneck
- License: gpl-3.0
- Created: 2021-10-11T17:51:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-16T17:11:25.000Z (over 1 year ago)
- Last Synced: 2025-04-17T14:40:41.990Z (about 1 year ago)
- Topics: available-on-pypi, linux, virtual-machine, windows
- Language: C++
- Homepage:
- Size: 263 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
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

[](https://www.gnu.org/licenses/gpl-3.0)
[](https://github.com/PerryWerneck/vmdetect/actions/workflows/codeql.yml)
[](https://build.opensuse.org/package/show/home:PerryWerneck:udjat/vmdetect)
[](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)
[
](https://software.opensuse.org/download.html?project=home%3APerryWerneck%3Audjat&package=vmdetect)
[
](https://github.com/PerryWerneck/vmdetect/releases)
[
](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;
}
```