locked
Interrupted VM stuck RRS feed

  • Question

  • I was doing updates on my 2012R2 Hyper-V VM and power dropped. When I booted my host PC back up the VM would start and say Hyper-V Updating your system (x%) and get stuck at 5%. I can't get past this and I have no snapshots/backups of the VM. Is there anyway to recover this VM?
    Friday, March 6, 2015 12:37 PM

All replies

  • Hi,

    did you try to boot VM into safe mode?

    Friday, March 6, 2015 12:58 PM
  • Yes.  I can get there but don't have an image to recover from, etc.
    Friday, March 6, 2015 1:00 PM
  • So..you can try this:

    1) boot to safemode

    2) open cmd

    3) change filename of c:\windows\winsxs\pending.xml

    4) reboot

    Worked for me.

    Friday, March 6, 2015 1:06 PM
  • Almost there.  Now I don't get the "Updating your system (5%)", I just get the spinning dots and it just sits there doing that.
    Friday, March 6, 2015 1:27 PM
  • Try chkdsk, if not help you can try this:

    1) boot to safemode

    2) open cmd

    3) run dism.exe /image:C:\ /cleanup-image /revertpendingactions

    4) reboot

    AFAIK it should revert all pending updates.

    Friday, March 6, 2015 2:03 PM
  • Never mind.  I didn't put the space between c:\ and /cleanup-image
    Friday, March 6, 2015 2:32 PM
  • I tried both the chkdsk and chkdsk /F.  No help.  Also did the dism command, it ran successfully but no help.
    Friday, March 6, 2015 2:47 PM
  • I have tried multiple dism command options and nothing seems to be working.  I really don't want to have to build this all from scratch and re-install and configure all that was on it.  I know, should have taken backups then.
    Friday, March 6, 2015 4:10 PM
  • Any other suggestions?
    Monday, March 9, 2015 12:49 PM
  • Hi Sir,

    Please try to login safe mode the try the step mentioned by Mirek :

    "3) change filename of c:\windows\winsxs\pending.xml"

    Also please try to use "last good configuration" :

    Best Regards,

    Elton Ji


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com .

    • Proposed as answer by Elton_Ji Wednesday, March 25, 2015 6:48 AM
    • Unproposed as answer by Elton_Ji Wednesday, March 25, 2015 6:49 AM
    Thursday, March 19, 2015 3:11 AM
  • Try chkdsk, if not help you can try this:

    1) boot to safemode

    2) open cmd

    3) run dism.exe /image:C:\ /cleanup-image /revertpendingactions

    4) reboot

    AFAIK it should revert all pending updates.

    Note that if you renamed pending.xml previously the "revertpendingactions" option won't find anything to revert. I was able to get back into normal Windows once I did the revert with the original pending.xml file present.

    Saturday, June 27, 2015 3:23 AM
  • Hi,

     I have the same issue, tried to run the command.

    But its running on to an error. Error 3017

    AN error occurred while reverting the pending actions.

    Even safe mode is showing updating at 5%

    Please advise on what can be done. Its my DC VM and am stuck.

    Thanks,
    Sriram


    • Edited by SriramaDas Sunday, October 4, 2015 7:52 AM
    Sunday, October 4, 2015 7:51 AM
  • Im not the only one I see..... I have the same problem.... but I did not find any solution yet

    Cristian L Ruiz

    Wednesday, October 28, 2015 2:10 PM
  • Hi. I have the same problem. Did you find a solution?

    Monday, March 7, 2016 5:13 PM
  • The solutions is a full system repair/recovery.
    Monday, March 7, 2016 5:28 PM
  • I've followed this thread and have spent all morning trying to fix it, so here it what I have done and hopefully it may help someone else. Not all of the below may be needed. I'm not sure what actually fixed it. 

    Updates were stuck installing at 5%.

    1. Amended the 'Automatic Start action' on virtual machine settings to change the delay to 2 seconds, this way you can hold f8 to get to options everytime.

    2. Go to troubleshoot / CMD and make sure you find the correct drive to run the commands on from this thread. Drive X: showed on cmd but it was I guess the boot drive and not the one to edit, C; was in my instance. 

    3. Run the following on x: 'dism /image:C:\ /cleanup-image /revertpending actions'. I received error 3017

    4. Find the pending.xml files in c:\windows\winsxs use: 'dir pending*' to find all the pending.xml files.

    5. Rename them using 'ren {pending file path name} {pending.old}'. 
    I renamed every file. Restart by exiting CMD and clikcing continue to loop round.

    6. Perhaps try the 'dism /image:C:\ /cleanup-image /revertpending actions' again. Restart.

    7. I tried renaming the softwaredistribution folder to oldsoftwaredistribution. This folder is under c:\windows and should be re-inserting automatically when you download windows updates again.

    8. Renaming the pending and software meant I no longer saw the updates installing but the loading dots just kept spinning. So I inserted a blank pending.xml using 'echo > pending.xml' through CMD. At this point I got to a screen which undid windows updates. No idea if this new pending actually made a difference, but I'm now back in and the blank pending has been renamed by windows to pending.xml.bad

    Possible helpful: 

    - to see list of windows updates installed type: 'wmic qfe list'
    - I also tried turning off the secure boot under virtual machine firmware in case a update didn't like it




    • Edited by Sam2547378 Thursday, March 10, 2016 3:01 PM
    • Proposed as answer by Jozef Woo Saturday, September 3, 2016 9:48 AM
    Thursday, March 10, 2016 1:29 PM
  • I've followed this thread and have spent all morning trying to fix it, so here it what I have done and hopefully it may help someone else. Not all of the below may be needed. I'm not sure what actually fixed it. 

    Updates were stuck installing at 5%.

    1. Amended the 'Automatic Start action' on virtual machine settings to change the delay to 2 seconds, this way you can hold f8 to get to options everytime.

    2. Go to troubleshoot / CMD and make sure you find the correct drive to run the commands on from this thread. Drive X: showed on cmd but it was I guess the boot drive and not the one to edit, C; was in my instance. 

    3. Run the following on x: 'dism /image:C:\ /cleanup-image /revertpending actions'. I received error 3017

    4. Find the pending.xml files in c:\windows\winsxs use: 'dir pending*' to find all the pending.xml files.

    5. Rename them using 'ren {pending file path name} {pending.old}'. 
    I renamed every file. Restart by exiting CMD and clikcing continue to loop round.

    6. Perhaps try the 'dism /image:C:\ /cleanup-image /revertpending actions' again. Restart.

    7. I tried renaming the softwaredistribution folder to oldsoftwaredistribution. This folder is under c:\windows and should be re-inserting automatically when you download windows updates again.

    8. Renaming the pending and software meant I no longer saw the updates installing but the loading dots just kept spinning. So I inserted a blank pending.xml using 'echo > pending.xml' through CMD. At this point I got to a screen which undid windows updates. No idea if this new pending actually made a difference, but I'm now back in and the blank pending has been renamed by windows to pending.xml.bad

    Possible helpful: 

    - to see list of windows updates installed type: 'wmic qfe list'
    - I also tried turning off the secure boot under virtual machine firmware in case a update didn't like it




    I was stuck at 4%.

    I used shift+f10 to get the troubleshooting menu

    did steps 2-8, one note: dism /image:C:\ /cleanup-image /revertpending actions should be: dism /image:C:\ /cleanup-image /revertpendingactions

    This got my VM back up and running!

    Thanks Sam2547378!

    • Proposed as answer by Robin Gabb Wednesday, July 27, 2016 10:23 PM
    Thursday, March 24, 2016 6:12 AM
  • Thanks for all,

    In my case only I had to change a one parameter more. My comands were:

    I used shift+f10 to get the troubleshooting menu

    did steps 2-8, one note: 

    dism /image:D:\ /cleanup-image /revertpendingactions

    I hope I be able to help somebody.

    BR

    Friday, April 1, 2016 3:37 PM
  • I am preparing a new server with two 2012 R2 Hyper-V VMs and ran into this issue on both. The resolution posted by Sam2547378, with additions by smjain, was successful in getting one of them back. Now to go and do the same thing to the other one...Many thanks to Sam2547378 and smjain!

    • Edited by Robin Gabb Wednesday, July 27, 2016 11:02 PM
    Wednesday, July 27, 2016 10:28 PM
  • Just wanted to thank you so much!!! 
    Monday, August 15, 2016 11:58 AM
  • Thanks, I tried steps 1 to 6 and now it is working, there was no need to apply steps 7 and 8.

    Problem solved!

    Saturday, September 3, 2016 9:48 AM
  • Thanks 

    inserting a blank pending.xml

    then running:

    dism /image:C:\ /cleanup-image /revertpendingaction 

    Fixed it for me!

    Sunday, October 16, 2016 11:18 AM
  • boot into F8

    go to command prompt

    navigate to c:\windows\winsxs

    rename pending.xml to pending.bak

    create empty pending.xml

    run dism /image:C:\ /cleanup-image /revertpendingactions

    reboot

    Note 1:  After making the above changes, the server went to a black empty screen after passing the ‘Updating your system’ for about 30 or more seconds.  Just be patient.

    Note 2: Also tried it without the blank pending.xml and it did not resolve the issue.

    Note 3: Also tried running dism command without renaming the xml and creating a blank xml but received 3017 error.


    • Edited by mniccum Monday, October 17, 2016 5:04 PM
    Monday, October 17, 2016 4:56 PM
  • Awesome. That blank pending file was probably the key. Thank you so much!!!
    Sunday, October 30, 2016 2:48 PM
  • Steps 2 -8 did the trick for me. Seems the insertion of the blank pending.xml made the difference.

    Thanks

    Saturday, November 5, 2016 6:26 PM
  • Steps 2-8 did the trick for me also.

    Thank you!

    Thursday, November 17, 2016 11:48 PM
  • Seems in my case it was about inserting the blank pending file as I didn't bother running dism...revertpending... command after but still managed to recover the OS.
    Tuesday, November 29, 2016 9:32 AM
  • inserting the blank file was the ticket thank you ;-)
    Tuesday, April 4, 2017 7:03 AM
  • Thanks Sam. You are awesome!!!
    Monday, May 1, 2017 7:44 PM
  • Nope its corrupt
    Monday, May 1, 2017 7:50 PM
  • This is a long thread but the instruction from mniccum are clear and concise. Worked perfectly for me, many thanks.
    Sunday, May 14, 2017 12:05 PM
  • Try chkdsk, if not help you can try this:

    1) boot to safemode

    2) open cmd

    3) run dism.exe /image:C:\ /cleanup-image /revertpendingactions

    4) reboot

    AFAIK it should revert all pending updates.

    In my case, the server was a VM on a host machine and the VM could not see it's own virtual hard drive.  We ended up having VMWare mount the VM drive to another Server 2012 server as an online image.  It looked just like another "data" drive to the receiving server.  Then used Mirek's solution above, pointing it to the "mounted" drive (in this case, F:\).  Once it was completed, we offlined it, moved it back to the correct server as it's boot drive and the rest is history.

    EDIT: A slight difference for anyone trying this.  Don't boot to Safe Mode, just run it from an Admin Command Prompt running on the server you mounted it to.

    Tuesday, May 16, 2017 1:57 AM
  • Thanks Buddy! this was very helpful.

    Friday, September 1, 2017 11:10 AM
  • This worked for me! thanks buddy!
    Friday, September 1, 2017 11:11 AM
  • Yes this worked for me also. Thanks all.
    Saturday, December 16, 2017 3:42 AM
  • As I was preparing a new 2012r2 VM I decided to trash it and start again and whoops it did the same thing a second time.  Is there anyway to prevent it doing a third after I have followed the above instructions.  With 200 updates to apply it going to be a long job installing them one at a time until I discover which one caused the problem?
    Friday, January 5, 2018 7:25 AM
  • I've followed this thread and have spent all morning trying to fix it, so here it what I have done and hopefully it may help someone else. Not all of the below may be needed. I'm not sure what actually fixed it. 

    Updates were stuck installing at 5%.

    1. Amended the 'Automatic Start action' on virtual machine settings to change the delay to 2 seconds, this way you can hold f8 to get to options everytime.

    2. Go to troubleshoot / CMD and make sure you find the correct drive to run the commands on from this thread. Drive X: showed on cmd but it was I guess the boot drive and not the one to edit, C; was in my instance. 

    3. Run the following on x: 'dism /image:C:\ /cleanup-image /revertpending actions'. I received error 3017

    4. Find the pending.xml files in c:\windows\winsxs use: 'dir pending*' to find all the pending.xml files.

    5. Rename them using 'ren {pending file path name} {pending.old}'. 
    I renamed every file. Restart by exiting CMD and clikcing continue to loop round.

    6. Perhaps try the 'dism /image:C:\ /cleanup-image /revertpending actions' again. Restart.

    7. I tried renaming the softwaredistribution folder to oldsoftwaredistribution. This folder is under c:\windows and should be re-inserting automatically when you download windows updates again.

    8. Renaming the pending and software meant I no longer saw the updates installing but the loading dots just kept spinning. So I inserted a blank pending.xml using 'echo > pending.xml' through CMD. At this point I got to a screen which undid windows updates. No idea if this new pending actually made a difference, but I'm now back in and the blank pending has been renamed by windows to pending.xml.bad

    Possible helpful: 

    - to see list of windows updates installed type: 'wmic qfe list'
    - I also tried turning off the secure boot under virtual machine firmware in case a update didn't like it





    creating a blank pending.xml worked for me! Thanks!
    Friday, February 16, 2018 6:02 PM
  • I know this is a really old thread, but man, this one saved my bacon.

    Thanks!

    Tuesday, March 6, 2018 7:14 PM
  • My DC crashed after updates yesterday. This saved my butt. Thanks!!!

    1-6 worked for me.
    Wednesday, February 6, 2019 5:23 AM