2

I’m a programmer and I’m trying to build up my personal Lab. I have a machine with Hyper-V Standalone Server 2012 R2 installed. I need to create VMs which will be used for testing applications, creating small virtual networks for learning Networking Basics and other learning purpose. None of these VMs are gonna exist for long, as I will be deleting them as their purpose is served and then I’m gonna create some new ones.

So, definitely I need some Cloning-type feature that is available on VMWare. I’m aware of the Export-Import feature available on Hyper-V. What I'm really confused with is this Sysprep tool, as I found articles saying this tool actually prepare the VHD to be used with new VMs, and it assigns new SID, MAC, GUID etc so that new cloned VM doesn’t conflict with existing ones.

I’d like to know –

  1. What is the difference between using Export-Import and using Sysprep? If I use the Export-Import feature, do I still need to Sysprep the guest? What Sysprep really does?
  2. For my scenario do I need to use Sysprep?
  3. What is the best procedure (steps) to create a Template VM for my scenario?
atiyar
  • 133
  • 2
  • 8
  • Read http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx and http://www.robertborges.us/2013/10/windows/windows-server-2012/importing-exporting-hyper-v-virtual-machines-in-windows-server-2012-r2/ – Ryan Ries May 30 '15 at 19:53
  • 2
    Also, I just get an OS updated and configured the way I like it, then I Sysprep /generalize it, and use that disk image for every new VM going forward. No need to sysprep each and every time. – Ryan Ries May 30 '15 at 20:10
  • 1
    `What is the difference between using Export-Import and using Sysprep?` - They are completely unrelated things. As for whether or not you should use Sysprep for your lab virtual machines, follow Ryan's advice. – joeqwerty May 30 '15 at 22:24
  • Another option, which I prefer for cases like this, is a bootable pxe/iso to scripted OS install. If your image is fairly lightweight, a scripted install can sometimes be quicker. – jscott May 30 '15 at 22:57

1 Answers1

1

Imagine you weren't using virtual machines. Imagine in your lab you just had a pile of physical machines on shelves. Now imagine that you don't like installing Windows, so you decide to do it on just one of those physical machines. You then power off that machine, and pull out the disk. When you want to bring up one of the other machines, you take your disk that has a Windows image on it and copy it, byte for byte, over the contents of the disk in the machine you're trying to bring up.

This strategy would have some shortcomings. For one thing, every machine in your lab would have the same name, the same administrative tokens, etc. Sysprep is a tool that you can run on Windows to get it to forget all the stuff that's created during Windows installation, so the next time you boot Windows it has to recreate the missing IDs, tokens, etc. In the odd example above, you'd run it after installing Windows and any other software you want to have on all your machines, but before you power off the machine and remove its disk.

What most people do with VMs is like the example above. "Exporting" the VM is like powering off the machine and copying the disk, more or less. And if you don't Sysprep the VM before doing that, you'll have conflicts when you derive new VMs from the exported image.

Jake Oshins
  • 5,146
  • 18
  • 15
  • I agree with this. In my personal lab, I have a “permanent” virtual machine configured as a deployment server with Microsoft Deployment Toolkit. When I create a new blank virtual machine, I deploy Windows from that server, complete with updates and whatever software I need for testing, and I am ready to go. One alternative though could be if you have a small number of machines. You could install and configure each separately, then create a snapshot of the vanilla environment. That way you wouldn’t be cloning as much as just restoring back to the snapshot when you needed a new machine. – WinOutreach2 Jun 03 '15 at 18:49