How to move VM without exporting

Hyper-V operates using a list of symbolic links in a specific directory: “C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines”

Each link point to a VM configuration weather storage locally or on a cluster

This is how to move the VM without exporting,

  • Identify the GUID of the specific VM 
    Look in the directory location for the VM you wish to manipulate and note the name of the .XML file in the Virtual Machines subdirectory
    (I.e. D344B942-56AC-4H3B-97C6-9AA74828CD91.XML)
  • Delete the reference to this VM in Hyper-V Manager
    Go to C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines, then delete the defernce for the VM with the name “D344B942-56AC-4H3B-97C6-9AA74828CD91”
  • Create new Link mklink <GUID>.XML <VMConfigPath.XML>
    This restores the reference to your VM in Hyper-V Manager.
   1: mklink D344B942-56AC-4H3B-97C6-9AA74828CD91.xml “C:\VMs\Mylab\Virtual Machines\D344B942-56AC-4H3B-97C6-9AA74828CD91.xml” 

  • Fix the Permissions
   1: icacls "C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\<GUID>.xml" /grant "NT VIRTUAL MACHINE\<GUID>" :( F) /L

   1: icacls "C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines\<GUID>.xml" /grant "NT VIRTUAL MACHINE\<GUID>" :( F)

Comments are closed.