Hyper-V регистрация существующей ВМ

The first step to make this machine known to Hyper-V is to create a Symbolic link to the <GUID>.xml configuration files, in the following folder:

“%systemdrive%\programdata\Microsoft\Windows\Hyper-V\Virtual Machines”

We use the mklink command built into cmd.exe

C:\>mklink “%systemdrive%\programdata\Microsoft\Windows\Hyper-V\Virtual Machines\2F855D88-F990-47BA-95D6-0029BCD8C059.xml” “V:\manualrecover\Virtual Machines\2F855D88-F990-47BA-95D6-0029BCD8C059.xml

The VM Name should now already appear in Hyper-V Manager. When using Windows Server 2008 R2, you might need to restart the vmms service to make the VMs visible at this point.

We need to add the Service SID to this Symbolic link so that Hyper-V is allowed to access it

C:\>icacls “%systemdrive%\programdata\Microsoft\Windows\Hyper-V\Virtual Machines\2F855D88-F990-47BA-95D6-0029BCD8C059.xml” /grant “NT VIRTUAL MACHINE\2F855D88-F990-47BA-95D6-0029BCD8C059“:(F) /L

Note the /L parameter to indicate we work on a symbolic link


We also need to give the Service SID access to all files of our VM

C:\>icacls v:\manualrecover\ /T /grant “NT VIRTUAL MACHINE\2F855D88-F990-47BA-95D6-0029BCD8C059“:(F)

Note for simplicity we give Full Control, whereas the default is more granular