Performing an in-place upgrade of Windows Server Stay organized with collections Save and categorize content based on your preferences.
If you have virtual machine (VM) instances running earlier versions of Windows Server,you can upgrade them to later versions of Windows Server:
| Upgrade from | Upgrade to |
|---|---|
| Windows Server 2008 R2 (Desktop Experience) | Windows Server 2012 R2 (Desktop Experience) |
| Windows Server 2012 R2 (Core) | Windows Server 2016 (Core) |
| Windows Server 2012 R2 (Desktop Experience) | Windows Server 2016 (Desktop Experience) |
| Windows Server 2016 (Core) | Windows Server 2019 (Core) |
| Windows Server 2016 (Desktop Experience) | Windows Server 2019 (Desktop Experience) |
| Windows Server 2019 (Core) | Windows Server 2022 (Core) |
| Windows Server 2019 (Desktop Experience) | Windows Server 2022 (Desktop Experience) |
| Windows Server 2022 (Core) | Windows Server 2025 (Core) |
| Windows Server 2022 (Desktop Experience) | Windows Server 2025 (Desktop Experience) |
Upgrades are subject to the following constraints:
Microsoft hasended support for Windows Server 2012 R2 andWindows Server 2008 R2. If youperform an in-place upgrade of either of these versions and encounterproblems related to the Windows Setup process (
setup.exe), Google mightonly be able to provide limited assistance.If you plan to upgrade Windows Server 2008 R2 to a version later thanWindows Server 2012 R2, you must first perform an upgrade to Windows Server2012 R2, and then perform a second upgrade to Windows Server 2016 or later.
You must upgrade incrementally, one version at a time, because multipleversion in-place upgrades are not supported.
Objectives
This guide describes how to perform an in-place upgrade ofWindows Server by:
- Planning the in-place upgrade
- Performing the in-place upgrade
- Troubleshooting the in-place upgrade
- Cleaning up after the in-place upgrade
Costs
There is no charge for performing an in-place upgrade of Windows Server. You areonly charged for the resources consumed during the upgrade, including:
Use thepricing calculator to generate a cost estimate based on your projected usage.
Before you begin
The guide assumes that you have basic knowledge of:
Plan the in-place upgrade
Performing an in-place upgrade of a virtual machine (VM) instance that isrunning an earlier version of Windows Server can be a pragmatic way to modernize yourinfrastructure and to mitigate the risks of approaching the end of the support lifecycleof Windows Server versions.
Alternatives to consider
Before you decide to use an in-place upgrade to migrate to a newer version ofWindows Server, be aware of the following limitations:
Downtime: Depending on the configuration and software installed, theupgrade might take an hour or longer. During the upgrade, access to the VMinstance is limited because:
- Workloads running on the VM instance are unavailable to users
- Remote Desktop Protocol (RDP) is not available
- There are limited ways to check the upgrade progress and the timeremaining in the upgrade
Risk: Depending on the configurations of your existing instances and theinstalled software:
- The upgrade can fail
- Some configuration options can be overridden
- Incompatibilities can cause your workload to malfunction on the upgradedinstance
Depending on the workload running on your Windows Server instance,you can reduce downtime and risk by pursuing different approaches.
| Workload | Approach |
|---|---|
Your VM instance is running a workload that supports replication, such as:
| Consider setting up a new VM instance that is running a more recent version of Windows Server, and then use replication to shift the workload from your existing VM instance to the new VM instance. |
| You have a VM instance that is running a multitude of workloads | Consider migrating these workloads to separate VM instances so that each VM instance runs only a single workload. Even if you can't migrate all workloads, reducing the number of workloads running on a single VM instance can help reduce risks during an in-place upgrade. |
Product keys
A Windows Server product key is valid for only a specificversion; when you perform an upgrade to a later version of Windows Server, youmust supply a new product key. There are two primary scenarios:
You are upgrading a VM instance that is based on apublic operating system image provided by Google: In thisscenario, you must use the predefinedKMS client setup keys for the version of Windows Server that you are upgrading to. The upgradedoes not incur additional charges.
You are upgrading a VM instance for which youbrought an existing license: InBYOL,you need to acquire a product key from your license vendor to performthe upgrade.Check the Microsoft documentation to determine which edition you can upgrade toand whether you are eligible for license conversion.
Installation media
To perform the upgrade, you need an installation media. There are two primaryscenarios:
You are upgrading a VM instance that is based on apublic operating system image provided by Google: In this scenario, you can use the volume licenseinstallation media provided by Google. The steps to access this installationmedia areprovided below.
You are upgrading a VM instance that is based on an imported disk or image:In this scenario, you cannot use the installation media provided by Google.Instead, you have to use an installation media that matches the type ofmedia that you used to install Windows Server on the imported disk or image.
Important: If you use a custom install media to upgrade to Windows Server2012 R2, make sure todisable animations before using it to perform an upgrade. Disabling animations is critical toprevent theMSOOBEprocess from causing the upgrade to stop respondingindefinitely.
Other prerequisites
Before you begin your upgrade, review the Microsoft documentation aboutprerequisites and potential limitations for the version of Windows Serveryou are planning to upgrade to:
2012 R2
Verify that your VM instance meets thesystem requirements for Windows Server 2012and hassufficient free disk space.
Reviewrecommendations for upgrading serverroles,known issues,and theupgrade processfor Windows Server 2012 R2.
Verify that you aren't affected byfeaturesremoved or deprecatedin Windows Server 2012 R2.
Verify that all your customor third-party software is compatible with Windows Server 2012 R2.
Year 2016
Verify that your VM instance meets thesystem requirements for Windows Server 2016 and hassufficient free disk space.
Review theserver role upgrade and migration matrix for Windows Server 2016 andapplication compatibility table
Verify that you aren't affected byfeaturesremoved or planned for replacement in Windows Server 2016.
Verify that all your customor third-party software is compatible with Windows Server 2016.
Year 2019
Verify that your VM instance meets thesystem requirements for Windows Server 2019 and hassufficient free disk space.
Review theWindows Server 2019 and Microsoft Server application compatibility list.
Verify that you aren't affected byfeaturesremoved or planned for replacement in Windows Server 2019.
Verify that all your customor third-party software is compatible with Windows Server 2019.
Year 2022
Verify that your VM instance meets thesystem requirements for Windows Server 2022 and hassufficient free disk space.
Review theWindows Server 2022 and Microsoft Server application compatibility list.
Verify that you aren't affected byfeaturesremoved or planned for replacement in Windows Server 2022.
Verify that all your customor third-party software is compatible with Windows Server 2022.
Year 2025
Verify that your VM instance meets thesystem requirements for Windows Server 2025 and hassufficient free disk space.
Review theWindows Server 2025 and Microsoft Server application compatibility list.
Verify that you aren't affected byfeaturesremoved or planned for replacement in Windows Server 2025.
Verify that all your customor third-party software is compatible with Windows Server 2025.
Perform the in-place upgrade
The following sections guide you through the process of upgrading your VMinstance.
Create a snapshot
Before you start the upgrade, we recommend that youcreate a snapshot of yourVM instance,so that you can revert to a safe state in case anything goes wrong:
Create aregular snapshot for the boot disk of your VM instance.
If the VM instance has additional data disks attached, create snapshots forthe data disks by usingthe Volume Shadow Copy Service (VSS).
Prepare your Windows Server configuration
Verify the configuration of your Windows Server VM instance:
Connect to your VM instance with an RDP client.
Verify that Windows Server is up to dateby using Windows Update.
Disable or uninstall antivirus, antispyware, and other agents that caninterfere with the upgrade or are incompatible with the Windows Serverversion that you're upgrading to.
Attach the install media
Before you can perform the upgrade, attach the necessary installation media to theVM instance. The right media to use depends on your scenario:
- You are upgrading a VM instance that is based on a public operating systemimage provided by Google: In this scenario, you only need to attach thevolume license installation media provided by Google. This media containsboth the necessary scripts to run the upgrade and the files for the new versionof Windows Server.
You are upgrading a VM instance that is based on an imported disk or image:In this scenario, you also need to attach the volume license installation mediaprovided by Google so that you can access the necessary scripts.
Additionally, you have to attach a custom installation media that matches the type of media thatyou used to install Windows Server on the imported disk or image.
To attach the volume license installation media provided by Google, follow these steps:
In the Google Cloud console, openCloud Shell by clicking theActivate Cloud Shell
button.
Set the default project ID. Replace
PROJECT_IDwith the name of yourCompute Engine project:gcloud config set projectPROJECT_ID
Create a disk based on the installation media. Replace
ZONEwith thename of the zone where the VM is located:gcloud compute disks create win-installers --image-family=windows-install-media --image-project=compute-image-tools --zone=ZONE
This command adds a disk named
win-installersto your project. This diskis not attached to any VM instance.Attach the disk to your VM by using read-only (
ro) mode, so thatyou can attach the disk to multiple VMs if necessary:gcloud compute instances attach-diskVM_NAME --disk=win-installers --mode=ro --zone=ZONE
Replace the following:
VM_NAME: the name of the VM instance to upgradeZONE: the name of the zone where the VM is located
You can use the same disk for multiple and parallel VM upgradeswithin the same zone, but if you want to upgrade a VM in adifferent zone, you must create another disk in that zone.
If you are upgrading a VM that is based on an imported disk or image,attach the custom installation media as an additional disk:
Follow the steps inCreating an image from an ISO file to create a disk from the ISO image that you want to use as custom installation media.
Attach the disk to your VM, by using read-only (
ro) mode so thatyou can attach the disk to multiple VMs if necessary:gcloud compute instances attach-diskVM_NAME --disk=CUSTOM_MEDIA_DISK --mode=ro --zone=ZONE
Replace the following:
VM_NAME: the name of the VM to upgradeCUSTOM_MEDIA_DISK: the name of the disk containing your custom installation mediaZONE: the name of the zone where the VM is located
Start the upgrade
By default, Windows Setup prompts you for input at various points during anupgrade. Because you can't connect to the VM by using RDP during theupgrade and therefore can't provide any input, run the upgrade inunattended mode.
Connect to your VM with an RDP client. For more information, seeConnecting to instances.
Open an elevated command prompt:
- If you use Server Core, an elevated command prompt should open automatically after login.
- If you use Windows Server with full Desktop Experience,right-click theStart button and selectCommand Prompt (Admin).
Change the working directory to the installation media. The correct workingdirectory depends on the Windows Server version that you are upgrading to:
Important: Adjust the drive letter if Windows assigned a different letterthan2012 R2
cd /d d:\*2012*
Year 2016
cd /d d:\*2016*
Year 2019
cd /d d:\*2019*
Year 2022
cd /d d:\*2022*
Year 2025
cd /d d:\*2025*
D:to the disk containing the volume license installation mediaprovided by Google.Start the Windows upgrade. The required steps to start the upgradedepend on the Windows Server version that you are upgrading to and whetheryour VM is based on a public operating system image or onan imported disk or image:
2012 R2
Run
upgrade.ps1to start the Windows upgrade. The script completes thefollowing steps:- Install the latestGoogle driver packages,which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required forCompute Engine.
- Enable access to theEmergency Management Services (EMS) console during the upgrade.
- Launch Windows Setup (
setup.exe) from the install media to perform an upgrade in unattended mode. - Selects the correct edition of Windows Server 2012 R2 to install.
- Provides the Generic Volume License Key (GVLK) for the new version of Windows Server.
powershell -ExecutionPolicy Bypass -File upgrade.ps1
2012 R2 (BYOL)
Run
upgrade.ps1to start the Windows upgrade. The script completes thefollowing steps:- Install the latestGoogle driver packages,which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required forCompute Engine.
- Enable access to theEmergency Management Services (EMS) console during the upgrade.
- Launch Windows Setup (
setup.exe) from the install media to perform an upgrade in unattended mode. - Selects the correct edition of Windows Server 2012 R2 to install.
- Provides the user provided license key for the new version of Windows Server.
powershell -ExecutionPolicy Bypass -File upgrade.ps1 -SetupExePathSETUP_PATH -ProductKeyPRODUCT_KEY
Replace the following:
SETUP_PATH: the path tosetup.exeon your custom installation mediaPRODUCT_KEY: a valid product key for Windows Server 2016.
The
-ProductKeyparameter is only required ifyou are upgrading a VM instance for which you brought an existing license (BYOL)2016 or later
Run
upgrade.ps1to start the Windows upgrade. The script completes thefollowing steps:- Install the latestGoogle driver packages,which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required forCompute Engine.
- Enable access to theEmergency Management Services (EMS) console during the upgrade.
- Launch Windows Setup (
setup.exe) from the install media to perform an upgrade in silent mode. - Provide a product key for the new version of Windows Server.
powershell -ExecutionPolicy Bypass -File upgrade.ps1
In some cases, Windows Setup might show aSelect Image screen. If yousee this screen, select the configuration that matches yourcurrent configuration:
- If you use Server Core, selectDatacenter.
If you use Windows Server with full desktop experience, selectDatacenter (Desktop Experience).
ClickNext to begin the upgrade.
It might take several minutes for the setup to initialize.
2016 or later (imported)
Run
upgrade.ps1to start the Windows upgrade. The script completes thefollowing steps:- Install the latestGoogle driver packages,which are critical for the Windows Server upgrade to succeed.
- Apply Windows settings that are required forCompute Engine.
- Enable access to theEmergency Management Services (EMS) console during the upgrade.
- Launch Windows Setup (
setup.exe) from the install media to perform an upgrade in silent mode.
powershell -ExecutionPolicy Bypass -File upgrade.ps1 -SetupExePathSETUP-PATH -ProductKeyPRODUCT-KEY
Replace the following:
SETUP_PATH: the path tosetup.exeon yourcustom installation mediaPRODUCT_KEY: a valid product key for theversion of Windows Server that is being upgraded to. For example, ifupgrading from Windows Server 2016 Datacenter to Windows Server 2019Datacenter, provide a valid Windows Server 2019 Datacenter key.
The
-ProductKeyparameter is only required if you are upgrading a VM instancefor which you brought an existing license (BYOL).In some cases, Windows Setup might show aSelect Image screen. If yousee this screen, select the configuration that matches yourcurrent configuration:
- If you use Server Core, selectWindows Server Datacenter.
If you use Windows Server with full desktop experience, selectWindows Server Datacenter (Desktop Experience).
ClickNext to begin the upgrade.
It might take several minutes for the setup to initialize.
The upgrade process might issue the following warning. If so, you canignore it:
[package name] or a newer version is already installed on the system
The system can become temporarily unresponsive while installing the
netkvmdriver. If this happens, don't close the RDP connection or stop theVM instance unless the system is unresponsive for more than 5 minutes. Ifyou do lose RDP connectivity, wait approximately 5 minutes before youreconnect to the VM instance.The Setup Wizard might require you to restart the system first. Inthis case, restart the VM instance and run Windows Setup again, using thesame command.
After about 5 minutes, the machine reboots, and RDP disconnects.
Observe the upgrade process
Depending on the machine type of your VM instance and your Windows Serverconfiguration, the upgrade might take between 10 and 60 minutes to complete.During that time, you can observe the status through theserial port output:
In Cloud Shell, observe the boot process by running the following command:
gcloud compute instances tail-serial-port-outputVM_NAME --zone=ZONE
Replace the following:
VM_NAME: name of your VM instanceZONE: name of the zone where the VM instance is located
Wait until the machine has rebooted four times. Depending on theconfiguration of your VM instance, it might take 30 minutes or morefor these reboots to occur. You can recognize a reboot by output thatlooks similar to this:
SeaBIOS (version 1.8.2-20190620_103534-google)Total RAM Size = 0x00000001e0000000 = 7680 MiBCPUs found: 2 Max CPUs supported: 2
After the fourth reboot, wait until the output
GCEMetadataScripts: Finished running startup scriptsorNo startup scripts to runappears.
Perform post-upgrade steps
You can now connect to the VM instance to verify that the upgrade has beensuccessfully completed.
Connect to the VM instance by using an RDP client. For more information,seeConnecting to instances.
Sign in using a user account with local administrator privileges.
Open an elevated command prompt:
- If you use Server Core, an elevated command prompt should open automatically after login.
- If you use Windows Server with full desktop experience,right-click theStart button and selectCommand Prompt (Admin).
Run the following command to query the version of Windows Server:
Windows Server Core
ver
Windows Server with Desktop Experience
winver
Verify that the version matches the expected version of Windows Server.
Change the working directory to the installation media. The correct workingdirectory depends on the Windows Server version that you are upgrading to:
Important: Adjust the drive letter if Windows assigned a different letterthan2012 R2
cd /d d:\*2012*
Year 2016
cd /d d:\*2016*
Year 2019
cd /d d:\*2019*
Year 2022
cd /d d:\*2022*
Year 2025
cd /d d:\*2025*
D:to the disk containing the volume license installation mediaprovided by Google.Run
upgrade.ps1again to re-apply specificCompute Engine settings that might have been lost duringthe upgrade:powershell -ExecutionPolicy Bypass -File upgrade.ps1
Restart the VM instance to ensure all changes take effect. It might take1 to 2 minutes for the reboot to complete before you can connect to the VMinstance again.
Detach the installation disk
You can now detach the installation disk from the VM instance:
In Cloud Shell, detach the installation disk from your VM instance,replacing
VM_NAMEwith the name of your VM instance:gcloud compute instances detach-diskVM_NAME --disk=win-installers
Install updates and restore access
After the upgrade is complete, run Windows Update to download and install anysecurity updates. To install the security updates, follow these steps:Connect to the machine by using an RDP client. For more information, seeConnecting to instances.
Use Windows Update toinstall the latest Windows updates.You might have to restart the VM instance multiple timesduring this process.
Re-enable any agents, antivirus, or antimalware software that you disabledbefore the upgrade.
Troubleshoot the in-place upgrade
While running Windows Setup, you can't connect to the VM instance with RDP. Ifyou suspect that the upgrade failed or is not progressing, use the followingapproaches, in order, to diagnose the situation:
Check the serial port output
To check the progress of the upgrade process, view theserial port output of the VM instance:
- Serial port 1 captures the boot status
- Serial port 3 captures the log output of Windows Setup
During the upgrade, you should observe four reboots. If you don't observe anyprogress for more than 30 minutes after the first reboot, it is likely that theupgrade failed.
Check CPU and I/O metrics
Running a Windows Server upgrade is a CPU and disk I/O intensive operation. Bychecking the CPU and I/O metrics, you can get an indication for whether thesetup is progressing.
View the CPU and I/O metrics in the Google Cloud console:
In the Google Cloud console, go to theVM instances page.
Click the instance that you're upgrading.
Click theMonitoring tab.
Connect to the Emergency Management Services console
Both during and after running Windows Setup, you can connect to theEmergency Management Services (EMS) console.Using the EMS console, check theWindows Setup log files and theevent log for indications that the upgrade is still progressing or for information aboutany errors that might have occurred.
Connect remotely by using WinRM
If connecting by using RDP or EMS fails, you can try using WinRM to establish aremote PowerShell session:
Connect to a different Windows Server instance in the sameVPC.
Open PowerShell.
Establish a remote PowerShell session, replacing
VM_NAMEwith the name of the instance to upgrade:Enter-PSSession -ComputerNameVM_NAME -UseSSL -SessionOption (New-PsSessionOption -SkipCACheck) -Credential (Get-Credential)
When prompted for credentials, enter the username and password of anadministrative user account.
Use the remote PowerShell session to check theWindows Setup log files and theevent log.
Analyze log files offline
If you can't connect to the instance by using Windows Remote Management (WinRM),you can cancel the upgrade and analyze the log files from a different VMinstance. To do this, follow these steps:
This can take several minutes if Windows Server is unresponsive.
Detach the boot disk from the instance.
Create a new, temporary Windows Server instance, and attach the boot disk ofthe original instance as an additional disk.
Use the temporary Windows Server instance to analyze thesetup log and event log files of the instance that you were trying to upgrade.
After you have completed the analysis, detach the disk from the temporaryinstance andreattach it as a boot disk to the original VM instance.
Troubleshoot RDP
For information about troubleshooting RDP, seeTroubleshooting RDP.
Troubleshoot your Windows Server instances
For information about troubleshooting your Windows Server instances, seeTips and troubleshooting for Windows instances.
Clean up
To avoid incurring further costs after you have completed this process, deletethe installation disk.
Delete the installation disk
You can create an installation disk based on the Google-provided image at anytime. If you don't plan to upgrade more VM instances in the same zone, deletethe installation disk:
In Cloud Shell, delete the
win-installersdisk that you createdearlier:gcloud compute disks delete win-installers
What's next
Learn how tobring existing licenses to Compute Engine.
Learn how toconnect to Windows instances.
Learn aboutsole-tenant nodes on Compute Engine.
Work through moreWindows tutorials.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.