PROBLEM


The VM has been successfully restored, however it fails to start with the following error:


<VM>: Account does not have permission to open the attachment '<VHD path>'. Error: 'General access denied error (0x80070005)'




CAUSE


This issue occurs if the permissions on the virtual hard disk (.vhdx) file are incorrect, example below:

 

The above screenshots show that the one with the missing VM SID doesn't have the appropriate rights and hence must be granted the full control permission to their relative VM to operate.


Every Hyper-V virtual machine has a unique Virtual Machine SID. If the Virtual Machine SID is missing from the security permissions on the .vhdx file, the virtual machine will be unable to start.

Notice, a different VM with a working configuration compared to the problematic one.


SOLUTION


  1. Get the Virtual Machine ID, by using the following Powershell cmdlet:

    Get-VM '<vm-name>' | Select-Object VMID

  2. Use the following icalcs command to give the VM ID (from the previous step) access to the affected VHDX:

    icalcs <.vhdx-file-path> /grant xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:F

  3. Repeat the steps above for all .VHDX files for this Virtual Machine.

  4. Now that the Virtual Machine SID is added to the security permission with read/write to the mentioned .VHDX file, and the Security tab should reflect this as per screenshot below.



Further Reading


Microsoft article: Hyper-V virtual machine may not start, and you receive a “‘General access denied error’ (0x80070005)” error message