Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix Event ID 3040

Event ID 3040 and 3080: Hyper-V cannot open the VHDX and the VM stays off

10 min read Updated October 5, 2026 Windows Server: RDS, Hyper-V & Clustering

Fix it now

Hyper-V could not open the virtual hard disk, and the file is usually exactly where it should be. Either the per-machine identity that opens it has lost its rights on the file, or something else already holds the file open. Both look identical from the console and have different fixes.

Elevated PowerShell on the Hyper-V host

Test-Path 'D:\VMs\Server1\disk.vhdx'
(Get-VM 'Server1').Id
Get-DiskImage -ImagePath 'D:\VMs\Server1\disk.vhdx'
Get-VM | Get-VMHardDiskDrive | Select-Object VMName, Path
  1. Read the full path out of the event and confirm the file is there and the volume is online. The first command answers that.
  2. If the disk is mounted on the host, the third command returns it as attached. Release it with Dismount-DiskImage -ImagePath 'D:\VMs\Server1\disk.vhdx'.
  3. If the fourth command shows a second machine referencing the same file, that is your lock. A virtual hard disk is opened exclusively.
  4. If nothing holds it, grant the per-machine identity rights: icacls 'D:\VMs\Server1\disk.vhdx' /grant "NT VIRTUAL MACHINE\<the GUID from the second command>:(F)". Or open the machine’s settings, remove the disk from its controller, apply, and add the same file back, which makes Hyper-V write the permissions itself.

Removing and re-adding the disk in the machine’s settings does the same job as the icacls line without typing a GUID, and is the safer option if you are not certain of the syntax.

If the machine powers on, stop here. If it does not, or the same machines break again after every backup, the next section explains which identity actually opens the file and what keeps taking it away.

Why it happens

Each running virtual machine gets its own worker process and its own security identity, shown in access control lists as NT VIRTUAL MACHINE followed by the machine’s identifier. That identity, not your administrator account and not the management service, is what opens the virtual hard disk. Hyper-V adds the entry whenever it creates a disk or attaches one through its own tools, and the entry is specific to that one machine.

Anything that moves the file outside Hyper-V loses the entry. Copying a disk to a new folder, restoring it from backup, moving it with Explorer or a file copy tool, or building a new virtual machine around an existing disk all produce a file with correct-looking permissions and no per-machine entry. Folder inheritance does not put it back, because the entry was never inherited: it was written explicitly for one machine.

The second half of these failures has nothing to do with permissions. A virtual hard disk is opened exclusively, so a disk that is mounted on the host, attached to a second machine, or held open by a backup agent cannot be opened again. From the console the two cases look identical, which is why the checks above ask about both before changing anything. Microsoft does not publish meanings for the Hyper-V storage event numbers, so work from the path in the entry rather than from the number.

The per-machine identity has no rights on the file

You have this one if The file exists, an administrator can open the folder, and the machine still will not start.

  1. Get the identifier with (Get-VM 'Server1').Id.
  2. Grant full control to NT VIRTUAL MACHINE followed by that identifier, on the disk and on any differencing disks beside it.
  3. Apply the same to the folder holding the machine’s configuration if the machine will not start at all rather than failing on one disk.
  4. Start the machine and confirm the storage failures stop.

Do not shortcut this by granting Everyone full control. The per-machine identity exists so one virtual machine cannot read another’s disks, and broad rights on a virtualisation host removes that separation to save one command.

Something else has the file open

You have this one if Permissions are correct and the start still fails, often after a backup window or after someone inspected the disk.

  1. Check whether the disk is mounted on the host with Get-DiskImage -ImagePath '<path>' and release it with Dismount-DiskImage if it is.
  2. Confirm no second virtual machine references the same file: Get-VM | Get-VMHardDiskDrive | Select-Object VMName, Path.
  3. If the storage is a file share, list open handles on the file server with Get-SmbOpenFile.
  4. Wait for the backup job to finish, or stop it, then retry.

Antivirus is holding or blocking the virtual disk

You have this one if Failures cluster around scan schedules, or start immediately after new endpoint protection reaches the host.

  1. Configure exclusions on the host for the folders holding virtual machine configuration files and virtual hard disks.
  2. Exclude the virtual machine management and worker processes as your product’s documentation describes.
  3. Retry the start, then re-enable anything you disabled for the test.

Excluding paths is the supported approach. Turning protection off on a virtualisation host is a test, not a fix, and it should not survive the test.

The storage is a file share and the wrong accounts have rights

You have this one if Machines on an SMB share fail while identical machines on local storage start normally.

  1. Grant the host computer accounts full control on both the share permissions and the NTFS permissions of the folder. The machines run as the host, so the host’s computer account is the principal that matters.
  2. Retry the start from the host console first. If it works there and not from your workstation, you have a delegation problem rather than a permissions one.
  3. For the remote management case, configure constrained delegation so the host can reach the file server on your behalf.

Full reference

Telling the two shapes apart

What changed just before Where the fault sits
The disk was copied, moved or restored The per-machine entry is missing from the file’s permissions
The machine was recreated around an existing disk The same, with a new identifier that has never had rights
Nothing changed, but a backup ran overnight The file is still held open by a backup or scanning process
The disk was inspected or mounted on the host It is still attached to the host and must be dismounted
The machine sits on an SMB file share Rights granted to the wrong principals on the share or the folder
The volume is BitLocker protected The volume was never unlocked after the last restart

The permission command, spelled out

Elevated PowerShell on the host. The parentheses build one argument, so the identifier is not mistaken for a drive qualifier

$id = (Get-VM 'Server1').Id
icacls 'D:\VMs\Server1\disk.vhdx' /grant ("NT VIRTUAL MACHINE\" + $id + ":(F)")

icacls takes /grant <principal>:<permission>, and F is full access. The principal is the literal string NT VIRTUAL MACHINE, a backslash, and the machine’s identifier. Apply it to every disk in the chain, not only the one named in the entry: a differencing disk with rights whose parent has none fails at the same point and looks like the first fix did not work.

Releasing a disk the host is holding

Elevated PowerShell on the host

Get-DiskImage -ImagePath 'D:\VMs\Server1\disk.vhdx'
Dismount-DiskImage -ImagePath 'D:\VMs\Server1\disk.vhdx'

Get-DiskImage works on VHD and VHDX as well as ISO, and reports whether the image is currently attached. This is the check people skip, because mounting a disk to look inside it is a five-second operation that is easy to forget, and it holds the file exclusively until it is dismounted or the host reboots.

Restoring a machine by file copy

  1. Restore or copy the files, then confirm the paths match what the configuration expects.
  2. Re-apply the per-machine rights, or remove and re-add each disk in the machine’s settings so Hyper-V writes them.
  3. Check the whole chain, base disk and every differencing disk, not just the newest file.
  4. Start the machine and watch for storage failures before assuming the restore worked.
  5. Do this as a documented part of your restore procedure. Most backup products restore file data and standard permissions and not the per-machine entries, so this step is normal rather than exceptional.

Virtual machines on a file share

Two separate rights questions get confused here and the console gives you no help distinguishing them. The host computer accounts need full control on the share and on the folder, because the worker processes run on the host and it is the host that reaches the file server. Separately, if you manage the host from your workstation rather than at its console, your credentials have to be delegated from your machine to the host and on to the file server, which needs constrained delegation configured. Test from the host console first. If it works there, the share permissions are fine and you have a delegation problem.

None of this is a licensing question and none of it costs anything. It is file permissions and file locking on storage you already own, and no Windows Server edition affects whether a virtual disk can be opened.

Every code this article covers

Code What it points at Source
Event ID 3040 Not published by Microsoft. It accompanies a failure to open the virtual hard disk named in the entry; the path is the useful part not published by the vendor
Event ID 3080 Not published by Microsoft. It appears with the same class of failure, whether the refusal was an access denial or an existing lock not published by the vendor
Event ID 12030 Not published by Microsoft. It appears from the management service side where storage could not be attached not published by the vendor
Event ID 12010 Not published by Microsoft. The accompanying management service entry naming the operation that failed not published by the vendor

Confirm the fix worked

  1. The virtual machine starts and boots into its guest operating system.
  2. The disk’s permissions include an entry for NT VIRTUAL MACHINE followed by that machine’s identifier.
  3. Every disk in the chain has that entry, not only the one named in the event.
  4. Get-DiskImage reports the disk as not attached to the host.
  5. No further storage failures are logged after a backup window has run.

Questions people ask about this

Does this indicate a licensing problem?

No, and it costs nothing to fix. This is file permission or file locking on storage you already own. No Windows Server edition or licence state affects whether a virtual disk can be opened.

Can I just grant Everyone full control to make it work?

It will work and it is a poor idea. The per-machine identity exists so one virtual machine cannot read another’s disks. Granting broad rights on a virtualisation host removes that separation to save typing one command.

Why did this appear after restoring from backup?

Because most backup products restore file data and standard permissions, not the per-machine entries Hyper-V added. Re-applying the rights, or removing and re-adding the disk, is a normal part of restoring a machine by file copy.

The disk is on a share and nothing helps. What next?

Start the machine while signed in at the host console. If it works there and not from your workstation, the problem is delegation for the remote management path rather than the share permissions.

How do I know whether something has the file open?

Get-DiskImage tells you whether the host has it mounted, Get-VM piped through Get-VMHardDiskDrive tells you whether a second machine references it, and Get-SmbOpenFile on the file server lists open handles if the storage is a share.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix Event ID 12042 and 13042: WSUS self-update and authentication services fail License Error Event ID 20499: RDS logons hang for minutes loading the user configuration Free Fix HTTP 500.19 and 500.21: IIS refuses to read your web.config at all Free Fix Event ID 157: disks are surprise removed and cluster storage goes offline
โ† Back to Knowledge Base