Hi,
Do you receive the error 0x80070005? If yes, you need the Virtual Machine ID. Please follow the steps belows.
To resolve this issue, add the Virtual Machine SID to the virtual hard disk (.vhd) file or to the snapshot file (.avhd).
To add the Virtual Machine SID to a .vhd or .avhd file, follow these steps:
- Note the Virtual Machine ID that is listed in the error 0x80070005 (General access denied error). For example, consider the following error message:
'VMName': IDE/ATAPI Account does not have sufficient privilege to open attachment 'E:\VMs\VMName\Disk0.vhd. Error: 'General access denied error' (0x80070005). (Virtual Machine ID 5FC5C385-BD98-451F-B3F3-1E50E06EE663)
In this example, the Virtual Machine ID is 5FC5C385-BD98-451F-B3F3-1E50E06EE663.
- Open an elevated command prompt.
- To give the Virtual Machine ID (SID) access to the .vhd or .avhd file, type the following command, and then press Enter:
ConsoleCopy
For example, to use the Virtual Machine ID that you noted in step 1, type the following command, and then press Enter: ConsoleCopyicacls <Path of .vhd or .avhd file> /grant "NT VIRTUAL MACHINE\ <Virtual Machine ID from step 1> ":(F)
icacls "E:\VMs\VMName\Disk0.vhd" /grant "NT VIRTUAL MACHINE\5FC5C385-BD98-451F-B3F3-1E50E06EE663":(F)
- Start the virtual machine.
Hyper-V virtual machine doesn't start with error 0x80070005 - Windows Server | Microsoft Learn
Best Regards,
Ian Xue