Skip to main content

VM Not boot up / Undo Windows Patches

 

Windows Server 2012 R2 is Stuck on "Updating Your System" 

At the time of updating patches on virtual machine running on a Microsoft Hyper-V platform if one of the updates had failed, and all pending updates were going to be undone. After about an hour of "undoing changes", the servers restarted. The following screen appeared, and stayed there, even after hours of waiting, with no progress being made: 

 


Steps to fix: 

 1) Turn off VM.  

2) Go into the VM settings and adjust the "Automatic start delay" option, set 5 second delay so that we have more time to press the F8 key when we turn on the VM 

 


3) Power on VM and press the F8 key, following menu will appear: 

 


4) Choose "Troubleshoot" then "Command Prompt" 

5) When prompted, you will need to enter the password for a local administrator account. 

6) Next, we need to run the following command to get a list of all available drives: 

 wmic logicaldisk get name 

 7) Next, we need to locate the drive that contains the Windows directory. This may or may not be the C: drive listed. The easiest way to confirm is to check each drive letter for the Windows directory by using the "dir" command. The following instructions assume the Windows directory exists on the C: drive. Yours may differ. If it does, simply replace "C" with your drive letter. 

8) Next, we need to navigate to the C:\Windows\WinSxS directory by using the following command: 

 cd Windows\Winsxs 

 9) Next, we need to list all files beginning with "Pending". To do this, we can use the following command: 

 dir pending* 

 10) Next, we need to rename all "Pending" files to append "_old" to the end of the file name. Here is a sample command that will rename "Pending.xml" to "Pending_old.xml": 

 ren Pending.xml Pending_old.xml 

 11) Next, we need to create a new blank "Pending.xml" file, which will be required steps to come later. We do this with the following command: 

 echo > pending.xml 

 12) Next, we need to navigate to the C:\Windows directory.  

 13) Next, we need to create a new directory within Windows called "scratch". To do this, we will use the following command: 

 mkdir scratch 

 14) Next, we need to run a DISM command to remove/revert all pending actions from the damaged image. In my case, these are the failed updates which are attempting to install. To do this, we will use the following command: 

 DISM /Image:C:\ /Cleanup-Image /RevertPendingActions 

 /scratchdir:C:\Windows\Scratch 

 15) Next, we need to rename the "SoftwareDistribution" folder to "SoftwareDistributionOLD". To do this, we will use the following command: 

 ren C:\Windows\SoftwareDistribution C:\Windows\SoftwareDistributionOLD 

 16) Next, we need to run a system file checker tool to repair missing or corrupt system files. Run following command: 

sfc /scannow 

 17) Lastly, we need to restart the VM. The process may take slightly longer than normal, after some time, below window will show: 


 Once this process has completed, Windows Server will be back to normal state.

 

Comments

Popular posts from this blog

Datto Backup Process

                                                    Backup Process Local Backup The protected machine generates data that needs to be backed up.   The Datto appliance sends a backup request to the agent software installed on the protected machine.   The agent software opens the network transfer protocol and initiates the VSS snapshot on the protected machine.   The backup data is transferred over the network to the Datto and written to the live dataset.   On the Datto appliance, ZFS takes a point-in-time snapshot of the live dataset and integrates it into the backup chain.         Roundtrip:-                Roundtrip drives are external hard drives provided b y Datto to expedite the transfer of large data sets to the Datt...

Beyond the Basics: Understanding the 3-2-1 Backup Rule

In our increasingly digital world, data is king. From cherished family photos and important financial documents to critical business records, our lives and livelihoods depend on the availability and integrity of our digital information. But what happens when disaster strikes? A hard drive crashes, a laptop is stolen, a ransomware attack locks down your files, or a natural disaster renders your primary systems unusable? ​That's where the 3-2-1 backup rule comes in. It's a simple, elegant, and incredibly effective strategy for data protection that every individual and organization should adopt. Forget complex jargon – let's break down this fundamental principle of digital resilience. ​What is the 3-2-1 Backup Rule? ​The 3-2-1 rule is a widely recommended guideline for ensuring your data is safe and recoverable in almost any scenario. It's built on three core tenets: ​ 1. 3 Copies of Your Data: This is your foundational layer of protection. You should al...

Windows Stuck on "Preparing to configure Windows"

           Preparing to configure Windows. Do not turn off your computer.   When server got stuck from long time on “Preparing to configure Windows Do not turn off your computer” . Don’t powering it off because it may be bad effect on your OS. Here have fix to get rid out of this.                                                                                                   Steps to Fix: Logged into another server on the same domain. Open Services console Right Click on Service (Local), then click on “Connect to...