This article describes the process for attaching a VHD export to a Windows host as a mounted volume and exporting its data to a thin-provisioned Microsoft Hyper-V virtual drive.
To restore a VHD to Microsoft Hyper-V with thick provisioning, see Restoring Thick-Provisioned VHD Exports to Hyper-V.
- Datto SIRIS
- Datto ALTO
- Microsoft Hyper-V
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
This article provides two methods for restoring thin-provisioned VHD exports. The Alternate method listed second is not compatible with Microsoft Windows 2019, but we have included it as an alternative that you can use with other Windows versions if desired.
During this process, you will mount a restore, create a new, dynamically-allocated virtual volume in Hyper-V, and then copy the contents of the exported VHD to the new volume.
NOTE: This article uses screenshots from Windows Server 2008. Your user experience may vary slightly on other platforms.
Follow the steps outlined below.
1. Mount an image export on your Datto device by following the steps in the Exporting to a Network Share section of the Export Image article. Make a note of the CIFS/Samba VHD Share path your appliance provides once the restore is mounted.
2. Launch Hyper-V Manager from Start → Administrative Tools → Hyper-V Manager.
3. From Hyper-V Manager, click Action → New → Hard Disk.
4. If you see a Before You Begin dialog, click Next.
5. Select the destination disk format and then click Next.
6. Choose the destination Disk Type, and then click Next.
7. Specify a name for the virtual disk and the location to save it to, and then click Next.
8. Select the disk or disks to copy by clicking Copy the contents of the specified virtual hard disk and browsing to the CIFS/Samba VHD Share path your appliance provided in step 1, then select the image file. You will repeat these steps for all volumes that you need to restore.
9. Review the summary to ensure that the virtual hard disk is configured correctly. When you are ready to proceed with disk creation, click Finish.
10. A progress bar showing the status of the transfer will appear.
- Part 1: Attaching the Volume as a Logical Drive
- Part 2: Importing the Volume into Hyper-V Manager
- Part 3: Finalizing the Restore
Part 1: Attaching the Volume as a Logical Drive
1. Before proceeding further, mount an image export on your Datto device by following the steps in the Exporting to a Network Share section of the Export Image article. Make a note of the CIFS/Samba VHD Share path your appliance provides once the restore is mounted.
2. Launch Disk Management on your Hyper-V-enabled Windows machine.
3. Click Action → Attach VHD.
4. At the Attach Virtual Hard Disk prompt, select Browse.
5. In the Location field, enter the CIFS/Samba VHD Share you obtained in Step 1. Then, click Open.
6. When the share opens, select the hard disk image, and click Open.
NOTE: For Linux systems, C.vhd will be sda1.vhd.
There are two reasons to add a boot and a C volume:
For devices where UEFI is unsupported, adding a boot and C:\ volume is necessary to make GPT-formatted OS volumes readable.
Adding both volumes fixes virtualization failures for some MBR / BIOS agents. While a production Windows machine can still boot from its System Reserved partition even if its NTFS bootstrap code has corruption, virtualizations do not have this ability unless both the boot and C volumes are present.
7. At the Attach Virtual Hard Disk prompt, check the Read-only box, and click OK to mount the image.
8. The VHD will mount as a volume in Windows.
Part 2: Importing the Volume into Hyper-V Manager
1. Launch Hyper-V Manager from Start → Administrative Tools → Hyper-V Manager.
2. From Hyper-V Manager, click Action → New Hard Disk.
3. If you see a Before You Begin dialog, click Next.
4. Select the destination Disk Format, and then click Next.
5. Choose the destination Disk Type, and then click Next.
6. Specify a name for the virtual disk and the location to save it to, and then click Next.
7. Select the disk or disks to copy by clicking Copy the contents of the specified physical disk and selecting the PHYSICALDRIVE value that is the same disk number as the VHD that is mounted. Then, click Next. Repeat this step for all disks involved in the restoration.
8. Review the summary to ensure that the virtual hard disk is configured correctly. When you are ready to proceed with disk creation, click Finish.
9. A progress bar showing the status of the transfer will appear.
10. After the transfer has completed, detach the VHD from Disk Management, as shown in Figure 14.
Part 3: Finalizing the Restore
1. From Hyper-V Manager, click Action → New → Virtual Machine. When the New Virtual Machine Wizard launches, click Next.
2. If the Before You Begin page pops up, click Next.
3. Provide a name and (optionally) a storage location for the virtual machine, and then click Next.
4. Specify the Generation of the VM. If you are using Hyper-V Manager 2008 or earlier, skip this step. Your Hyper-V Manager environment does not support Generation 2 virtual machines.
- Generation 1 provides the same virtual hardware to the virtual machine as previous versions of Hyper-V. Any virtual machine over 2 TB must use a Generation 2 template.
- Generation 1 VMs:
- Can use VHD and VHDx disk formats
- Only support the MBR boot type
- Generation 1 VMs:
- Generation 2 provides support for features such as Secure Boot, SCSI boot, and PXE boot using a standard network adapter. Guest operating systems must be running at least Windows Server 2012 or 64-bit versions of Windows 8.
- Generation 2 VMs:
- Can only use the VHDx disk format
- Only support UEFI; BIOS is unsupported
- Generation 2 VMs:
5. Provide the amount of RAM to allocate the virtual machine. Then, click Next.
6. Select the NIC to use in the virtual machine. The default value is Not Connected (Hyper-V Manager 2008 or earlier) or None (Hyper-V Manager 2012).
7. On the Connect Virtual Hard Disk page, select Use an existing virtual hard disk. Provide the path to the datastore where you copied the VHD(x), and then click Next.
NOTE: Be sure to attach boot.vhd(x) first.
8. On the Summary page, confirm all configuration settings are correct and click Finish.
9. In the Virtual Machines pane, right-click the VM, and then click Settings.
10. Click the storage controller to which you attached boot.vhd(x). Then, click Hard Drive → Add.
11. Select Virtual hard disk if it is not already selected. Browse to the location of your C.vhd(x) (or sda1.vhd, on Linux systems), select it, and click Apply. Repeat this step for each additional disk that you need to attach.
12. When you finish configuring the virtual machine's settings, click OK, right-click the VM, and click Start.
- If the VM boots, the restore is complete.
- If the VM fails to boot:
- Collect and research any errors thrown, if applicable
- Ensure that the VM uses the right Generation and disk format for its boot type. Remember: MBR = Generation 1, GPT = Generation 2.
- Contact Datto Technical Support if you continue to experience bootability issues.