Virtual Machine Detection
Node-locking associates a software license with a specific device using a unique identifier, often derived from hardware IDs. This ensures that each license remains tied to one machine.
In virtualized and containerized environments, hardware information reflects the virtual machine rather than the host device. This makes it more difficult to reliably bind licenses to the actual machine.
LicenseSpring addresses this with specialized methods designed for containers and virtualization. These methods accurately detect virtual environments, enabling precise device identification and consistent license enforcement.
This document describes LicenseSpring’s techniques for distinguishing virtual machine instances and explains how they strengthen software protection.
Prerequisites
Completed the Getting Started Tutorial
You should have completed the Getting Started Tutorial, specifically:
Initialized
LicenseManager(orLicenseHandler) with your configuration using the appropriate settings.Created a
LicenseIDusing eitherLicenseID::fromKeyorLicenseID::fromUserfunction, depending on the activation method you prefer.Implemented basic license management, including license activations, deactivations, and both online and local license checks.
Working With Virtual Machines
The LicenseSpring SDKs offer a distinctive feature: the capability to detect virtual machine environments.
Supported VMs
Parallels Desktop
-
*
-
* [x] a
QEMU
-
*
-
*
VirtualBox
-
*
-
*
Windows Virtual PC
-
*
-
*
VMware
-
*
-
*
Wine
-
*
-
*
Xen Project
-
*
-
*
Docker
-
*
-
*
Microsoft Hyper-V
-
*
-
*
Microsoft Azure
-
*
-
*
bhyve
-
*
-
*
FreeBSD Jail
-
*
-
*
KVM
-
*
-
*
LXC
-
*
-
*
Lguest
-
*
-
*
Linux-VServer
-
*
-
*
OpenVZ
-
*
-
*
Project ACRN
-
*
-
*
Virtual Iron
-
*
-
*
QNX Hypervisor
-
*
-
*
UTM
-
*
-
*
Enabling Virtual Machine Detection
This functionality, designed to enhance software security, can be activated manually within your program through the SDK as shown below.
Note: Virtual machine detection is disabled by default. This feature must be enabled to make use of any features mentioned throughout this tutorial.
We provide a separate DLL for VM detection in the C++ SDK package. Make sure you put this library with the LicenseSpring DLL. If it is not found, a VMDNotAvailableException will occur.
Detecting Whether Virtual Machine Detection is Enabled
After the configuration has been initialized, developers are able to detect whether virtual machine detection is currently activated with:
Within the C++ SDK, this can also be checked through the ExtendedOptions object, as shown below:
Detecting Whether a User is on a Virtual Machine
The SDKs can also check for whether a specific user currently using the application is on a virtual machine by using:
Retrieving Detected Virtual Machine Name
Developers can get the name of the user's hypervisor with the following:
VMDNotAvailableException (Windows only): Thrown in the C++ and .NET SDK in the case that VM detection dll is not found, tampered or detection failed.
Preventing Virtual Machine Access
Licenses can also be restricted from activating on virtual machines through configuration settings. By selecting the “prevent virtual machine” option in the license settings, activation attempts within virtualized environments are blocked. This ensures that the software operates only on approved physical devices, in line with product requirements.

When this feature is checked off, any actions involving our license will result in an error/exception, making the license unusable on a VM.
Within the SDK, developers can check for whether a license is allowed to work under virtual machine or not with:
VMIsNotAllowedException: Thrown on virtual machine when VM detection is enabled but product policy prohibits running on VM.
Was this helpful?