none
Hyper-V .VHD error Event IDs: 12140, 12620, 14140 failed to add device 'Microsoft Virtual Hard Disk'

    Question

  • HP Proliant ML150, Windows SBS 2008 SP1, all updates applied.
    System was running fine until a Windows Update was applied. Problem was not noticed until after the appropriate system restore points had been removed so I cannot restore to a working config.

    When attempting to start a Virtual Machine, edit or create a disk I get a error:

    Error Applying Hard Drive Changes

    Failed to add device 'Microsoft Virtual Hard Disk'.

    Cannot open attachment 'C:\Hyper-V\xxxxxxx.vhd'. Error: 'The process cannot access the file because it is being used by another process.'

    Cannot get information for attachment ' C:\Hyper-V\xxxxxxx.vhd'.

    Cannot open attachment 'C:\Hyper-V\xxxxxxx.vhd'. Error: 'The process cannot access the file because it is being used by another process.'

    Event Logs show:
    Event ID 12140 - '[Virtual Machine Name]': Cannot open attachment 'C:\Hyper-V\xxxxxxx.vhd'. Error: 'The process cannot access the file because it is being used by another process.' (7864368)

    Event ID 12620 - '[Virtual Machine Name]': Cannot get information for attachment ' C:\Hyper-V\xxxxxxx.vhd'.

    Event ID 14140 - '[Virtual Machine Name]' failed to add device 'Microsoft Virtual Hard Disk'.

    The file exists and in the proper directory. The file was restored to an older version. The permissions were reset (all the way to everyone:Full control). The file is definitely not in use. I can modify and delete the file. Removed and re-added the Hyper-V role as an attept to solve but to no avail.

    Thanks for any help 

    Wednesday, July 15, 2009 7:14 AM

Answers

  • Hi,

     

    Please perform the following suggestions to test whether it works:

     

    1.    Add [Network Service] with [Full Control] under C:\ProgramData\Microsoft\Windows\Hyperv\InitialStore.xml

    2.    Set [Start] value to [4] for HKLM\System\CurrentControlSet\Services\imbdrv

    3.    Set [Administrator] with [Full Control] under [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E97D-E325-11CE-BFC1-08002BE10318}]

     

    I also include a post discussed the similar issue to yours, you can refer to:

     

    Virtual Machines Fail to Start, cannot add disks <failed to add device 'Microsoft Virtual Hard Disk'> <Failed to power on with Error 'General Access Denied Error'>

    http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/b9c91808-67ee-4123-9d42-1f323d4d97e1


    If the issue continues, please use Process Monitor to capture a file and registry access trace while attaching a VHD file to a VM. After that, please send the log file for further research.

     

    Process Monitor v2.04

    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

     

    How to use Process Monitor

     

    1.    Please download Process Monitor,

    2.    Please run Process Monitor and then start a problematic VM (Please keep “Data Exchange” checked here).

    Note: The Process Monitor will captured automatically after you start it, if it doesn’t start, you can click Capture on the toolbar menu or press “Ctr + E”to start it.

    3.    Once the error occurred, please click File menu, uncheck Capture Events, click Save, exported the events to Logfile.CSV

    4.    Please upload the file and then use Windows Live SkyDrive (http://www.skydrive.live.com/) to upload the file and then give me the download address.

     

     

    Best regards,

    Vincent Hu

    Tuesday, July 21, 2009 9:48 AM

All replies

  • You added Everyone; Full Control, but did you add "System"

    Everyone refers to users, but it does not cover System, and Network.  This should cover the individual VM GUID account.

    Try adding "system"
    Brian Ehlert (hopefully you have found this useful)
    Wednesday, July 15, 2009 2:49 PM
  • BrianEh,

    I suppose I should have specified when I said that the permissions were fully reset meaning to a system default set of permissions. Creator Owner - Full, Administrators - Full, System - Full, Users - Read & Execute.

    I was just stating that for testing purposes, all groups (including everyone) were also made to full, but this did not help.

    To completely nullify permissions as the issue I am going to install and initialize a completely separate drive and see if the issue persists. I don't think this will help as I have tested the virtual drive creation across different drives and folders within the system.

    Any other suggestions outside of permissions?

    Tim
    Thursday, July 16, 2009 7:39 AM
  • I tried to a new drive. Same issue.

    Also, I want to further detail the issue maybe sparking more ideas. When I use the New - Disk fly out option from the Hyper-V Manager window. The virtual disk gets created without error. Whether it's a 'fixed size' or 'dynamic' disk. The error occurs when assigning the disk to a Virtual Machine in the Virtual Machine Settings window. Nothing else is assigned to the Machine as far as the IDE controllers are concerned. Just the one disk.

    Tim
    Thursday, July 16, 2009 7:47 AM
  • Do you keep attempting to assign the disk to the same virtual machine?

    Or have you attempted to create a new virtual machine and assign the disk to that?

    I have seen forum cases of permissions weirdness in regards to the configuration of the Hyper-V host, restore of some elements, etc.

    Generally these have been resolved by creating a new VM and allowing everything to regenerate around this VM or to remove, and then re-add the Hyper-V role (if Server 2008) or a re-install of the host (if Hyper-V Server) - when the datastore gets messed up.

    Brian Ehlert (hopefully you have found this useful)
    Thursday, July 16, 2009 4:07 PM
  • New drive to existing VM. Existing drive to existing VM. Existing drive to new VM. New VM and new drive. All result with same error.

    As stated in original post, I also removed the Hyper-V Role and re-added the Role. No change in result. I deleted all VMs and disks, and then have gone back in to create both new VM and disk. Same error.

    Tim
    Thursday, July 16, 2009 9:47 PM
  • Hi,

     

    Please perform the following suggestions to test whether it works:

     

    1.    Add [Network Service] with [Full Control] under C:\ProgramData\Microsoft\Windows\Hyperv\InitialStore.xml

    2.    Set [Start] value to [4] for HKLM\System\CurrentControlSet\Services\imbdrv

    3.    Set [Administrator] with [Full Control] under [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E97D-E325-11CE-BFC1-08002BE10318}]

     

    I also include a post discussed the similar issue to yours, you can refer to:

     

    Virtual Machines Fail to Start, cannot add disks <failed to add device 'Microsoft Virtual Hard Disk'> <Failed to power on with Error 'General Access Denied Error'>

    http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/b9c91808-67ee-4123-9d42-1f323d4d97e1


    If the issue continues, please use Process Monitor to capture a file and registry access trace while attaching a VHD file to a VM. After that, please send the log file for further research.

     

    Process Monitor v2.04

    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

     

    How to use Process Monitor

     

    1.    Please download Process Monitor,

    2.    Please run Process Monitor and then start a problematic VM (Please keep “Data Exchange” checked here).

    Note: The Process Monitor will captured automatically after you start it, if it doesn’t start, you can click Capture on the toolbar menu or press “Ctr + E”to start it.

    3.    Once the error occurred, please click File menu, uncheck Capture Events, click Save, exported the events to Logfile.CSV

    4.    Please upload the file and then use Windows Live SkyDrive (http://www.skydrive.live.com/) to upload the file and then give me the download address.

     

     

    Best regards,

    Vincent Hu

    Tuesday, July 21, 2009 9:48 AM
  • Did you ever fix this issue? I have the same problem with the same exact server (ML150). Just started today. Any help would be greatly appreciated! Stuart
    Friday, August 07, 2009 12:54 AM
  • I have the same problem.

    My system is Windows 2008 Datacenter R2, Motherboad is Intel S5000SVA with 2 CPUs, not install Intel Management software.

    Anybody has any successful solutions ? I tried Vincent Hu's method, it did not work for me.
    Thursday, September 10, 2009 11:51 PM
  • Same Problem with INTEL S5000PSL Board. Also haven´t installed Intel Management Software. Have opend a ticket at microsoft...they are still looking. Will tell if an solution is working.
    Friday, November 20, 2009 10:33 PM
  • Did this ever get fixed?

    I have an Intel 5000 board too, no Intel tools but get this same error.

    I also have no HKLM\System\CurrentControlSet\Services\imbdrv in the registry at all.

    Server 2008 SP2.  Was originally in workgroup but changed to a DC, the domain name however was mismatched so I changed it and ran through all the tools for changing a domain name.

    Server works great no problems but we wanted to install a VM so we could test a new SQL DB before roll out but I keep running into that error.

    I added Network Service to the XML file but have no entry in
    HKLM\System\CurrentControlSet\Services\imbdrv


    Thanks
    Saturday, February 06, 2010 2:41 AM
  • Have there been any update/idea/solution to this problem?

    I am using an Lenovo IdeaPad V460 with Windows 2008 R2 installed, and Windows 2008 R2 sp1 beta installed. The sp1 was installed to resolve the bluescreen whenever it starts up if Hyper-V role is enabled.

    So far I had researched through all the available solutions presented in technet forums, including: 1. granting full permission to files and directories, 2. Removing antivirus, 3. Ensuring no backup software installed, 4. setting FSDepend.sys registry key, 5. Taking ownership of registry key HKLM\system\CCS\class\{4D36E97D-E325-11CE-11CE-BFC1-08002BE10318}\Properties, Adding "Network Service" to administrators group.

    I cannot add existing vhd to Hyper-V, cannot mount vhd in disk manager, cannot inspect vhd in Hyper-V, cannot create any new vhd, they all give the same errors:

    Cannot get information for attachment 'd:\VMs\Windows XP Professional\Virtual Hard Disks\Windows XP Professional.vhd'.
    Cannot open attachment 'D:\VMs\Windows XP Professional\Virtual Hard Disks\Windows XP Professional.vhd'. Error: 'A virtual disk support provider for the specified file was not found.'
    'Windows XP Professional' failed to add device 'Microsoft Virtual Hard Disk'. (Virtual machine ID 5853DA7E-17C9-4BAE-9BB8-EEBE1E1B08A4)

    I believe the Intel raid controller is a culprit but is there not any workaround or solution yet?

    Hyper-V is just too important to me, I have to teach Microsoft courses and performing the lab in the notebook. I am stuck now.

    Thursday, August 19, 2010 3:10 AM
  • This would not be the first time that I have seen a RAID controller causing such errors in the forums.

    However, have you double checked that the hypervisor is actually running?

    The error that a VDS providor cannot be found that I find troubling.  This points to a device driver problem of some type.

    I assume that this is onboard RAID (since this is a laptop) - have you gone into the BIOS and considered a different mode?  Or BIOS updates?

    Have you tried mounting your VHDs using Disk Management (or using DiskPart)?  This would perform the mounting outside of the hypervisor and would rule out the hypervisor.

     


    Brian Ehlert (hopefully you have found this useful) http://ITProctology.blogspot.com
    Thursday, August 19, 2010 3:30 AM
  • Brian,

    Thank you for the fast response.

    I had actually mentioned in my message that I had already tried to mount vhd using disk manager, and the same error appeared.

    My laptop has options to boot up either Hypervisor enabled or disabled. I tested it doesn't matter whether hypervisor enabled or disabled, the same error occured.

    BIOS allows changing the SATA mode to AHCI or compatible, currently it is AHCI, if it is changed to compatible, the Windows cannot boot up - will give bluescreen.

    I have just updated the AHCI storage driver to the latest. Unfortunately there is no BIOS update for V460 yet. After update and restarted, the problem is the same, didn't help.

    I can also try to install (repair) Windows 2008 R2 after setting the SATA RAID controller to compatible, and try again, if I can find some time to do it.

    Thursday, August 19, 2010 4:36 AM
  • my experience with the on-board RAID controllers is that whenever you change them, the installed OS is broken and will need to be re-installed.

    We have some workstations that I use for testing that have an ACHI setting as well and I have to set them all to their ATA setting or else I have strange random problems.

    My point about the hypervisor running is that when it is 'on' you have actually verified that it is working - I assume that you have used other VMs.

    Also, I don't know where the VHDs are coming from (their source) but that is a consideration as well.  If all of the problems are coming from the same source or being copied to the machine in the same way.

    And you mentioned a laptop, so drive encryption also popped into my head.


    Brian Ehlert (hopefully you have found this useful) http://ITProctology.blogspot.com
    Thursday, August 19, 2010 12:44 PM
  • With Hypervisor ON or OFF, the error is the same, thus the Hypervisor is not the cause of the problem.

    I have lost count of the number of years the vhd has gone through, many different machines, Windows 2008 Hyper-V, Windows XP Virtual PC, Windows 7 Virtual PC and Windows 2008 R2 Hyper-V, all running OK until I tried to run on this laptop.

    I do not think the vhd itself is the cause of the problem because when creating a new one from Hyper-V console, it is the same error.

    There is no drive encryption on this laptop.

    • Proposed as answer by Joe Bussa Monday, August 19, 2013 5:12 PM
    • Unproposed as answer by Joe Bussa Monday, August 19, 2013 5:12 PM
    Thursday, August 19, 2010 1:00 PM
  • I had the same problem. Turns out the Volume was set to read-only

    diskpart
     LIST DISK 
     SELECT DISK <disk #>) 
     detail disk 
     ATTRIBUTE DISK CLEAR READONLY

    good luck!

    Monday, August 19, 2013 5:13 PM
  • i had a similar problem adding a *.vhd to an existing virtual machine. Joe's answer helped me out.

    :)

    Tuesday, January 14, 2014 2:39 PM