I was called in to help a company recently with a small Hyper-V environment. They created a 2TB VHD file (they had good reasons for not using .vhdx files, but the steps in this article will work for both versions).
They realized that they had unnecessarily created the drive as a 2TB Fixed Size disk rather than a Dynamically Expanding disk. While there are no real performance differences between the two in Server 2012 R2, when it comes to portability, the dynamically expanding drives have a huge advantage. When they realized that they were planning for a SAN upgrade, the IT Administrator decided to take the preemptive step of converting the disk.
It’s actually pretty easy… In the Hyper-V menu you click on Edit Disk…, and when the Edit Virtual Hard Disk Wizard comes up you go through the steps of selecting the appropriate file, and on the Choose Action screen select the radio button Convert. On the next screen you specify the destination file, which eventually is where the problem is going to lie. But for now you enter the filename, click Next, then click Finish to begin the process.
For those of you who are PowerShell fans, you can accomplish the same task by running the following cmdlet:
Convert-VHD D:\Hyper-V\HardDisk.vhdx -DestinationPath D:\Hyper-V\NewHardDisk.vhdx -VHDType Dynamic
Great. Now you go into the settings of your virtual machine, point it to the new file, and boot it up.
Microsoft Emulated IDE Controller (Instance ID
{83F8638B-8DCA-4152-9EDA-2CA8B33039B4}): Failed to Power on with Error ‘General access denied error’
IDE/ATAPI Account does not have sufficient privilege to open attachment
‘D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’
Account does not have sufficient privilege to open attachment
‘D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’
Un-oh. That doesn’t look good. I click on the option to see the details, and it expands to the following:
‘VMName’ failed to start. (Virtual machine ID
1DC704C1-6075-4F6C-B364-AFE4947304F3)
‘VMName’ Microsoft Emulated IDE Controller (Instance ID
{83F8638B-8DCA-4152-9EDA-2CA8B33039B4}): Failed to Power on with Error ‘General access denied error’ (0x80070005). (Virtual machine ID
1DC704C1-6075-4F6C-B364-AFE4947304F3)
‘VMName’: IDE/ATAPI Account does not have sufficient privilege to open attachment D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’ (0x80070005). (Virtual Machine ID 1DC704C1-6075-4F6C-B364-AFE4947304F3)
‘VMName’: Account does not have sufficient privilege to open attachment
D:\Hyper-V\NewHardDisk.vhd. Error: ‘General access denied error’ (0x80070005). (Virtual Machine ID 1DC704C1-6075-4F6C-B364-AFE4947304F3)
Alright, it looks like I have a file permission error. When I look at the Security tab on the Properties window of the source VHD file I see the following:
Great… all I have to do is add that user (group?) to the new VHD file, and I’ll be set. The problem is… how the heck do I do that? I certainly can’t do it from the GUI… No problem.
- Open a Command Prompt with Administrator credentials.
- type the following command: icacls “D:\Hyper-V\NewHardDisk.vhd” /grant “NT Virtual Machine\1DC704C1-6075-4F6C-B364-AFE4947304F3”:F
- The response should read:
processed file: D:\Hyper-V\NewHardDisk.vhd
Successfully processed 1 files; Failed processing 0 files.
If this is what you got, then you are ready. You should now be able to start up your virtual machine without error.
Good luck… now go forth and virtualize!
Leave a Reply