Server 2012 R2 Hyper-V VM – Updates stuck at 5%

Resolution for Hyper-V VM (Server 2012 R2) – updates stuck at x%

OK – so this was partly (well… completely) my fault. Rebooted a Hyper-V Host Server whilst one of the VMs was running updates.

I know – should have checked, should have downed or moved the VMs first etc etc – but I didn’t.

When the host came back up, most of the VMs, but one, were fine – fortunately nothing too important on it, just the helpdesk system and portal (Spiceworks in this case).

Took me the best part of an hour to get it back up and running (any longer and I’d have created a new server and restored the Spiceworks backup) – eventually hit on the following sequence to recover successfully. Part way there (renaming the xml and first attempts at dism) I got rid of the stuck update message and was presented with endlessly circling dots – very frustrating.

Anyway – this worked for me:

  1. F8 on boot to get recovery console
  2. Go to Command prompt
  3. Navigate from X: to system drive installation folder (usually C:\Windows\winsxs)
  4. Rename pending.xml to pending.bak
  5. Create empty pending.xml (‘echo > pending.xml’ from Command prompt)
  6. Run: ‘dism.exe /image:C:\ /cleanup-image /revertpendingactions’
  7. Reboot (not ‘Continue to Server 2012’)

Note that on reboot the server dropped to a black empty screen (just showing ‘Hyper-V’) for about a minute before successfully rebooting – fortunately I sat there staring blankly at the screen for long enough to see it actually come up.

Tried initially without renaming original pending.xml or creating a blank pending.xml file – dism failed with various errors (3017, 87).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.