Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD

    How to Create VHD of Windows 10 Installation and Use in Hyper-V
    Published by
    2014-10-05
    Designer Media Ltd

    Published by


    Kari's Avatar
    Finnish but not finished


    Location: A Finnish ex-pat in Germany
    Posts: 9,571

    Show Printable Version 


    How to Create VHD of Windows 10 Installation and Use in Hyper-V

    Note   Note
    The tutorial has been updated today (13-JUN-2016) and also covers how to make a Hyper-V vm from a UEFI based, GPT partitioned host system with Disk2VHD.

    Part Three in tutorial is new, written today.

    Please post all your questions about this process in this thread.

    Please notice: some screenshots are from pre-release builds of Windows 10. Disk2VHD runs without any issues on and can create a VHD from any consumer and server version of Windows starting from Windows XP and Windows Server 2003.


    information   Information
    Disk2VHD is a practical free tool by Sysinternals, since 2006 a subsidiary of Microsoft Corporation. Sysinternals is well known of their wide range of free tools to manage, troubleshoot and diagnose Windows systems and applications. As the name already tells Disk2VHD is a tool to create a Virtual Hard Disk (vhd) file of an existing Windows system. This vhd file can then be used to create a virtual machine in Windows Virtual PC (Windows 7) and Hyper-V (Windows 8 and later).

    In this tutorial we will download and install Disk2VHD on an existing Windows 10 Technical Preview computer, use it to create a vhd of the current Windows 10 installation on that computer and use the resulting vhd to create a virtual machine on Windows 10 Hyper-V. The virtual machine will be an exact copy of the original Windows installation apart of some hardware and drivers, Hyper-V replacing some hw with its own virtual devices.

    The virtual machine will be fully functional and contain all software, user profiles and settings which were installed and present on the real physical computer and Windows when the vhd creation process was started.


    Contents:

    Part One: Run Disk2VHD
    Part Two: Setup Hyper-V
    Part Three: Prepare a GPT partitioned VHD to be attached to virtual machine
    Part Four: Attach an MBR partitioned VHD to virtual machine
    Part Five: Run the new Windows vm




    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD Part One Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD
    Run Disk2VHD

    1.1) First, download and install Disk2vhd.zip from Sysinternals site. Extract downloaded Disk2VHD.zip to a folder, run Disk2VHD application

    1.2) Name your vhd as you wish, select Save location (VHD file name), select both Use Vhdx (Hyper-V requires the file to be VHDX) and Use Volume Shadow Copy, select which drives to include in your vhd. Usually if you have done a default install and all your system files and folders are located on C: you only need to select it

    In addition to your Windows partition(s), remember to select the System Reserved partition (BIOS / MBR systems) or the Recovery Partition (UEFI / GPT systems), highlighted in below screenshots!

    BIOS / MBR:
    Name:  2016_06_13_11_09_091.png
Views: 7607
Size:  30.3 KB

    UEFI / GPT:
    Name:  2016_06_13_11_13_062.png
Views: 7604
Size:  41.8 KB

    Click Create to start creating the vhd to your selected location. Do not save VHD to any of the drives included in your VHD!
    Note   Note
    About the Use Volume Shadow Copy selection:

    Disk2VHD allows you to create a vhd of a system which will be currently used and online. Selecting Use Volume Shadow Copy will cause Disk2VHD to create a Shadow Copy of your system as it was at the very moment you clicked Create. Creating the vhd might take quite a long time but as Disk2VHD reads the information it needs from the Shadow Copy, you can continue using your Windows as usual; any changes to the system like installed software or changes to desktop will not be included in vhd because they were done after the Shadow Copy was created.

    When you now click Create, you will notice that Disk2VHD does not start to write the vhd before it has finished creating the Shadow Copy (snapshotting included drives):

    Name:  2014-10-05_16h56_00.png
Views: 18953
Size:  32.2 KB


    1.3) This may take some time. Disk2VHD shows you an estimated time when it thinks the vhd will be ready, in my case this has usually been quite accurate. Creating the vhd now for this tutorial, the resulting just over 50 GB vhd took about 25 minutes to be created:

    Name:  2014-10-05_16h56_55.png
Views: 18755
Size:  20.9 KB

    1.4) Click Close when the vhd is ready




    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD Part Two Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD
    Setup Hyper-V

    2.1) If not already done, enable, setup and run Hyper-V as told in Hyper-V tutorial, Part Two and create an external virtual switch as told in the same tutorial, Part Three

    2.2) At this point do not create any new virtual machines in Hyper-V. Instead return to this tutorial and continue from below




    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD Part Three Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD
    Prepare a GPT partitioned VHD to be attached to virtual machine

    Note   Note
    PLEASE NOTICE:

    This part only applies if your physical computer, the one from which you created a VHD using Disk2VHD is a UEFI system using GPT partitioning.

    If your PC is a BIOS system using MBR partitioning, skip this part and continue from Part Four below.

    If you are not sure which partitioning system your PC is using, right click the Start button and select Disk Management, then right click Disk 0 and select Properties. Now select the Volumes tab to see if your hard disk is GPT partitioned (#1 in screenshot below):
    Click image for larger version. 

Name:	2016_06_13_10_56_191.png 
Views:	107 
Size:	127.3 KB 
ID:	84865

    If yes, this Part Three is for you. If your hard disk is MBR partitioned (#2 in screenshot), skip this part and continue from Part Four.

    This part is long and might look confusing, but in reality the procedure is relatively simple and fast. You will have no issues if you follow the instructions


    3.1) To use the VHD on a Hyper-V virtual machine we need to convert the GPT disk first to MBR. This can't be done with native Windows tools preserving the data, we need a third party program for that.

    These instructions are based on using the free AOMEI Partition Assistant; in my opinion it's the best and easiest to use tool for this operation but you can of course use any partitioning tool allowing GPT to MBR conversion without data loss.

    AOMEI Partition Assistant free download: Download Magic Free Partition Manager Software - AOMEI Partition Assistant Standard

    3.2) Browse to your GPT partitioned VHD, double click it to mount it as virtual disk on your host system:
    Name:  2016_06_13_11_17_023.png
Views: 7594
Size:  58.8 KB

    3.3) File Explorer opens the mounted virtual disk, note the drive letter:
    Click image for larger version. 

Name:	2016_06_13_17_48_171.png 
Views:	80 
Size:	69.4 KB 
ID:	84924

    3.4) Run AOMEI Partition Assistant

    3.5) In AOMEI Partition Assistant select your virtual disk, check the main partition's drive ID letter to be sure you have selected the correct disk (see 3.3 above). One by one select the small EFI and Recovery partitions (two or three small partitions), right click them and select Delete partition:
    Click image for larger version. 

Name:	2016_06_13_11_51_121.png 
Views:	115 
Size:	170.0 KB 
ID:	84872

    Accept partition deletion:
    Name:  2016_06_13_11_54_452.png
Views: 7546
Size:  16.8 KB

    Be sure to repeat this to all of these small EFI system partitions at the beginning of the disk! In this example I had three small system partitions to delete

    3.6.) Right click the disk label, select Convert to MBR disk, accept the conversion:
    Click image for larger version. 

Name:	2016_06_13_12_00_014.png 
Views:	82 
Size:	104.3 KB 
ID:	84875
    Name:  2016_06_13_12_02_577.png
Views: 7538
Size:  15.6 KB

    3.7) Click Apply at top left to apply changes (deletion of EFI partitions, convertion to MBR):
    Name:  2016_06_13_12_01_315.png
Views: 7543
Size:  46.7 KB

    3.8) Click Proceed:
    Name:  2016_06_13_12_02_036.png
Views: 7528
Size:  28.4 KB

    3.9) Now we need to create a system reserved partition for our converted MBR disk using the space left unallocated after deleting the EFI system partitions.

    Right click the unallocated empty space at the beginning of the disk, select Create partition:
    Click image for larger version. 

Name:	2016_06_13_11_56_383.png 
Views:	71 
Size:	81.6 KB 
ID:	84874

    3.10) Accept partition size and file system defaults, select Drive letter: None, click OK:
    Name:  2016_06_13_12_16_431.png
Views: 7511
Size:  30.4 KB

    3.11) Click Apply, click Proceed:
    Name:  2016_06_13_12_01_315.png
Views: 7543
Size:  46.7 KB
    Name:  2016_06_13_12_17_132.png
Views: 7528
Size:  24.9 KB

    3.12) Close AOMEI Partition Assistant. In File Explorer: This PC, right click the VHD and select Eject to unmount it from the host:
    Name:  2016_06_13_12_24_014.png
Views: 7531
Size:  54.5 KB

    3.13) Create a new virtual machine as told in the Hyper-V tutorial, Part Four steps 4.1 to 4.6. When creating a virtual machine using VHD made with Disk2VHD remember to always select Generation 1 in step 4.4, regardless if your host system from which the VHD was created is BIOS / MBR or UEFI / GPT!

    Continue from below (step 3.14) when you have finished the Hyper-V Setup tutorial's step 4.6.

    3.14) Select Use an existing virtual hard disk, browse to and select the vhd you created with Disk2VHD, click Open:
    Click image for larger version. 

Name:	2016_06_13_12_30_485.png 
Views:	109 
Size:	159.5 KB 
ID:	84886

    3.15) Right click the new vm in Hyper-V Manager, select Settings. Attach a valid Windows 10 ISO image as virtual DVD drive:
    Click image for larger version. 

Name:	2016_06_13_13_00_116.png 
Views:	96 
Size:	97.3 KB 
ID:	84894

    3.16) Boot the vm from install media (at this point the hard disk is not bootable). If below prompt is shown select No:
    Name:  2016_06_13_13_03_208.png
Views: 7492
Size:  29.9 KB

    3.17) Select your language and formats, click Next:
    Name:  2016_06_13_13_04_309.png
Views: 7482
Size:  31.5 KB

    3.18) Select Repair your computer:
    Name:  2016_06_13_13_05_0010.png
Views: 7468
Size:  34.6 KB

    3.19) Select Troubleshoot:
    Name:  2016_06_13_17_56_081.png
Views: 7384
Size:  21.6 KB

    3.20) Select Command Prompt:
    Click image for larger version. 

Name:	2016_06_13_17_56_272.png 
Views:	80 
Size:	43.2 KB 
ID:	84928

    3.21) We need a native Windows tool called DISKPART now to make system reserved partition active, the new empty partition without drive letter we created in step 3.9 above.

    Enter the following commands one by one, hit Enter after each one (list numbers refer to numbers in screenshot):
    1. DISKPART
    2. LIST DISK
    3. SEL DISK 0
    4. LIST PART
    5. SEL PART 1
    6. ACTIVE
    7. EXIT

    Click image for larger version. 

Name:	2016_06_13_13_14_2213.png 
Views:	83 
Size:	75.9 KB 
ID:	84902

    3.22) The system reserved partition is now active, now we need to rebuild the boot sectors.

    Enter the following commands one by one, hit Enter after each one (list numbers refer to numbers in screenshot):
    1. BOOTREC / FIXMBR
    2. BOOTREC / FIXBOOT
    3. BOOTREC / REBUILDBCD
    4. System will now ask if you want to add Windows installation found on virtual hard disk to boot list. Press Y and hit Enter to confirm

    Click image for larger version. 

Name:	2016_06_13_13_18_0814.png 
Views:	86 
Size:	41.7 KB 
ID:	84903

    3.23) Reset the vm (Action menu, Reset). Boot it again from install media selecting the Repair option and Troubleshoot (see 3.16 through 3.19 above). This time select Startup Repair:
    Click image for larger version. 

Name:	2016_06_13_17_56_453.png 
Views:	79 
Size:	44.0 KB 
ID:	84929

    3.24) The system will only find one installation to repair, select it:
    Click image for larger version. 

Name:	2016_06_13_17_57_044.png 
Views:	74 
Size:	21.2 KB 
ID:	84930

    3.25) Windows repairs the boot system and restarts, booting Windows normally. Your Disk2VHD vm is ready to be used, being an identical copy of the system it was created from




    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD Part Four Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD
    Attach an MBR partitioned VHD to virtual machine

    Note   Note
    PLEASE NOTICE:

    This part only applies if your physical computer, the one from which you created a VHD using Disk2VHD is a BIOS system using MBR partitioning.

    If your PC is a UEFI system using GPT partitioning, see Part Three above instead.

    If you are not sure which partitioning system your PC is using, right click the Start button and select Disk Management, then right click Disk 0 and select Properties. Now select the Volumes tab to see if your hard disk is MBR partitioned (#2 in screenshot below):
    Click image for larger version. 

Name:	2016_06_13_10_56_191.png 
Views:	107 
Size:	127.3 KB 
ID:	84865

    If yes, this Part Four is for you. If your hard disk is GPT partitioned (#1 in screenshot), see Part Three above instead.


    4.1) Create a new virtual machine as told in the Hyper-V tutorial, Part Four steps 4.1 to 4.6. When creating a virtual machine using VHD made with Disk2VHD remember to always select Generation 1 in step 4.4, regardless if your host system from which the VHD was created is BIOS / MBR or UEFI / GPT!

    Continue from below (step 4.2) when you have done the Hyper-V Setup tutorial's step 4.6.

    4.2) Select Use an existing virtual hard disk, browse to and select the vhd you created with Disk2VHD, click Open:
    Click image for larger version. 

Name:	2014-10-05_17h10_15.png 
Views:	698 
Size:	142.1 KB 
ID:	6074

    4.3) Click Next:
    Click image for larger version. 

Name:	2014-10-05_17h11_50.png 
Views:	536 
Size:	38.7 KB 
ID:	6075

    4.4) Click Finish:
    Click image for larger version. 

Name:	2014-10-05_17h12_31.png 
Views:	519 
Size:	31.9 KB 
ID:	6076

    4.5) Your Disk2VHD vm is ready to be used, being an identical copy of the system it was created from





    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD Part Five Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD
    Run the new Windows vm

    5.1) Select your virtual machine on Hyper-V Manager, click Connect (#1) and wait until the vm windows has opened, then press Start (#2) to boot the vm:
    Click image for larger version. 

Name:	2014-10-05_20h21_46.png 
Views:	3515 
Size:	84.6 KB 
ID:	6100

    5.2) When your Windows 10 virtual machine has booted you will see your familiar lock screen and can sign in with any existing user profile:
    Click image for larger version. 

Name:	2014-10-05_17h15_48.png 
Views:	669 
Size:	1.35 MB 
ID:	6082

    5.3) When signed in you'll notice everything from your physical Windows 10 installation is there in your virtual machine, installed apps working:

    Click image for larger version. 

Name:	2014-10-05_17h37_04.png 
Views:	761 
Size:	1.22 MB 
ID:	6084


    That's it, now you can run your Windows 10 virtualized!

    Kari



  1. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,571
    Windows 10 Pro
       2015-03-25 #1

    Just a heads up:

    The new build 10041 has none whatsoever issues in running Disk2VHD and creating a virtual hard disk of your existing Build 10041 installation. I just converted my laptop's Windows 10 Build 10041 to a VHD, created a new Hyper-V virtual machine using this VHD and everything is running smoothly and perfectly.

    Absolutely everything is there. I had language packs installed on laptop, user accounts created for private and work use plus for different languages to get Windows as I like, with one click language selection, the main profile folder Users relocated with Sysprep to drive E: and so on. All this was carried over to virtual machine:
    Click image for larger version. 

Name:	2015-03-25_14h48_09.png 
Views:	573 
Size:	153.7 KB 
ID:	15356
    All software I had installed on laptop work all settings intact on the virtual machine, even Steam and my games:
    Click image for larger version. 

Name:	2015-03-25_14h59_49.jpg 
Views:	513 
Size:	167.1 KB 
ID:	15357
    Nice!
      My System SpecsSystem Spec


  2. Joined : Dec 2013
    Cheshire, England
    Posts : 1,422
    Windows 10 Pro x64
       2015-03-25 #2

    Nice one Kari !
      My System SpecsSystem Spec


  3. Joined : Jun 2016
    Posts : 6
    Windows 10
       2016-06-09 #3

    When I start my Virtual Machine it remains in black whit "_"blinking. The state is running. I think the problem is when I create VHDX, I select use shadox copies and use VHDX, then y select C: , there i have my boot partition and all my data.
    What can i do?


    Trank you man
      My System SpecsSystem Spec


  4. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,571
    Windows 10 Pro
       2016-06-11 #4

    Nuckete said: View Post
    When I start my Virtual Machine it remains in black whit "_"blinking. The state is running. I think the problem is when I create VHDX, I select use shadox copies and use VHDX, then y select C: , there i have my boot partition and all my data.
    What can i do?


    Trank you man
    I am sorry for a delayed response. There seem to be issues in creating a virtual hard disk file from a GPT partitioned (UEFI) source system, making the Hyper-V virtual machine made from GPT disks using Disk2VHD not bootable, not working.

    I think I have found a solution, easy and quite fast to do, but need to test it more before posting the instructions.

    I will post the instructions later after a few more tests, first tests already showing it works but I need to be sure.

    Kari
    Last edited by Kari; 2016-06-11 at 14:08.
      My System SpecsSystem Spec


  5. Joined : Jun 2016
    Posts : 6
    Windows 10
       2016-06-12 #5

    Thanks friend, I look forward to your response, I have tested for different operating systems like Windows 7, Windows 8.1 and Windows 10
      My System SpecsSystem Spec


  6. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,571
    Windows 10 Pro
       2016-06-13 #6

    Note   Note
    The tutorial has been updated today (13-JUN-2016) and now also covers how to make a Hyper-V vm from a UEFI based, GPT partitioned host system with Disk2VHD.

    Part Three in tutorial is new, written today.

    Please post all your questions about this process in this thread.

    Kari
      My System SpecsSystem Spec


  7. Joined : Jun 2016
    Posts : 6
    Windows 10
       2016-06-14 #7

    Thank you, everything went well , it is possible to connect to a different network the virtual machine? For example connect my computer with ethernet and the virtual machine using Wi-Fi
      My System SpecsSystem Spec


  8. Joined : Oct 2013
    A Finnish ex-pat in Germany
    Posts : 9,571
    Windows 10 Pro
       2016-06-14 #8

    Nuckete said: View Post
    Thank you, everything went well , it is possible to connect to a different network the virtual machine? For example connect my computer with ethernet and the virtual machine using Wi-Fi
    You are welcome.

    Yes, it is possible to use different network adapter for Hyper-V virtual machines. In your case your host is connected through Ethernet, you just need to create another external virtual switch using your wireless adapter as told in the Hyper-V tutorial, browse to Part Three of it: Hyper-V virtualization - Setup and Use in Windows 10 - Windows 10 Forums

    Create a new external virtual switch and make your virtual machine use it in vm Settings > Network adapter.

    Kari
      My System SpecsSystem Spec


  9. Joined : Nov 2016
    Posts : 1
    Windows 10
       2016-11-25 #9

    Hey Kari, I'm wondering if you can help me. I get to step 3.8 and I get an error in AOMEI. Specifically Error 6. Here's a link to the error: Error Code 6

    I think System is locking the file so I can't actually perform the MBR conversion. I'm guessing it gets locked when I double click the file to open it in Explorer/Computer/Disk Management. Do you know how I might do the conversion without the file getting locked?
      My System SpecsSystem Spec


 


Similar Threads
Tutorial Category
Hyper-V virtualization - Setup and Use in Windows 10
How to Setup and Use Hyper-V in Windows 10 for OS Virtualization Windows 10 Pro, Education and Enterprise editions come with a built-in hypervisor client Hyper-V allowing users to create and run other operating systems on a virtual machine....
Tutorials
Hyper-V Virtual Machine - Create Shortcut in Windows
How to Create Shortcut of Hyper-V Virtual Machine in Windows 8 and 10 There's nothing wrong in running the Hyper-V Manager and launch your virtual machines from there. However, creating a shortcut for each vm you have you can start them fast...
Tutorials
Hyper-V Checkpoints - Create and Use in Windows 10
How to Create and Use Hyper-V Checkpoints in Windows 10 Checkpoint is a powerful Hyper-V feature to easily undo all changes on a virtual machine. You can play with virtual machines testing apps, changing settings, editing registry and so on as...
Tutorials
Hyper-V VM - Install CentOS Linux in Windows 10
How to Install CentOS Linux on Hyper-V Virtual Machine in Windows 10 A working and quite nice alternative for dual booting is to install various operating systems on a virtual machine. CentOS is officially supported by Microsoft as a guest OS...
Tutorials
Solved Windows 10 and Hyper-V
I tried to install the preview as a virtual machine and everything went fine until after a reboot following the download and installation of the updates. Both 8.1 & 10 locked up with a strange crackling noise through the speakers every few seconds....
Installation and Setup
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:47.
Find Us
Twitter Facebook Google+



Windows 10 Forums