How to Clone a Virtual Machine in Hyper-V?

If you are using virtualization, you might have asked this question at some point in your journey: How to clone a virtual machine in Hyper-V? Cloning a virtual machine in Hyper-V is slightly different than cloning them in VMware or VirtualBox. It is technically possible but you need to use a detour. There is no “Clone” button you can click on.

Virtual machines help us saving time and reducing costs especially in enterprise companies where hundreds of servers and client machines are required to run daily operations. In order to create a farm with numerous virtual machines, you need to find an easy way to create them in bulk which is where cloning comes in the picture.

Some hypervisors such as VMware and VirtualBox provides a cloning feature out-of-box. In general, you can clone a machine by right clicking on it and selecting “clone”. The approach is a little different in Hyper-V but it is still possible to clone virtual machines.

Clone a virtual machine in Hyper-V

There are two ways to clone a virtual machine in Hyper-V:

  1. Export/import a virtual machine
  2. Copy the virtual disk and create a new machine with the copied disk

Follow the steps below to clone a virtual machine by the ways mentioned above.

Export/import a virtual machine

  1. Right click the virtual machine. Select “Export”.
  2. Specify a folder to export virtual disk and configuration files. Click “Export”.
  3. In Hyper-V Manager, select “Import Virtual Machine”
  4. Follow the wizard to import the machine you have exported in the first step.
  5. Select “Copy the virtual machine (create a new unique ID)” in “Choose Import Type” window.
  6. In “Choose Folders to Store Virtual Hard Disks” window, select a folder that is different than the folder in which your original virtual machine. Hyper-V doesn’t allow storing both source and copied virtual machines in the same folder.
Clone virtual machine in Hyper-V
Cloned machine should be in a different folder than the source machine

Copy the virtual disk and create a new machine

  1. Go to the folder that Hyper-V stores the virtual machines (by default: C:\Users\Public\Documents\Hyper-V\Virtual hard disks).
  2. Copy and paste the virtual disk that is used by the virtual machine you want to clone.
  3. In Hyper-V Manager, select “New -> Virtual Machine”.
  4. In “Connect Virtual Hard Disk” window, select “Use an existing virtual hard disk” and specify the folder of the virtual disk you copied in step 2.
  5. Complete the wizard by following the instructions.
    Are you getting “The unsigned image’s hash is not allowed (DB)” error message while creating a new virtual machine? Check this post out.
Clone virtual machine in Hyper-V
Use an existing virtual hard disk to create a new virtual machine

Note: If you want to add the cloned virtual machines to the same Active Directory domain as source virtual machine, make sure to use Sysprep.exe. It changes the unique identifiers of the virtual machine such as SID, computer name, and IP address.

Thanks Tech Journey for this comprehensive post.

Solved: “The unsigned image’s hash is not allowed (DB)”

In this post, we will go through steps to fix “The unsigned image’s hash is not allowed” error that shows up in certain situations while using Hyper-V.

Virtualization enables IT professionals to easily build and scale client and server environments. The software called “hypervisor” is used to create and manage virtual machines. Hyper-V (formerly known as Windows Server Virtualization) is one of the most popular and robust hypervisors.

Once you create a virtual machine (VM), you will need to install an operating system (OS) in order to use it for any business or personal purpose. Operating systems can be installed in virtual machines via network, ISO file or DVD drive.

When I tried to install Windows Server 2008 R2 into an Hyper-V virtual machine via an ISO file, I received the following error message in booting screen.

3. SCSI DVD (0,1) The unsigned image’s hash is not allowed (DB)

Hyper-V error: The unsigned image's hash is not allowed. Solve "unsigned image's hash is not allowed" error
Hyper-V error: “The unsigned image’s hash is not allowed”

The solution for “The unsigned image’s hash is not allowed” error

The reason Hyper-V doesn’t allow you to use the selected ISO is that it doesn’t trust this file. In order to prevent the system being hijacked at boot time, Hyper-V allows using only the authorized images (ISOs).

Good news! Even though your ISO is not authorized, you can still use it. You need to disable “Secure Boot” by following the steps below.

  1. In Hyper-V Manager, make sure the virtual machine is turned off
  2. Select the virtual machine. Right click and select “Settings” 
  3. Go to “Security”
  4. Uncheck “Enable Secure Boot”
  5. Restart the machine and try to boot from the ISO file
"Enable Secure Boot" option. Solve "unsigned image's hash is not allowed" error
“Enable Secure Boot” option

After successfully installing OS, I would recommend enabling the “Secure Boot” back.

Trying to downgrade OS or disable “Secure Boot” in UEFI? Check this post out.

Thank you for this StackExchange post.

Solved: “Error in required structured data element” (AMP issue)

Required structured data” message is one of the most common issues seen at Google Search Console. In this post, I will explain why this error comes up and how to fix it.

AMP (Accelerated Mobile Pages) is a project supported by Google to make web pages faster and more responsive across different devices and web browsers. A library is provided by AMP Project Team for web developers. Google provides tools such as Search and Analytics to build AMP-supported web pages.

In order to check if your website is AMP-ready, go to Google Search Console. If there are any issues in any of your web pages, an error message will be displayed in the Dashboard. Here is one of the most common error messages:

Error in required structured data element
AMP version has invalid structured data

An AMP issue in Google Search Console: "Error in required structured data element"
An AMP issue in Google Search Console: “Error in required structured data element”
Detailed error message
Detailed error message

Are you receiving “Custom JavaScript is not allowed” error message? Check this post out.

Solution to fix “Required structured data element” issue

Google wants to provide a better search experience by showing related pictures near search results. These related pictures (named “Featured Image” in WordPress) should be included in the posts by their authors. If your posts don’t have related pictures, you will probably see “Error in required structured data element” or “AMP version has invalid structured data” message in Google Search Console dashboard.

An example to structured
data in search results
An example to structured
data in search results

In order to solve this AMP issue, simply add featured images to your posts and start re-validation at Google Search Console. Depending on the page count in your website, it may take a few days or weeks to complete re-validation. You will receive an email once it is completed.

For more information about structured date, visit Google’s guideline. There is also a tool to check your site compatibility to Google’s structured data rules.