Skip to content

Fixing Hyper-V 0x80070005 Error : Complete Guide to the “General Access Denied” Problem

Hyper-V 0x80070005 Error

Introduction

If your Hyper-V virtual machine fails to start and shows the dreaded Hyper-V 0x80070005 error, you’re not alone.
This “General Access Denied Error” is one of the most common issues system administrators face when running virtual machines on Windows Server.

While the error might look simple — just an access denial — it actually signals a permissions mismatch between the virtual machine and its VHD or AVHD disk files.

In this guide, we’ll break down what causes the Hyper-V 0x80070005 error, how to identify the root cause, and the exact steps to fix it permanently.


1. Symptoms of the Hyper-V 0x80070005 Error

When attempting to start a VM in Hyper-V Manager, you might see one of these messages:

An error occurred while attempting to start the selected virtual machine.
'VMName' failed to start.

Microsoft Emulated IDE Controller: General access denied error (0x80070005)

Or more specifically:

'VMName': Failed to open attachment 'E:\VMs\VMName\Disk0.vhd'. 
Error: 'General access denied error' (0x80070005).

This is the classic Hyper-V 0x80070005 error.
It typically occurs after:

  • Moving or restoring a virtual machine to a new disk
  • Backing up or cloning VMs
  • Modifying folder permissions or ownership
  • Missing NT Virtual Machine SID on the VHD file

2. Root Cause of the Hyper-V 0x80070005 Error

Every Hyper-V virtual machine has a unique Security Identifier (SID), also known as Virtual Machine ID.
This SID gives the VM access to its own files, such as .vhd, .vhdx, .avhd, and .xml configuration files.

If the VM’s SID is missing from the file’s Access Control List (ACL),
the system cannot grant permission — leading to the Hyper-V 0x80070005 access denied error.

For example:

(Virtual Machine ID 5FC5C385-BD98-451F-B3F3-1E50E06EE663)

When this ID isn’t authorized to access the VHD file,
Hyper-V simply refuses to start the machine.


3. Quick Fix Overview

To resolve the Hyper-V 0x80070005 error,
you need to manually add the VM’s SID back to the affected file’s permissions using the icacls command.

In short:

  1. Identify the Virtual Machine ID
  2. Run Command Prompt as Administrator
  3. Use icacls to grant full permission
  4. Restart the virtual machine

4. Step-by-Step Solution

Step 1: Find the Virtual Machine ID

Look at the full error message or use PowerShell to get the ID:

Get-VM | Select Name, Id

Example ID:
5FC5C385-BD98-451F-B3F3-1E50E06EE663


Step 2: Open Command Prompt with Administrator Rights

  • Press Windows + S, type cmd,
  • Right-click Command Prompt → Run as Administrator

Step 3: Grant Permission with icacls

Use the following command (replace with your VM’s actual path and ID):

icacls "E:\VMs\VMName\Disk0.vhd" /grant "NT VIRTUAL MACHINE\5FC5C385-BD98-451F-B3F3-1E50E06EE663":(F)

(F) means Full Control.
You can also use (M) for Modify or (R,W) for Read/Write if needed.

If successful, you’ll see:

E:\VMs\VMName\Disk0.vhd: processed successfully

Step 4: Restart the Virtual Machine

Return to Hyper-V Manager and try starting the VM again.
The Hyper-V 0x80070005 error should now be gone.


5. Fixing Configuration File (.XML) Permission Errors

In some cases, the same access denial applies to the VM’s configuration file rather than its disk.

You can fix it similarly:

icacls "E:\VMs\VMName\7E77503A-A26B-4BB5-9846-396F49A30141.xml" /grant "NT VIRTUAL MACHINE\7E77503A-A26B-4BB5-9846-396F49A30141":(F)

Then reinitialize the VM in Hyper-V.


6. Real-World Scenarios That Trigger Hyper-V 0x80070005 Error

🧩 Scenario 1: After Backup or Restore

Backup tools like Veeam or Acronis might not preserve NTFS ACL data.
After restoring, the VM’s SID link is broken, resulting in the Hyper-V 0x80070005 error.

Fix: Reapply the VM SID permission using the icacls command above.


🧩 Scenario 2: Manually Moving VHD Files

If you manually move .vhd or .vhdx files to another disk,
the access permissions aren’t copied by default.

Fix: Grant “NT VIRTUAL MACHINE{VMID}” access to the new file location.


🧩 Scenario 3: Running VMs on External Drives or NAS

NAS drives often use SMB shares that don’t fully support NTFS ACLs.
Hyper-V can’t read or enforce permissions properly, causing the Hyper-V 0x80070005 error.

Fix: Store VM disks on a local NTFS volume whenever possible.


7. Preventing Future Hyper-V 0x80070005 Errors

✅ Backup Your ACLs Regularly

icacls "E:\VMs" /save "C:\backup\vm_acl_backup.txt" /t

Restore if needed:

icacls "E:\VMs" /restore "C:\backup\vm_acl_backup.txt"

✅ Use Hyper-V Export/Import Instead of Manual Copy

When moving VMs, always use Export and Import in Hyper-V Manager.
This preserves both configuration and security identifiers automatically.


✅ Check Both NTFS and Share Permissions

If your storage is network-based, ensure both NTFS and SMB share permissions are aligned.


✅ Automate Permission Fixes with PowerShell

$vmid = "5FC5C385-BD98-451F-B3F3-1E50E06EE663"
$path = "E:\VMs\VMName\Disk0.vhd"
icacls $path /grant "NT VIRTUAL MACHINE\$vmid":(F)

8. FAQ: Hyper-V 0x80070005 Error Troubleshooting

❓ Q1: I ran icacls, but the Hyper-V 0x80070005 error persists.

  • Check that Command Prompt was run as Administrator.
  • Make sure no backup software is locking the VHD file.
  • Enclose the file path in quotes if it contains spaces.

❓ Q2: How can I find the Virtual Machine ID if it’s not in the error?

Use PowerShell:

Get-VM | Select Name, Id

❓ Q3: Can I fix multiple VMs at once?

Yes. Run this PowerShell snippet to grant all VMs proper permissions:

Get-VM | ForEach-Object {
    $id = $_.Id
    $path = "E:\VMs\$($_.Name)\Disk0.vhd"
    icacls $path /grant "NT VIRTUAL MACHINE\$id":(F)
}

❓ Q4: Why does this happen after moving to a new Hyper-V host?

Because each Hyper-V host has unique SIDs.
When migrating, the original VM SID no longer exists —
you must reassign permissions using the new host’s VM SID.


9. Summary and Final Thoughts

The Hyper-V 0x80070005 error is one of the most frustrating issues in virtualization,
but it’s also one of the easiest to fix once you understand what’s happening.

The root cause is always the same:
a missing or broken NT VIRTUAL MACHINE SID on your disk or configuration files.

By restoring that permission with a single icacls command,
you can resolve the Hyper-V 0x80070005 access denied problem in minutes.


✅ One-Line Fix Command

icacls "<VHD file path>" /grant "NT VIRTUAL MACHINE\<Virtual Machine ID>":(F)

This single command restores access and gets your virtual machine running again.

Related Posts:

🔗 References

Leave a Reply

Your email address will not be published. Required fields are marked *