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

Discus and support Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD in Windows 10 Tutorials to solve the problem; How to: Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD How to Create VHD of Windows 10 Installation and Use in Hyper-V [img] Note The... Discussion in 'Windows 10 Tutorials' started by Kari, Mar 24, 2015.

  1. Kari Win User

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


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

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

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]
    Note The tutorial has been updated today (20-MAR-2017). 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.

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]
    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 VHDfile 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 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 hardware 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:

    [table][tr][td]Part One:[/td] [td]Install & Run Disk2VHD[/td] [/tr] [tr][td]Part Two:[/td] [td]Setup Hyper-V VM (MBR & GPT)[/td] [/tr] [tr][td]Part Three:[/td] [td]Prepare a GPT partitioned VHD[/td] [/tr] [tr][td]Part Four:[/td] [td]Run the new Windows vm[/td] [/tr] [/table]

    Use links above to jump to any part of the tutorial. Click screenshots to pop out, click again to expand.



    Part One [/i] Run Disk2VHD
    1.1)
    First, download and install Disk2VHD, a tool by Mark Russinovich at Windows Sysinternals:

    https://technet.microsoft.com/en-us/sysinternals/ee656415.aspx" target="_new">[i][/i]

    1.2) Extract downloaded Disk2VHD.zip to a folder, run Disk2VHD application

    1.3) 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:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    UEFI / GPT:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    Click Create to start creating the VHD to your selected location. Do not save VHD to any of the drives included in VHD being created!
    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]
    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):

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    1.4) 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 15 minutes to be created:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    1.5) Click Close when the VHD is ready



    Part Two [/i] 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) Create a new virtual machine in Hyper-V selecting Generation 1 (highlighted green in screenshot) in New Virtual Machine Wizard if your Disk2VHD is from a BIOS / MBR physical computer, and Generation 2 (highlighted yellow) if it is from a UEFI / GPT computer:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    If you are not sure which partitioning system the PC you made VHD from is using, right click the Start button on that computer 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) or MBR partitioned (#2):

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    2.3) In New Virtual Machine Wizard select Use an existing virtual hard disk, browse to and select the VHD you created with Disk2VHD, click Open:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    2.4) Click Next:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    2.5) Click Finish:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    2.6) If you made a Generation 1 virtual machine, you are ready to go. Jump to Part Four below. If your new virtual machine is Generation 2 with a UEFI / GPT VHD, continue from Part Three




    Part Three [/i] Prepare a GPT partitioned VHD
    3.1)
    If you start the virtual machine now, you will see it can't boot:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    Shut down the VM.

    3.2) Open VM settings. Change boot order making it boot from DVD (#1), add a Windows ISO image as DVD (#2), click OK to save settings:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    You can use any Windows 10 version and edition ISO, it does not have to be for the version and edition installed on your new Disk2VHD virtual hard disk

    3.3) Disable Secure Boot:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    3.4) Start VM, boot it from DVD (ISO). Press SHIFT + 10 when you see Windows Setup prompt to open Command Prompt:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    3.5) Enter command diskpart to start Windows Disk Partitioning Utility (#1 in screenshot below), enter command list vol (#2) to get list of all partitions in your Disk2VHD virtual hard disk. You will see that Disk2VHD had deleted the EFI partition (#3, by default 99 MB) making it RAW. Without it Windows on GPT partitioned disk cannot boot:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    3.6) We need to format EFI partition. As we can see with list vol command (vol = volume), the EFI partition is volume 3. Select it with command sel vol 3 (#1 in next screenshot below), and format it with following command (#2):
    Code:
    Enter the FORMAT command exactly as told! Be sure that you have selected the correct volume, the RAW one. No confirmation is asked, if you have selected wrong volume you might accidentally nuke Windows!

    When done you can check again with list vol (#3) to see that the EFI partition is now correctly formatted in FAT32 file system (#4):

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    3.7) Enter command exit to leave diskpart

    3.8) One thing missing, we have to create boot records. Before leaving diskpart I checked with list vol command to see which letter my 40 GB Windows partition on this VHD has (in diskpart drive letters are not always obvious ones). In my case now the Windows partition has letter C:

    I add boot records with command bcdboot C:\Windows:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    3.9) Open VM settings (File > Settings), change boot order to boot from EFI file:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    3.10) That's it. Close Command Prompt, click Close button in Windows Setup, click Yes to restart.

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]




    Part Four [/i] Run the new Windows vm
    4
    .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:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    4.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:

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


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

    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


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

    Kari


    Related Tutorials

    :)
     

  2. Hyper-V VHD issue (RAID 0 setup)

    Hello all,

    I just tried using Hyper-V after upgrading my desktop hardware to a setup with 2 drives (identical drives) in a RAID0 setup.

    Before the upgrade (and reïnstallation of Windows 10) i was able to create as many VM's with VHD as i want, however sinds the upgrade of my hardware this is no longer possible.

    When i now try to create a new VM in Hyper-V Manager in the final step i get an error saying that the storage location on my Virtual Harddrive is not supporting sharing of Virtual Harddrives.

    Does this mean that Hyper-V see's a RAID0 setup as a VHD and therefor is not capable of connecting VHD's to my VM's? Saying Hyper-V is not capable of working with RAID0 ?

    Any help would be greatly appreciated.

    Many thanks in advance for your replies.

    Kind Regards,

    Bart
     
    Apocalypss, Mar 24, 2015
    #2
  3. SarahKong Win User
    Hyper-V Virtual Machine not recognised

    Ok that's why you can't add it... Virtual Machines are stored in a .vhd or .vhdx file. The xml file is used for the VMs but you also have to have a valid vhd

    https://www.altaro.com/hyper-v/hyper-vs-relatio...

    Are you trying to import one you used previously or just trying to create a new VM?
     
    SarahKong, Mar 24, 2015
    #3
  4. Nuckete Win User

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

    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
     
    Nuckete, Jun 8, 2016
    #4
  5. Kari Win User
    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.
     
  6. Nuckete Win User
    Thanks friend, I look forward to your response, I have tested for different operating systems like Windows 7, Windows 8.1 and Windows 10
     
    Nuckete, Jun 12, 2016
    #6
  7. Kari Win User
    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]
    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.
     
  8. Nuckete Win User

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

    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
     
    Nuckete, Jun 13, 2016
    #8
  9. Kari Win User
    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.
     
  10. 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?
     
    TheKoolestIP, Nov 24, 2016
    #10
  11. tracit99 Win User
    Kari, have you tried this tutorial lately? I am getting an error at step 3.2 when I try to mount the created vhdx file.


    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    I am using Windows 14393.953 on a UEFI/GPT configuration. It shows to be offline in Disk Management.


    Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD [​IMG]


    Thought maybe vhdx file didn't create properly so I tried creating twice more with the same results.
     
    tracit99, Mar 18, 2017
    #11
  12. Kari Win User
    I'll check and update tutorial today (Sunday). I've been up all night testing various unattended install scenarios and am now simply too tired (it's 6:30 AM my local time), I have to sleep a few hours first.

    I promise a solution later today *Smile
     
  13. cereberus Win User

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

    Hi Kari,

    I hope you do not take offence at this but I am sure many users here do not want you to "burn out" by overdoing things late at night, especially given you are currently having some health issues. We can wait for answers *Smile.

    cheers

    M.
     
    cereberus, Mar 18, 2017
    #13
  14. tracit99 Win User
    I am in no rush. Take your time. I am learning about VMs and happened across your tut. Thank you for your response and the time and the work you put in for us all here at WTF.
     
    tracit99, Mar 18, 2017
    #14
  15. Kari Win User
    @tracit99, the tutorial is apart of Part One totally re-written. There is no need to mount your DISK2VHD virtual hard disks, I guess your VHD is OK and ready to be used in Hyper-V. GPT to MBR conversion is not required.

    The issue you had is because disk ID conflict. Each disk has a unique disk ID; when you used Disk2VHD you basically cloned your existing HDD, with its ID. Windows cannot cope with two disks with same ID, therefore the VHD was offline. If you right click the disk header (left most column in Disk Manager) and select Online, system creates a new unique disk ID for that VHD and it will be mounted.
     
Thema:

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

Loading...
  1. Hyper-V - Create and Use VHD of Windows 10 with Disk2VHD - Similar Threads - Hyper Create VHD

  2. Problems uploading VHD to hyper V server

    in Windows 10 Customization
    Problems uploading VHD to hyper V server: Hello,I have installed a fresh bare metal Hyper V server . It has not joined a domainI have configured its management according to this https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/I am able to access it from a Windows...
  3. Problems uploading VHD to hyper V server

    in Windows 10 Gaming
    Problems uploading VHD to hyper V server: Hello,I have installed a fresh bare metal Hyper V server . It has not joined a domainI have configured its management according to this https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/I am able to access it from a Windows...
  4. Problems uploading VHD to hyper V server

    in Windows 10 Software and Apps
    Problems uploading VHD to hyper V server: Hello,I have installed a fresh bare metal Hyper V server . It has not joined a domainI have configured its management according to this https://timothygruber.com/hyper-v-2/remotely-managing-hyper-v-server-in-a-workgroup-or-non-domain/I am able to access it from a Windows...
  5. How to convert VHD to VHDX using Hyper-V Manager

    in Windows 10 News
    How to convert VHD to VHDX using Hyper-V Manager: [ATTACH]If you have a VHD file and you want to convert it to VHDX format, you can use Hyper-V Manager to get it done. This […] This post How to convert VHD to VHDX using Hyper-V Manager is from TheWindowsClub.com. read more...
  6. How to convert Hyper-V VHDX file to VHD using PowerShell

    in Windows 10 News
    How to convert Hyper-V VHDX file to VHD using PowerShell: [ATTACH] [ATTACH]If you have a VHDX file and you want to make it compatible with some other virtual machine that supports VHD format, then this post shows, how you can convert the Hyper-V VHDX file to VHD using Windows PowerShell so [...] This post How to convert Hyper-V...
  7. Compact a Hyper-V VHD

    in Windows 10 Virtualization
    Compact a Hyper-V VHD: I have Hyper-V VM with the Windows 10 Pro Technical Preview Build 9926 as the guest, and Windows 8.1 Pro as the host OS. I've been running it for 3 months now, with at least 2 build updates. But I can't compact the VHD. The used drive space on the VM guest is 16.8 GB, while...
  8. Create and run Hyper-V containers using Docker on Windows 10 desktop

    in Windows 10 Virtualization
    Create and run Hyper-V containers using Docker on Windows 10 desktop: Create and run Hyper-V containers using Docker on Windows 10 desktop As you probably know the Windows Insider program allows to get preview Windows 10 builds to test the new features that are coming in the next major update of Windows. Since a few weeks, a new feature...
  9. Hyper-V - Native Boot VHD

    in Windows 10 Tutorials
    Hyper-V - Native Boot VHD: How to: Hyper-V - Native Boot VHD [img] Information First a quote from Microsoft Developer Network's (MSDN) support article: Native Boot allows you to create a virtual hard disk (VHD), install Windows to it, and then boot it up, either on your PC side-by-side with...
  10. Create and Use Hyper-V Checkpoints in Windows 10

    in Windows 10 Tutorials
    Create and Use Hyper-V Checkpoints in Windows 10: How to: Create and Use Hyper-V Checkpoints in Windows 10 How to Create and Use Hyper-V Checkpoints in Windows 10 [img] Note Checkpoint is a powerful Hyper-V feature to easily undo all changes on a virtual machine. You can play with virtual machines testing apps,...
Tags:

Users found this page by searching for:

  1. disk2vhd windows 10

    ,
  2. file created on XP by disk2vhd program will not open on windows 10 with hyper-v

    ,
  3. windows 10 hyper-v download

    ,
  4. how to use vhd in windows 10 hyper-v,
  5. disk2vhd para windows 10,
  6. windows hyper-v vhd high disk,
  7. creating vhd in windows 10,
  8. create a hyper-v from disk2vhd files,
  9. Windows 10 hyper-v aextend existing hard drive ,
  10. hyperv guest with dsk2vhd created disk,
  11. win 10 hyper=v vhd files,
  12. windows 8.1 vhd does not boot after disk2vhd