sodcalculator

10 Tech How-To

Export & Import Hyper-V VM on Windows Server

Guide 10-33756 · Updated · Step by step

This guide walks you through exporting a Hyper-V virtual machine (VM) on Windows Server and then importing it on the same or a different host. Exporting creates a complete, portable copy of the VM (configuration files, virtual hard disks, and checkpoints) that you can back up, migrate, or use as a template. You’ll need administrative rights on both the source and destination servers, and enough disk space to hold the exported files.

What You’ll Need

  • A Windows Server machine with the Hyper-V role installed (source host).
  • A destination Windows Server with Hyper-V (can be the same host for a duplicate VM).
  • Administrator privileges on both servers.
  • Sufficient storage space on the destination for the VM’s virtual hard disks (VHD/VHDX files) and configuration files.
  • Optional: A shared network location or removable drive to transfer the exported files between hosts.

Step-by-Step

  1. Shut down the VM (recommended): For a clean, consistent export, power off the VM. In Hyper-V Manager, right-click the VM and select Shut Down. Wait for the status to change to Off. (If you export a running VM, the export may be incomplete or the VM may be in a saved state.)
  2. Open Hyper-V Manager: Log in to the source server with an account that has administrator privileges. Open Server Manager > Tools > Hyper-V Manager. Ensure the correct host is selected in the left pane.
  3. Start the Export Wizard: In the right pane, right-click the VM you want to export and select Export… from the context menu.
  4. Specify the export location: In the Export Virtual Machine wizard, click Browse and choose a folder where the exported VM files will be placed. This can be a local drive or a network share. The wizard will create a subfolder named after the VM inside this location.
  5. Choose export options: On the Export Options page, you can select Export all checkpoint data (includes all checkpoints) or Export only the latest checkpoint (exports only the current state). For a full backup, choose the first option. Click Next.
  6. Review and finish: Review the summary, then click Finish. The export will begin. You’ll see progress in the Status column. When it says Completed, the export is done.
  7. Locate the exported files: Navigate to the export folder you chose. You’ll find a folder with the VM’s name containing the configuration (.xml or .vmcx), virtual hard disk files (.vhd or .vhdx), and possibly checkpoint files.
  8. Copy the exported folder to the destination: Transfer the entire VM folder to the destination server. You can use a USB drive, a network share, or any file copy method. Ensure the destination has enough free space.
  9. Open Hyper-V Manager on the destination: Log in to the destination server with administrator rights, open Hyper-V Manager, and select the destination host.
  10. Start the Import Wizard: In the right pane, click Import Virtual Machine… (under Actions).
  11. Specify the folder: In the Import Virtual Machine wizard, click Browse and navigate to the folder that contains the exported VM folder. Select the parent folder (the one that contains the VM’s folder), not the VM folder itself. Click Next.
  12. Choose import type: You have three options:
    • Register the virtual machine in-place – Use this if you want the VM to run from the current location (no copying).
    • Restore the virtual machine – This copies the VM to the default Hyper-V location (usually C:\ProgramData\Microsoft\Windows\Hyper-V).
    • Copy the virtual machine – This copies the VM to a location you specify, and you can change the VM’s name and paths.

    For most migrations, choose Restore the virtual machine or Copy the virtual machine. Click Next.

  13. Select the VM to import: The wizard will detect the VM(s) in the folder. Select the one you want and click Next.
  14. Choose destination (if copying): If you chose Copy, specify the folder where the VM files should be placed. You can also change the VM name and the names of the virtual hard disks.
  15. Finish the import: Review the summary and click Finish. The import will process. Once completed, the VM will appear in the Hyper-V Manager list.
  16. Start the VM: Right-click the imported VM and select Start. Verify that it boots correctly and that all services are running.

Common Mistakes

  • Exporting a running VM without saving state: This can produce a corrupted or inconsistent export. Always shut down the VM cleanly.
  • Selecting the wrong folder during import: The import wizard expects the folder that contains the VM folder, not the VM folder itself. Selecting the VM folder directly will fail.
  • Not copying the entire folder: If you miss the virtual hard disk files (VHD/VHDX) or the checkpoint files, the import will fail or the VM won’t boot.
  • Insufficient disk space: The import may fail if the destination drive doesn’t have enough space for the VM’s virtual hard disks.
  • Importing on a host with different hardware: If the VM uses specific hardware (e.g., a virtual switch named differently), the import may fail or the VM may not start. You may need to reconfigure the network adapter.

Tips

  • Use a dedicated export folder: Create a folder like D:\VMExports to keep exports organized.
  • Compress the export for transfer: If you’re moving the VM over a slow network, zip the exported folder to reduce transfer time.
  • Verify the export before deleting the original: After importing, start the VM and run a few checks before removing the source VM.
  • Use PowerShell for automation: You can use Export-VM and Import-VM cmdlets to script the process for multiple VMs.
  • Keep the VM’s generation in mind: A Generation 2 VM can only be imported on a host that supports it (Windows Server 2012 R2 and later).

Troubleshooting

  • Import fails with “Cannot find the virtual machine” – You likely selected the wrong folder. Make sure you select the parent folder that contains the VM’s folder.
  • VM appears but won’t start – Check the Event Viewer for Hyper-V errors. Common causes: missing virtual switch (recreate it), incompatible hardware (e.g., the VM is Generation 2 but the host doesn’t support it), or corrupted VHDX (try to repair it with Repair-VHD).
  • Network not working after import – The virtual switch may not exist on the new host. Attach the VM’s network adapter to an existing virtual switch.
  • Export takes a long time – This is normal for large VMs. Ensure you have enough disk space and a fast connection.
  • Import says “Access denied” – You need to run Hyper-V Manager as administrator. Right-click the Hyper-V Manager icon and select Run as administrator.

Frequently Asked Questions

Can I export a VM while it is running?

Yes, but it’s not recommended. Hyper-V allows exporting a running VM, but it will create a snapshot (checkpoint) of the VM state. The export may be inconsistent if the VM is under heavy load. Always shut down the VM for a clean export.

What files are included in an export?

The export includes the VM configuration file (.vmcx or .xml), virtual hard disks (.vhd/.vhdx), checkpoint files (.avhd/.avhdx), and any other associated files like the VM’s BIOS or UEFI settings.

Can I import a VM from a different version of Windows Server?

Generally, yes, as long as the VM’s configuration version is compatible with the destination host. If the VM is from an older version, Hyper-V will upgrade the configuration version automatically during import. If it’s from a newer version, the import will fail – you’ll need to use the same or newer host.

How do I duplicate a VM without affecting the original?

Export the VM, then import it with the Copy the virtual machine option and give it a new name. This creates a separate copy that can run independently.

What’s the difference between “Restore” and “Copy” during import?

Restore places the VM in the default Hyper-V folder and uses the original name. Copy lets you choose a new location and rename the VM and its files. Both copy the files, but Restore is quicker if you don’t need to customize.

Can I export a VM to a network share?

Yes, you can specify a UNC path in the export wizard. Ensure the Hyper-V service account has write permissions to that share.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →