Hyper-V cloning vhd

I recently ran into a “windows” problem when repurposing Hyper-V disks. I created a “golden image” of a Windows 2008 R2 x64 Server. There are no Roles or Features installed. It’s been Syspreped and waiting to be used when the time comes. of course, there is the inumerable patch “catch up” drill when it comes on line but it’s probably better than starting from scratch with an ISO.

Generally speaking, I get to a point where i need to take a different approach when evaluating a product and would like to use what I have as a basis for future work. In these instances, using a Hyper-V snapshot won’t work for me. I’d rather clone the virtual machine.

Here’s a method that works for me. I’ll take it a step further to clone the VM to a new Active Directory domain. Here’s how to do it:

  • Keep each virtual machine in a separate folder ising the name of the virtual machine, for example V:\VM\OPUSAPP1 and the vm is in V:\VM\OPUSAPP1\OPUSAPP1.vhd.
  • Create a new folder, example V:VM\OPUSAPP2. Copy OPUSAPP1.vhd to V:\VM\OPUSAPP2\ and then rename the file to OPUSAPP2.vhd.
  • Shutdown the old virtual machine so that it is no longer live on your network.
  • Boot the new virtual machine and login as an administrator.
  • Change the System Properties to remove the server from the domain. Remember not to leave it connected to the network.
  • Reboot
  • Log in as an administrator. Now, Use System Properties – Advanced to manage Profiles.
  • Delete all domain profiles.
  • Delete all local user accounts.
  • Delete all of the associated profiles with the deleted user accounts.
  • Check the file system under C:\Users to insure that they have been deleted.
  • Empty the Recycle Bin.
  • Run C:\WINDOWS\SYSTEM32\SYSPREP\SYSPREP.exe. Select the Out of box experience from the drop down, the “Generalize” box and reboot when done.
  • Upon startup, Windows will begin to reconfigure itself. Log on to the server. You will need to provide a new Administrator password. 
  • Examine functionality to see that there are no legacy artifacts laying about.
  • Use System Properties to give the server that name that you want it to have.
  • Reboot.
  • Log on to the server.
  • Join the server to the domain.
  • Reboot.
  • Log on to the server. Use Server Manager – Configuration to insure Domain Admins has been added to the local Administrators group. Perform other validation tests as you see fit.
  • Re-activate the server using Windows Activation. Sorry, Sysprep invalidates the existing activation.

That’s it.

 This posting is provided “as is” with no warranties, guaranties or any rights whatsoever. All content is based on the author’s experiences and opinions and is not intended to influence the actions of the reader.

 

This entry was posted in General Information and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *