Convert a Physical Server to Virtual using Hyper-V
If you need to convert an aging physical windows server to a virtual machine running on a Hyper-V host Microsoft offer a couple of tools for the Job.
The first application is Microsoft Virtual Machine Converter 3.0 but unfortunately Microsoft have said they are pulling the application and it will be no longer available towards the end of 2019. They are instead leaving the conversion problem to 3rd party vendors. Luckily there is an older application offered via sysinternals called Disk2vhd which I have had much success with.
This how-to is a step by step guide for using Disk2vhd to convert a physical server to a virtual machine running on a Hyper-V host.
1 . Download Disk2vhd to the physical server you wish to convert.
2 . Extract the contents to a folder on the root of C and run disk2vhd.exe as an administrator (On the physical server you are converting).
Agree to the License Agreement.
enter the location where you wish the save the vhdx hard drive file. This must be on an external drive or alternatively save it directly onto the Hyper-V host as I have done below. This will create the virtual machine hard drive file and nothing else so dont worry it wont try to create a VM on your hypervisor. This is only going to create the vhdx file on the location specified.
Click ‘Create’ to start the process.
The software will create a shadow copy snapshot and copy this to the vhdx file.
Once the process completes you should have a vhdx file in the location you specified.
3. Now you can login to your Hyper-V host and create a new virtual machine using the vhdx file.
Click ‘New’ then ‘Virtual Machine’.
Give your new VM a name and press ‘Next’.
Select ‘Generation 1’ and press ‘Next’.
Set the required amount of memory and press ‘Next’.
Select the switch you wish to connection the VM to. At this point you may wish to switch off the physical server or set the connection to ‘Not Connected’ during your testing phase. In this example I have switched off the physical server so I will be connecting the VM to the network.
Now select ‘Use an existing virtual hard disk’ and browse to the vhdx file we created earlier from the physical server and press ‘Next’.
Confirm all of the details and press ‘Finish’.
4. Now start up the server and if all goes well it should start installing new drivers for video and network devices. You may have to reboot the server a couple of times before everything is installing and running.
The final task is to configure the static IP on the network adapter if required.