Disk2vhd: Convert a Physical to Virtual Machine

Do you have some physical Windows devices that you want to achieve virtualization, but you have no idea how to best perform that? In this article, you will convert a physical to Hyper-V virtual machine effciently by creating a virtualized copy of the physical disk.

Crystal

By Crystal / Updated on June 22, 2022

Share this: instagram reddit

What is Disk2vhd

Disk2vhd is a free utility that creates virtual hard disk (VHD) of physical disks for Microsoft Virtual PC and Hyper-V virtual machine. It allows you to run Disk2vhd on the physical computers when the system is on online. Disk2vhd works to use Window’s Volume Snapshot feature to produce consistent point-in-time snapshots of the volumes of physical machine.

It simplifies the P2V process since it allows you to convert a physical disk to virtual disk and boot a VHDX file directly. However, Disk2vhd has its limit that you can only convert one physical disk at a time, so if you are an enterprise with numerous virtual machines, you should probably consider other alternative tools.

In this article, it offers 2 methods to run Disk2vhd in GUI mode or command line mode.

what is disk2vhd

How to use Disk2vhd on Windows 10

If you want to convert your physical machines to Hyper-V virtual machines, Disk2vhd is necessary for you to perform P2V migration. The following procedures will show how to run Disk2vhd on Windows 10. Before starting using it, make sure you have enough disk space to store the disk you want to convert.

Step 1. Download Disk2vhd on physical server

You can get Disk2vhd download from Microsoft website. After you have downloaded it, extract the zip file and select Run as administrator to run disk2vhd.exe.

download disk2vhd

Step 2. Convert disk to VHD(X) format

Now you can start converting the Windows 10 physical disk to VHD(X) format.

• In the open Disk2vhd wizard, you can check the options on the right side.

Prepare for use in virtual PC: It allows making the disk compatible with the deprecated Microsoft Virtual PC.

Use Vhdx: It generates a VHDX file instead of VHD file.

Note: What's the difference between VHD and VHDX?
VHDX is designed for today's hard drives. VHDX is more convenient with better performance and larger maximum disk size. It supports 64 TB instead of 2 TB in capacity, and its 4 KB size logical area size helps improve performance compared to VHD files. However, VHD can also be used in cases where cross-compatibility with other hypervisors is required.

Use Volume Shadow Copy: VSS service is crucial to keep data consistency. Using VSS is to create point-in-time snapshots of volume to ensure secure copy while using applications. If you leave this option unchecked, you will copy files directly from the live volume, not from the shadow copy.

convert disk

• Select a destination for the VHDX file. It is more recommended choosing a different disk from the one where you made the image or network path, otherwise it may cause an “inception”.

• Select the volumes you want to convert.

• Click Create to start the process, which may take a while according to your disk size.

Step 3. Create a new VM with VHDX file

When the exporting is completed, you can go to Hyper-V manager to create a virtual machine with the VHDX file.

• Click Hyper-V host >> New >> Virtual Machine.

• In Connect Virtual Hard Disk wizard, select Use an existing virtual hard disk and click Browse to find the .VHDX file.

connect virtual hard disk

Use Disk2vhd command line to convert P2V

If you want to automate Disk2vhd or operate it remotely, you can write script to create VHDs. It can specify the volumes you want included in a snapshot by drive letter (e.g. c:) or use "*" to include all volumes.

Usage: disk2vhd <[drive: [drive:]...]|[*]>

Example: disk2vhd * c:\vhd\snapshot.vhd

Disk2vhd facilitates the process of virtualizing a physical machine in Hyper-V, which enables you to convert a physical disk to VHDX file directly. But if you need to manage numerous virtual servers and are afraid of losing data in the process of disk conversion, you should utilize a professional tool instead of Disk2vhd.

Alternative secure tool: Use backup and restore instead of Disk2vhd

Besides Disk2VHD, you can use a centralized backup software for secure data migration, such as AOMEI Centralized Backupper. It works by installing an agent on both physical and virtual machines, then you can backup and manage multiple physical disks simultaneously and restore them to VMs securely from a single central console.

Not only the entire disk, you can back up and restore files, operating systems, partitions and volumes accurately, so you can migrate any kind of data you want to the VM. Meanwhile, it fully supports Windows 10, 8.1, 8, 7, Vista, XP, Windows Server 2003, 2008 (R2), 2012 (R2), 2016, Windows SBS 2003, 2008, 2011 and Windows Home Server 2011 (32/64-bit).

For AOMEI Centralized Backupper, it offers many benefits such as:

  • Saves time and reduces the centralized management cost: start, schedule, stop and monitor remote backup jobs for all clients within the same LAN.
  • Automates centralized backups with one click: Once, Daily, Weekly, Monthly to backup data, thus enhancing data security to a large extent.
  • Offers flexible backup management: 5 backup schemes available for better storage management.
  • Instant disaster recovery: restore your computer to another VM immediately to reduce the financial and reputation damage.

Please click the following button to start a 30-day free trial:

Download Free TrialWindows computers & VMs
Secure Download

How to convert multiple physical disk to virtual using backup:

1. Click Task >> New Task >> Disk Backup.

disk backup

2. Select "Add Computers" in Step 1 to add these client computers you want to back up.

There are two rules available in Step 2 that you can specify disks/partitions that you want them to be included.

Select data based on the client: manually select disks of one client computer you want to back up so that all the selected disks available on other clients will be included.

Select data based on backup rules

3. Click "Select the destination location to save the backup" in Step 3: right-click Share or NAS device or select Add Storage button to add storage repository.

4. Click Start Backup to create the task or execute the task.

How to restore a physical disk to another VM:

1. Go to the “Tasks” tab, select a disk backup task that you want to restore, click “Advanced”, and then select  “Restore”.

Tips: You can back up multiple computers at once, but you should restore it to VM one by one, for the sake of avoiding data-loss due to operational errors.

disk restore

2. Follow the wizard, you can select “Restore to other computers”. Then, select a specific disk or partition on other client computers as the restore destination below.

restore disk to other computers

Summary

This article introduces how to use Disk2vhd to convert physical to virtual machine in Hyper-V. It achieves efficient data migration and optimizes utilization of resource. After creating a new virtual machine, do not forget to backup your virtual machines for secure data protection.

If you are in VMware environment, there was a tool named VMware Converter to achieve VMware P2V or V2V migration.

Crystal
Crystal · Editor
Crystal is an editor from AOMEI Technology. She mainly writes articles about virtual machine. She is a positive young lady likes to share articles with peolpe. Off work she loves travelling and cooking which is wonderful for life.