Physical to Virtual – the right way

During this major Hyper-V virtualization project at work right now, I found myself asking a lot, “What’s the best way to virtualize my physical machines?!” This wasn’t something that I’d thought about too much until now, because I’d wanted to migrate all the services over to Server 2012 R2 during the process, thus refreshing the environment at the same time. As with all things, my good intentions paved the road to hell in the form of user issues, executive requests and team sickness! So now is the time to get with the cooking and move these sombitches to their new eternal virtual home.

I looked around the internet for a while, trying to find the best, fool proof method of P2V and I’ve found that 90% of it is bullshit when you’re not dealing with LAB servers. I mean of course, in a LAB no halfwit has ever gone in and deleted registry lines or performed some other stability inspiring act of domestic terrorism.

I did however, find this process pretty useful. Things you’ll need to get this cracking;

  • Disk2VHD – at the time of typing, the current version was v2.01
  • SDelete – at the time of typing the current version was v1.61


Alright, let’s get dirty. We’ll need to clean up the source server first, mainly to make sure that what gets P2V’d is actually what we want, not a whole mess of junk and crap that we’ve forgotten to delete, or hidden all too well. Start by looking through C:\ mainly any temp folders or install folders that we leave there whilst doing other badassery.

To use SDelete – I like to download and extract this bad bitch right into C:\Windows\System32 and run it from there, not 100% sure why, it just seems right. The command to run the SDelete like a boss is sdelete /c /z C: once this is done, run a defrag by running defrag c: /h /u /a and run another SDelete when that’s done to make sure it’s done properly. I will take this time to let you know that prepare for the source server to halt a little during this process because SDelete accesses every block on the disk, resulting in some impressive disk I/O.

Getting on with it

Okay – so now our volume is in the best place it can be, probably. So we’ll now run Disk2VHD to create the VHD and import it into the Hyper-V Manager in a new skin we’ll create. Launch the Disk2VHD application from where ever you downloaded it to and let it query the present volumes. Now, this seems to be something that is on the net a lot, but not really referenced in any guide or walk through – so bam; Make sure that when you’re selecting the volumes, you select the first one as well, the ‘system reserved’ volume. Without it, you’ll just run into MBR issues or no operating system crud. Make sure your C:\ and System volumes are selected, name them and off you go you saucy IT Devil you!


Depending on how much grunt your server has, this process’ time to complete can vary.

Once the VHD has been created, move it over to the storage location that it will live in forever; in my case, a CSV on our Hyper-V hosts. Open up the Hyper-V Manager and create a new Virtual Machine remembering to ensure it’s a Generation 1 and the hardware (CPU and RAM) are either equal to or greater than what it once had as a physical machine. Shouldn’t have to say it, but also make sure that the network settings are set to either a captive network or not connected – if not, you’ll get IP conflicts and your DC could in fact lose its mind, give up on humanity, join the Skynet program and bring about the demise of the human race – that’ll be on you… just saying.

Once you’ve created the .xml Virtual Machine, it’s time to cross your fingers, toes and anything else long enough to cross. Start the bad girl CTRL+S. If we’ve done the above properly, then this should simply just boot into the OS.

If you get the boot screen, woo! You’re 98% done; you’ll need to jump into the new VM and uninstall some drivers that were necessary when this machine was a real boy.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s