Windows 10: Import Hyper-V Virtual Machine in Windows 10  

    Import Hyper-V Virtual Machine in Windows 10

    Import Hyper-V Virtual Machine in Windows 10

    How to Import Hyper-V Virtual Machines in Windows 10
    Published by Category: Virtualization
    13 Mar 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 19,827

    Show Printable Version 


    How to Import Hyper-V Virtual Machines

    information   Information
    Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems (aka: guests) can be used and managed just as if they were physical computer systems, however they exist in a virtualized and isolated environment.

    You can use Hyper-V's export and import functionality to quickly duplicate virtual machines. Exported virtual machines can be used for backup or as a way to move a virtual machine between Hyper-V hosts.

    Import allows you to restore virtual machines. You don't need to export a virtual machine to be able to import it. Import will try to recreate the virtual machine from whatever is available. Importing a virtual machine registers the virtual machine with the Hyper-V host. A virtual machine export can be imported back into the host from which it was derived or new host.

    This tutorial will show you how to import a Hyper-V virtual machine (guest) on your Windows 10 PC (host).

    You must be signed in as an administrator to be able to import a Hyper-V virtual machine.

    Note   Note
    Hyper-V is only available in the Windows 10 Pro, Windows 10 Enterprise, and Windows 10 Education editions.


    CONTENTS:
    • Option One: To Import Hyper-V Virtual Machine using Hyper-V Manager
    • Option Two: To Import Hyper-V Virtual Machine using PowerShell



    Video by: Kari in TF Video thread






    Import Hyper-V Virtual Machine in Windows 10 OPTION ONE Import Hyper-V Virtual Machine in Windows 10
    To Import Hyper-V Virtual Machine using Hyper-V Manager

    1. Open Hyper-V Manager.

    2. Select the Hyper-V host (ex: "BRINK-DESKTOP") in the left pane you want to import a virtual machine to, and click/tap on Import Virtual Machine in the right Actions pane. (see screenshot below)

    Click image for larger version. 

Name:	Import_Hyper-V_VM-1.png 
Views:	104 
Size:	60.9 KB 
ID:	90917

    3. Click/tap on Next on the "Before you Begin" screen. (see screenshot below)

    Name:  Import_Hyper-V_VM-2.png
Views: 596
Size:  19.2 KB

    4. Click/tap on Browse, navigate to and select the folder (ex: "Windows 7 Ultimate") that contains the virtual machine (.vmcx file) you want to import, click/tap Select Folder, and click/tap on Next. (see screenshots below)

    Click image for larger version. 

Name:	Import_Hyper-V_VM-3.png 
Views:	103 
Size:	91.9 KB 
ID:	90919

    5. Select the virtual machine (ex: "Windows 7 Ultimate") you want to import, and click/tap on Next. (see screenshots below)

    Name:  Import_Hyper-V_VM-4.png
Views: 594
Size:  17.5 KB

    6. Select (dot) an import type you want to perform, click/tap on Next, and go to step 7 or step 8 below depending on what import type you selected. (see screenshot below)

    Import Type Description
    Register the virtual machine in-place The current location of the Export files is where the virtual machine will be run from. When imported, the virtual machine has the same ID as it did at the time of export. Because of this, If the virtual machine is already registered with Hyper-V it needs to be deleted before the import will work. When the import has completed, the export files become the running state files and cannot be removed.
    Restore the virtual machine You are given an option to store the VM files in a specific location or use the locations default to Hyper-V. This import type creates a copy of the exported file and moves them to the selected location. When imported, the virtual machine has the same ID as it did at the time of export. Because of this, if the virtual machine is already running in Hyper-V it needs to be deleted before the import can be completed. When the import has completed the exported files remain untouched and can be removed and / or imported again.
    Copy the virtual machine This import type is similar to the Restore type in that you select a location for the VM files. The difference is that when imported the virtual machine has a new unique ID. This allows for the Virtual Machine to be imported into the same host multiple time.

    Name:  Import_Hyper-V_VM-5.png
Views: 588
Size:  22.8 KB


     7. If you selected to "Register the virtual machine in-place"

    A) Click/tap on Finish on the "Summary" screen, and go to step 9 below. (see screenshot below)

    Name:  Import_Hyper-V_VM-6.png
Views: 592
Size:  22.9 KB


     8. If you selected to "Restore the virtual machine" or "Copy the virtual machine"

    A) If you like, you can specify new or use existing folders to store the virtual machine files. When finished, click/tap on Next. (see screenshot below)

    Name:  Import_Hyper-V_VM-7a.png
Views: 820
Size:  26.6 KB

    B) Browse to and select the folder where you want to store the imported virtual hard disks (.vhdx file) for this virtual machine, and click/tap on Next. (see screenshot below)

    Name:  Import_Hyper-V_VM-7b.png
Views: 572
Size:  17.2 KB

    C) Click/tap on Finish on the "Summary" screen, and go to step 9 below. (see screenshot below)
    Note   Note
    This may take a while to finish copying the virtual machine files and hard disk to the selected folder location(s).


    Name:  Import_Hyper-V_VM-7c.png
Views: 594
Size:  27.6 KB

    9. The Hyper-V virtual machine (ex: "Windows 7 Ultimate") has now been imported to the selected Hyper-V host (ex: "BRINK-DESKTOP"). (see screenshot below)

    Click image for larger version. 

Name:	Import_Hyper-V_VM-8.png 
Views:	80 
Size:	53.7 KB 
ID:	90926

    10. When finished, you can close Hyper-V Manager if you like.






    Import Hyper-V Virtual Machine in Windows 10 OPTION TWO Import Hyper-V Virtual Machine in Windows 10
    To Import Hyper-V Virtual Machine using PowerShell

    Note   Note
    For more details about the Import-VM command used in this option, see: Import-VM


    1. Open an elevated PowerShell.

    2. Do step 3 (in-place), step 4 (in-place) (restore) or step 5 (copy) below for the import type you want to perform.


     3. To "Register the virtual machine in-place (use the existing unique ID)"

    Note   Note
    The current location of the Export files is where the virtual machine will be run from. When imported, the virtual machine has the same ID as it did at the time of export. Because of this, If the virtual machine is already registered with Hyper-V it needs to be deleted before the import will work. When the import has completed, the export files become the running state files and cannot be removed.


    A) Type the command below into the elevated PowerShell, press Enter, and go to step 6 below. (see screenshot below)

    Import-VM -Path 'Full path of virtual machine .vmcx file'

    Note   Note
    Substitute Full path of virtual machine .vmcx file in the command above with the actual full path of where the virtual machine .vmcx file you want to import is located.

    For example:
    Code:
    Import-VM -Path 'D:\Vitual Machines\Windows 7 Ultimate\Virtual Machines\7BEDECF9-E91F-4115-9E86-BBFEE136D881.vmcx'
    Click image for larger version. 

Name:	vmcx.png 
Views:	71 
Size:	45.6 KB 
ID:	90945

    Click image for larger version. 

Name:	PowerShell_Register_in-place_Hyper-V.png 
Views:	85 
Size:	30.3 KB 
ID:	90927


     4. To "Restore the virtual machine (use the existing unique ID)"

    Note   Note
    You have the option to store the VM files in a specific location or use the locations default to Hyper-V. This import type creates a copy of the exported file and moves them to the selected location. When imported, the virtual machine has the same ID as it did at the time of export. Because of this, if the virtual machine is already running in Hyper-V it needs to be deleted before the import can be completed. When the import has completed the exported files remain untouched and can be removed and / or imported again.


    A) Type the command below you want to use into the elevated PowerShell, press Enter, and go to step 6 below. (see screenshot below)

    (To use default Hyper-V folders to import and copy virtual machine .vmcx and virtual hard disk .vhdx files)
    Import-VM -Path 'Full path of .vmcx file' -Copy

    OR

    (To specify Hyper-V folders to import and copy virtual machine .vmcx and virtual hard disk .vhdx files)
    Code:
    Import-VM -Path 'Full path of .vmcx file' -Copy -VhdDestinationPath 'Full path of folder to copy .vhdx file' -VirtualMachinePath 'Full path of folder to copy .vmcx file'
    Note   Note
    Substitute Full path of .vmcx file in the commands above with the actual full path of where the virtual machine .vmcx file you want to import is located.

    Substitute Full path of folder to copy .vhdx file in the second command above with the actual folder path where you want to copy the virtual hard disk .vhdx file of the virtual machine you want to import.

    Substitute Full path of folder to copy .vhdx file in the second command above with the actual folder path where you want to copy the virtual machine .vmcx file of the virtual machine you want to import.

    For example:
    Code:
    Import-VM -Path 'D:\Vitual Machines\Windows 7 Ultimate\Virtual Machines\7BEDECF9-E91F-4115-9E86-BBFEE136D881.vmcx' -Copy -VhdDestinationPath 'D:\Vitual Machines\Windows 7 Ultimate - Copy' -VirtualMachinePath 'D:\Vitual Machines\Windows 7 Ultimate - Copy'

    Click image for larger version. 

Name:	PowerShell_Restore_Hyper-V.png 
Views:	76 
Size:	19.5 KB 
ID:	90929


     5. To "Copy the virtual machine (create a new unique ID)"

    Note   Note
    This import type is similar to the Restore type in that you select a location for the VM files. The difference is that when imported the virtual machine has a new unique ID. This allows for the Virtual Machine to be imported into the same host multiple time.


    A) Type the command below you want to use into the elevated PowerShell, press Enter, and go to step 6 below. (see screenshot below)

    (To use default Hyper-V folders to import and copy virtual machine .vmcx and virtual hard disk .vhdx files)
    Import-VM -Path 'Full path of .vmcx file' -Copy -GenerateNewId

    OR

    (To specify Hyper-V folders to import and copy virtual machine .vmcx and virtual hard disk .vhdx files)
    Code:
    Import-VM -Path 'Full path of .vmcx file' -Copy -VhdDestinationPath 'Full path of folder to copy .vhdx file' -VirtualMachinePath 'Full path of folder to copy .vmcx file' -GenerateNewId
    Note   Note
    Substitute Full path of .vmcx file in the commands above with the actual full path of where the virtual machine .vmcx file you want to import is located.

    Substitute Full path of folder to copy .vhdx file in the second command above with the actual folder path where you want to copy the virtual hard disk .vhdx file of the virtual machine you want to import.

    Substitute Full path of folder to copy .vhdx file in the second command above with the actual folder path where you want to copy the virtual machine .vmcx file of the virtual machine you want to import.

    For example:
    Code:
    Import-VM -Path 'D:\Vitual Machines\Windows 7 Ultimate\Virtual Machines\7BEDECF9-E91F-4115-9E86-BBFEE136D881.vmcx' -Copy -VhdDestinationPath 'D:\Vitual Machines\Windows 7 Ultimate - Copy' -VirtualMachinePath 'D:\Vitual Machines\Windows 7 Ultimate - Copy' -GenerateNewId

    Click image for larger version. 

Name:	PowerShell_Copy_Hyper-V.png 
Views:	82 
Size:	29.1 KB 
ID:	90928


    6. When finished, you can close PowerShell.
    Note   Note
    This may take a while to finish copying the virtual machine files and hard disk to the selected folder location(s).



    That's it,
    Shawn



  1. Posts : 14,405
    Microsoft Windows 10 Pro 64-bit 14393, Windows 10 Insider Fast Ring, Windows 8.1 Update, Ubuntu
       10 Oct 2016 #1

    @Brink,
    I just had to use this today
    Thanks to you and @Kari, I started exporting my VMs a short while ago(specially now that my Insider and Windows 8.1 VMs are licensed) and never needed to import.

    Today I did something really, really dumb!

    I was deleting my checkpoint sub trees totally on all three of my VMs(to recover what space, and all machines are/were working perfectly(yes, even the insider build)), and on my 3rd(insider build) I accidentally deleted it!
    Name:  Swearing.gif
Views: 1234
Size:  43.2 KBName:  Swearing.gif
Views: 1234
Size:  43.2 KBName:  Swearing.gif
Views: 1234
Size:  43.2 KB

    Well, I'm now reimporting it...
    Name:  image.png
Views: 574
Size:  27.6 KB

    So I posted this to thank you & Kari, and also to show Hyper-V Geeks why it is very important to export!
      My ComputersSystem Spec


  2. Posts : 14,405
    Microsoft Windows 10 Pro 64-bit 14393, Windows 10 Insider Fast Ring, Windows 8.1 Update, Ubuntu
       10 Oct 2016 #2

    Finished!
    Now to upgrade
    Again...!
    Click image for larger version. 

Name:	Image 001.png 
Views:	62 
Size:	38.3 KB 
ID:	105215
      My ComputersSystem Spec


  3. Posts : 19,827
    64-bit Windows 10 Pro build 16179
    Thread Starter
       10 Oct 2016 #3

      My ComputersSystem Spec


  4. Posts : 10
    Win7; Win10; CentOS; Suse;
       4 Days Ago #4

    Folder Structure, Organizing


    @Brink
    Lots of valuable info, kudos both you & Kari.
    This prolly aint the place, but in regards to 'keepin it clean' (file structure). I have all created/dynamic data on a different partition from OS (Win10P64); is there any recommended format w/regards to Hyper-V that could be advantageous? Have a top level for all VM's, /VMname with everything under (.vhdx, .vmcs, .vmcx) & don't know if this would be detrimental down the road...?
    A tad different than a full-blown hyperVisr (ESXi) & now it seems this build on 10 is pretty sweet, thus curious on structure cleanliness.
    ...behavior mods for me - 'Save' 'Shutdown' & 'Turn Off' had to play with as no one said anything (yes I read Ben Armstrong's Virt Blog on turning off a VM here, referenced several times over the years ).

    Wish there was a way to 'Save' while using an RDP session (not using VM connection).
    Sorry if this appears as cross-post . But I'll keep looking around, thx all fer sharing info...!
      My ComputerSystem Spec


  5. Posts : 19,827
    64-bit Windows 10 Pro build 16179
    Thread Starter
       4 Days Ago #5

    Hello @sos1043,

    I prefer to keep my Hyper-V VMs on a separate hard drive that the OS drive as well. This way if I should have to reinstall Windows, all I have to do is import my VMs back afterwards.

    I prefer to keep individual VM in its own separate folder with all of its files.
      My ComputersSystem Spec


  6. Posts : 10
    Win7; Win10; CentOS; Suse;
       4 Days Ago #6

    My thoughts and usage exactly. Thought I'd check.
    Any quick notes on an RDP session opposed to the VM connection application, then 'Save'?
      My ComputerSystem Spec


  7. Posts : 19,827
    64-bit Windows 10 Pro build 16179
    Thread Starter
       4 Days Ago #7

    Not sure about the RDP option, but that would make a good question to post in a new thread to get feedback about.
      My ComputersSystem Spec


  8. Posts : 20
    Windows 10 Pro 64 bit
       1 Day Ago #8

    Thank you Brink very useful tutorial.
      My ComputerSystem Spec


  9. Posts : 19,827
    64-bit Windows 10 Pro build 16179
    Thread Starter
       20 Hours Ago #9

    I'm glad it could help matfx.
      My ComputersSystem Spec


 

Related Threads
How to Create Shortcut of Hyper-V Virtual Machine in Windows 8 and 10 There's nothing wrong in running the Hyper-V Manager and launch your virtual machines from there. However, creating a shortcut for each vm you have you can start them fast...
How to Add or Remove a Physical Hard Disk for Hyper-V Virtual Machine Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems (aka: guests) can be used and managed just as if they were physical...
How to See if Hyper-V Virtual Machine is Generation 1 or Generation 2 Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems (aka: guests) can be used and managed just as if they were physical...
UPDATE: Problem solved. See post #14's "long story" for steps that led to the findings above as the same steps can aid in hunting down this type of issue if neither of the above applies. Hello, I recently did an in place upgrade to Windows...
How to Remove Floppy Disk Drive in Windows Hyper-V Virtual Machine Hyper-V enables running virtualized computer systems on top of a physical host. These virtualized systems (aka: guests) can be used and managed just as if they were physical...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 05:01.
Find Us