How to Attach an Existing Virtual Hard Disk (VHD/X) in Hyper-V
Last Updated: Apr 09, 2018 12:34PM PDT
How to Attach an Existing Virtual Hard Disk (VHD/X) in Hyper-V
NovaBACKUP 19.1 introduced P2V functionality to Image a Physical Machine directly to Microsoft Virtual Hard Disk (VHD) format for use as a Hyper-V Virtual Machine (VM). This guide covers how to take that produced Virtual Hard Disk (VHD) file and utilize it as a Virtual Machine in Hyper-V. NOTE: Currently, NovaBACKUP 19.1 only supports P2V to VHD format and not P2V to VHDX format, the later will be coming in a future release of NovaBACKUP. Please note that the VHD format only supports up to 2TB hard drive size and traditional BIOS (otherwise known as "Legacy") boot mode, meaning non-UEFI boot mode, on the physical machine that is being imaged to VHD. If the physical machine that you want to perform a P2V on contains UEFI boot mode and/or a 2TB or larger hard drive, then this function will not work at this time. Most servers provide the option of using the traditional BIOS boot mode or UEFIboot mode, so you would need to confirm that before attempting NovaBACKUP 19.1's Image to Virtual Hard Disk (VHD) function.
1. Log on to your Windows Hyper-V Hypervisor (this would be a Windows Server 2012, 2012 R2, 2016, and Windows 8.x OS, that has the Hyper-V role installed). Launch the "Hyper-V Manager" application. Once in Hyper-V Manager click on "Action" in the toolbar, then click "New", and then on the click "Virtual Machine...", as the screenshot example shows. Proceed to the next step.
2. The 'Before You Begin' screen may nor not appear, in our example this screen does appear since we had never checked the box at the bottom that contains the option "Do not show this page again". If you do not see this screen it's fine and normal, then just skip to the next step to proceed. Click the "Next" button.
3. On the 'Specify Name and Location' screen you will assign a name to this new virtual machine that you are creating, the name would basically be what you would like to call that Physical Machine, so it could be the exact Windows Computer Name that was utilized by the Physical Machine or you can really do whatever you want here for the naming scheme as it is not as limiting as the Windows Computer Name restricts you to using (like the Microsoft DOS restrictions). Click the "Next" button.
4. You will now see the 'Specify Generation' screen which requires you to choose the generation of the virtual machine. Be very careful when choosing the Generation, you will very much have to understand the differences between the two available choices, Generation 1 and Generation 2.
NOTE: Choose your VM generation carefully. Starting with Windows 2012 R2 this Hyper-V has a new option: Generation 2 virtual machine. This is a second generation firmware for virtual machines with a revised set of virtual hardware and new opportunities for users, such as a boot from an SCSI device. There will be more to come on this topic in future releases. Among noticeable limitations of Generation 2 virtual machines, is that there is no support for a guest OS older than Windows 8.x, not to mention Unix-like. Practically speaking, choose this only for Windows 8/8.1 or Windows Server 2012/2012 R2 and only for 64-bit builds.
This explains why you should choose Virtual Machine Generation accordingly for your case and stick to Generation 1, unless you’re 100% sure you need to use Generation 2.
For a further explanation on Generation choices read more about that topic in the next paragraphs.
As stated prior, you have to know that there are two Virtual Machine "Generation" types in Hyper-V currently, in Windows Server 2012 R2 and above Operating Systems. There are Generation 1 and Generation 2 types. On screen are the description of both Generation 1 and Generation 2 and why you may have to use one over the other. First of all you are using the function of NovaBACKUP 19.1 to Image a Physical Machine to Microsoft Virtual Drive (VHD). This function of NovaBACKUP 19.1 currently allows you to perform a Physical to Virtual Machine (P2V) operation, and that will image your Physical Machine to a Virtual Hard Disk (VHD). You have to know that there are limitations to VHD which affect how you will be able to utilize that P2V VHD file when creating a Virtual Machine from it. In general Physical Machines can utilize two types of boot to hard drive methods, the old standard is "BIOS" (otherwise known as "Legacy") and the newer standard is "UEFI". If your Physical Machine was using "BIOS" (Legacy) boot method, then you will always be able to utilize the Generation 1 for the Hyper-V Virtual Machine type.
NOTE: In a future release of NovaBACKUP we will support VHDX but currently NovaBACKUP 19.1 only supports VHD; this means that currently NovaBACKUP 19.1 can only perform a P2V of a physical machine, that contains up to a 2TB hard drive and uses non-UEFI firmware, to VHD format. For Physical Machines that utilize non-UEFI-firmware (UEFI type of BIOS) that you image to VHD or VHDX you can use the Generation 1 choice. For Physical Machines that utilize UEFI-firmware (UEFI type of BIOS) then you will for sure have to use the Generation 2 choice. For Physical Machines that contained 2TB or larger hard disk, and that hard disk is now part of the Virtual Hard Disk in the VHDX image, you will for sure have to utilize Generation 2 choice, no matter if the Physical Machine was using UEFI-firmware (UEFI BIOS) or not.
Make sure that select the correct Generation choice before continuing otherwise your VM will not be able to boot up as it will not be able to locate the hard disk that is part of the Virtual Hard Disk. This is an example of selecting the "Generation 1" choice, for further assistance on knowing which Generation to choose from see the next step.
Additionally, this is an example of selecting the "Generation 2" choice. You would 100% need to utilize Generation 2 if your Physical Machine was using UEFI-firmware (UEFI BIOS) for the boot mode. You would 100% need to utilize Generation 2 if your Physical Machine that you imaged to VHD contained a 2TB or larger hard drive. Additionally, you would 100% need to utilize Generation 2 if both of those mentioned items exist in your case on the Physical Machine that was Imaged to VHD. If your Physical Machine was using "BIOS" (Legacy) boot mode AND if your Physical Machine that you imaged to VHD contained a 2TB or larger hard drive, then you will have to first utilize Hyper-V Manager's built in Convert Image tool (which is only available in Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, and Windows 8.x) to convert your .VHD to a .VHDX. Additionally, If your Physical Machine was using UEFI-firmware (UEFI BIOS) for the boot mode AND if your Physical Machine that you imaged to VHD contained a 2TB or larger hard drive, then you will have to first utilize Hyper-V Manager's built in Convert Image tool to convert your .VHD to a .VHDX. The Conversion from .VHD to .VHDX format is something that is simple to do inside Hyper-V Manager for Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, and Windows 8.x, and we have a guide on how to do that here.
Make sure that select the correct Generation choice before continuing otherwise your VM will not be able to boot up as it will not be able to locate the hard disk that is part of the Virtual Hard Disk.
Click the "Next" button after making your Hyper-V Generation choice for this new virtual machine.
5. On the 'Assign Memory' screen you will be able to customize how much system memory to allocate to the new virtual machine. In our example we are using 1024MB (1GB) for the Startup memory value but we have in addition to that enabled the checkbox to "Use Dynamic Memory for this virtual machine", which is not a default enabled option but it is advisable to enable as this way Hyper-V's memory management system can allocate it the proper amount of memory as to what it thinks the VM should receive, based on usage and other performance factors. The Startup memory setting choices here are really up to you but it should be related to how much memory the Physical Machine may have required to operate properly based on the installed Operating System and how many applications and/or processes are used at one time. You will have to optimize it based on the installed system memory that is installed in the Windows Hyper-V Hypervisor machine itself and balance that with how many Virtual Machines you are utilizing. Click the "Next" button.
6. The 'Configure Networking' screen is where you will be able to assign a network adapter to the virtual machine, if needed. Normally it is necessary for the virtual machine to be able to contain a network adapter but just know by default that a network adapter is not selected for you by default in the Connection: drop down menu so you will have to choice that network adapter to assign to the VM. In our example we have selected the network adapter that is the Gigabit Network Connection on our Hyper-V Hypervisor server for the new virtual machine to utilize. Click the "Next" button.
7. The 'Connect Virtual Hard Disk' screen is where you will be assigning your VHD (or VHDX file if you used the Hyper-V Manager's VHD to VHDX Convert function as described previously) by selecting the option "Use an existing virtual hard disk" and then browse to the folder where you copied your VHD to, after using NovaBACKUP 19.1's Image backup to Microsoft Virtual Drive (VHD) function, and then copying that VHD file to your Hyper-V Hypervisor server hard drive. That is the Virtual Hard Disk file that you will be browsing for and assigning on this screen. NOTE: If you used the Hyper-V Manager's Convert function to convert your VHD to VHDX file, and that .VHDX file is now stored on the Hyper-V Hypervisor server's hard drive, then that .VHDX format file is the Virtual Hard Disk file that you will be assigning here. Special Note: The Hyper-V Generation 1 virtual machine type will support Connecting a Virtual Hard Disk that is either VHD or VHDX format, however the Hyper-V Generation 2 virtual machine type WILL ONLY SUPPORT Connecting a Virtual Hard Disk that is VHDX format.
The "Use an existing virtual hard disk" choice by default will have a file path selection path of "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\". That path setting can certainly be changed but that is the default storage path for Virtual Hard Disk files (VHD or VHDX files). You will be required now to utilize the "Browse..." button inside the "Use an existing virtual hard disk" selection area here to browse and locate the actual .VHD or .VHDX file that you are intending to utilize for this new VM. Click the "Next" button to proceed.
8. After clicking on the "Browse..." button, you will be presented with a Windows Explorer screen to navigate to your saved VHD or VHDX file. NOTE: That Virtual Hard Disk file should be on a local storage device normally, keep that in mind. Select the file and then click the "Open" button to assign that Virtual Hard Disk file to the new virtual machine.
9. While still on the 'Connect Virtual Hard Disk' screen you will see the assigned Virtual Hard Disk file that you browsed to and selected in the step above. When ready click the "Next" button to proceed.
10. On the 'Completing the New Virtual Machine Wizard' screen that is displayed you will see a Description of the details of your new virtual machine that you are creating and when ready you can click the "Finish" button, otherwise you can go back in your choices to change something. Now click the "Finish" button.
11. If Hyper-V is successful in creating the new VM then the new virtual machine will be created with the name that you provided it in the first couple of steps, and the name of that VM will be displayed in Hyper-V Manager's Virtual Machines listing. In our example, the new VM shows up as "Windows Server 2016 x64" since that is what we provided in the name field. The new virtual name is in the powered off status. We can see next how to boot the virtual machine for the first time.
12. While still in Hyper-V Manager in the Virtual Machines listing area highlight the new virtual machine that was created and then right-click on it and then click "Connect..." and a screen will appear that is your virtual console to see the screen contents virtually. If you have not powered on the virtual machine then you will receive the message that "The virtual machine "x" is turned off" in the Virtual Machine Connection window, like our example shows:
13. Now let's attempt to boot this new virtual machine! Inside the Virtual Machine Connection window, click on "Action" in the toolbar and then click "Start" to start the VM. Alternatively you can click the icon that looks like a power button which is in the toolbar and is the second icon from the left. The VM should be starting up and the status will change to show that in the Virtual Machines listing.
The VM is now in the boot up process. You will need to know that the first time you start a new virtual machine it will take quite some time for the VM to boot up since the hardware configuration will be different since this is the first time you have booted in its' virtual form and the machine was a physical machine to begin with; now Windows has to figure out the differences. You may only see a black screen for 30 minutes at first and not realize anything is happening, and then eventually an animation may display that shows that Windows is "Getting devices ready" or something of that nature to tell you that it is working on figuring out hardware changes or it may even show the login screen. Our example showing the "Getting devices ready" message with on-screen animation:
Eventually you should see the login screen display for your operating system inside the connection window like in our example:
NOTE: You should find that after stopping the VM and then starting it again that the next time this virtual machine starts up it will be much faster to boot to the login screen. You are done, that's it!
The "If you have issues booting" troubleshooting section:
If you find that you cannot get the new virtual machine to boot up, there are some things to do, mainly you will need to go over the description of Step 4 entirely which describes why you may need to use Generation 2 instead of Generation 1 or vice-versa, depending on details of your Physical Machine. Hyper-V and the VHD format are very picky with boot firmware utilized on the original Physical Machine that you are now trying to make into a Virtual Machine.
If within 30 seconds after starting your virtual machine it shows a screen similar to the one in the screenshot example below, and detailed in our guide here, you will need to repair the boot configuration in this virtual machine, by reading the articles containing the subject "Repair unable to boot VM after a successful P2V with NovaBACKUP" which we have on this subject here in order to continue and have the virtual machine be able to boot.
That's it, stay tuned for more, thank you.
Jon Ferraez / NovaStor