How can I detect whether my Virtual machine is cloned one or not from the guest operating system in the hyper-v

Basu 41 Reputation points
2024-12-05T15:26:52.05+00:00

Hi,

I want to detect the virtual machine cloned one or not from my application, which I need to identify by executing the application in the guest operating system running on the hyper-v.

Basically, I want to know what changes will be made to the cloned system during the cloning process. So, that I can modify the application to track all those changes and detect the cloning.

Or any other suggestion how can I identify the cloned machine from the guest operating system.

Thanks

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,774 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,806 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,278 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 68,486 Reputation points
    2024-12-05T16:51:24.0533333+00:00

    unlike real hardware, it is difficult to detect VM clone. a VM clone is just a disk copy.

    the common approaches to detect VM clone:

    • the MAC address changed (must be changed if cloned vm hosted on the on the same network)
    • Virtual Machine unique id changed. access depends on the VM vendor and host O/S. it is generally changed with a clone, but not always
    • changes in the cpu configuration, memory size, number of cores, etc. this can happen without a clone.

    these all count on keeping an external database of VM properties, so you can compare the current host against what is expected.


  2. Ian Xue 38,726 Reputation points Microsoft Vendor
    2024-12-09T07:25:22.15+00:00

    Hi 67883078,

    Thanks for your post. Each VM on a Hyper-V host has an ID that must be unique within the host. You can query the unique ID and compare the original set and existing set. More information, Then specify a path to the directory where folders with the imported VM files are located. When you import a VM in Hyper-V, you are offered 3 options of VM registration on the host:

    • Register the virtual machine in-place (use the existing unique ID) — to register a VM in the directory containing the imported files (VM ID remains the same)
    • Restore the virtual machine (use the existing unique ID) — to copy the VM files to another folder (original VM ID is retained)
    • Copy the virtual machine (create a new unique ID) — to copy a VM to another directory and generate a new VM ID

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.