'General access denied error' when creating a Hyper-V VM

21 September 2013

Suddenly I got an error when creating a new VM, which I do fairly often:

New-VM -Name LAB2 -Path X:\VMs\Lab2
results in:
User 'pc\******' failed to create external configuration store at 'X:\VMs\Lab2\LAB2': General access denied error.
(0x80070005)
You do not have permission to perform the operation. Contact your administrator if you believe you should have
permission to perform this operation.

I was running the command as an elevated administrator, so why would I get this error. It turned out the permissions on the directory 'Virtual Machines Cache' got changed.

To fix this, I ran the following in an elevated PowerShell:

& icacls.exe "$env:ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines Cache"  /t /Q /grant "NT VIRTUAL MACHINE\Virtual Machines:`(0I`)`(CI`)`(R,WD,AD`)"

I blame:

sfc /scannow
which I ran a few days ago.

Pages in this section

Categories

ASP.Net | Community | Development | IIS | IT Pro | Security | SQL (Server) | Tools | Web | Work on the road | Windows