Detect if your container is running under a hypervisor
William Pitcock e98601e9ba Merge pull request #12 from awilfox/master 4 years ago
.gitignore Add basic infrastructure 5 years ago
LICENSE Initial commit 5 years ago
Makefile Use cc instead of gcc for compiling. 4 years ago
README.md Use cc instead of gcc for compiling. 4 years ago
cpuid-detect.c vmware-detect: new module which begins knocking on vmware's i/o ports to do things (ref #1) 5 years ago
openvz-detect.c openvz-detect: improve detection 5 years ago
slabbed-or-not.c vmware-detect: new module which begins knocking on vmware's i/o ports to do things (ref #1) 5 years ago
vmware-detect.c Make VMware detection inline-asm portable 4 years ago
xen-detect.c xen-detect: reset xen_pv_context to 0 after a SIGILL is caught 5 years ago

README.md

slabbed-or-not

Detect if your container/VPS is running under a specific hypervisor.

Why would you want this?

Some hosting providers run their container hosting services (OpenVZ, LXC VPS, Docker-as-a-Service, etc) under a parent hypervisor, without disclosing that practice. Worse yet, a few providers have been caught doing this while explicitly claiming not to.

There are also of course, providers which do rightfully disclose their usage of a parent hypervisor for their services, usually as part of a high availability scheme.

In essence, the point of this tool is simply to disclose whether or not your container is running under a hypervisor, and what information can be collected about the hypervisor from inside the container.

It also detects common container types (i.e. OpenVZ), to clarify to the user whether or not their VPS environment is inside a container, whether it's in a hypervisor, or whether both aspects apply (container inside hypervisor).

usage

Just download the source and go, basically. You'll need a compiler installed, of course.

kaniini@localhost ~/slabbed-or-not> make
cc -o slabbed-or-not slabbed-or-not.c
kaniini@localhost ~/slabbed-or-not> ./slabbed-or-not
Container: OpenVZ
Hypervisor: Xen PV
Version: 4.3

what it can detect

  • Xen
    • PV or HVM mode
    • Hypervisor version
  • VMware
    • Hypervisor type (Workstation, GSX/ESX)
    • Enumeratable virtual devices
    • VMware Tools backdoor protocol version (usually 6)
    • Virtualized hardware model version
  • Hyper-V
  • KVM
  • bhyve