Q: How can I easily bulk import virtual machines into Windows Server 2012 Hyper-V?

A. Windows Server 2012 Hyper-V can import virtual machines (VMs) that weren't previously exported, reading in just the raw configuration XML file and performing any fix-up that's needed, automatically.

Ideally, make sure disks are in the original location and virtual networks have the same name when importing, to avoid any prompts for updated locations and network names. To import all VMs in a folder, perform the following from Windows PowerShell:

import-module hyper-v
    Get-ChildItem .\*.xml | import-vm | start-vm

That's it. The command will find all XML files in the folder (add -recurse to search subfolders, Get-ChildItem -Recurse .\*.xml), import the VM, then start it.

See FAQs on Windows, virtualization, systems management, and all things Microsoft, at John Savill's FAQs.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.