Troubleshooting Windows VMs

Windows

This document describes the methods and tools available to resolve thefollowing Compute Engine Windows virtual machine (VM) instanceboot issues:

  • You can't connect to the VM using RDP, andtroubleshooting isunsuccessful in resolving your connection.

  • The login screen has not appeared in aVMscreenshot,and the VM does not appear to be making progress or performing an update.

  • You have encountered a blue screen error, frozen or erratically behaving VMunder normal operation.

If you are experiencing issues connecting to Windows VMs, seeTroubleshootingRDP.

For issues related to migrating to a third generation VM, see WindowsKnown issues.

Before you begin

Using the Advanced Boot Options menu

If Windows doesn't start correctly, use the Advanced Boot Options menu to accesssafe mode or complete an online repair of the operating system. For moreinformation, seeAdvanced startupoptions.

To enter the Advanced Boot Options menu on your Windows VM, complete thefollowing procedure:

  1. Enable adisplay devicefor the VM if you haven't already.
  2. Connect to the VM's interactive serialconsole.

  3. Reset the VM by using one of the following methods:

    Console

    1. In the Google Cloud console, go to theVM instances page.

      Go to VM instances

    2. Click the name of the VM you want to reset. The VM instance detailspage opens.

    3. Click theReset button to reboot the VM.

    gcloud

    Use thegcloud compute instances resetcommand to reset the VM:

    gcloud compute instances resetVM_NAME --zone=ZONE --project=PROJECT_ID

    Replace the following:

    • PROJECT_ID: the ID of the project thatcontains the VM
    • ZONE: the name of the zone in which theVM is located
    • VM_NAME: the name of the VM

    Command Prompt

    While connected to the interactive serial console,open a Command Prompt session and run the following command. For moreinformation about opening a Command Prompt session, seeOpening CommandPrompt in WindowsSAC.

    shutdown /r /t 0

    The Windows Boot Manager menu opens:

    Windows Boot Manager menu

  4. Before the countdown expires, complete these steps:

    1. Ensure the interactive serial console is your active window.

    2. Press theEsc key on your keyboard.

    3. Press the number8 key on your keyboard.

    The Advanced Boot Options menu opens:

    Advanced Boot Optionsmenu

  5. Use the arrow keys on your keyboard to select an option, then open it bypressing theEnter key.

Note: If you are unable to see the Windows Boot Manager and need to enter theAdvanced Boot Options menu, you will need toenable the Windows Boot Managermenu.

Enabling the Windows Boot Manager menu

You can configure the Windows Boot Manager menu to display when a Windows VMinstance is being rebooted. To enable the Windows boot manager menu, do thefollowing:

Note: If you need to enable the Windows Boot Menu to perform a operating systemrepair and are unable to login to the VM, you might need to complete anoffline repair instead.

Connect to the VM andopen a Command Prompt withadministrativeaccess. If you cannot connect to the VM, add the subsequent steps as values to awindows-startup-script-cmd orwindows-startup-script-ps1startup script instead of running them directly

Command Prompt

  1. To enable the Windows Boot Manager menu at startup and add a 15 secondtimeout, run the following commands:

    bcdedit /set {bootmgr} displaybootmenu yes
    bcdedit /set {bootmgr} timeout 15
  2. To reboot the VM and display the Windows boot manager menu in the serialconsole using the following command:

    shutdown -r -t 0

PowerShell

  1. To enable the Windows Boot Manager menu at startup and add a 15 secondtimeout, run the following commands:

    bcdedit /set '{bootmgr}' displaybootmenu yes
    bcdedit /set '{bootmgr}' timeout 15
  2. To reboot the VM and display the Windows boot manager menu in the serialconsole using the following command:

    shutdown -r -t 0

Completing an offline repair

If your VM doesn't start correctly and using the advanced boot menu has failedto resolve the issue, try performing an offline repair using a functionalWindows VM instance for recovery with a snapshot of the troubled VM's boot disk.Using a snapshot gives you a backup copy that can be modified without changingthe state of the original VM.

  1. Create a snapshot of the troubledVM's boot disk.

  2. Create adiskusing that snapshot.

  3. Create a VM with an additional non-bootdisk,using the newly created disk. Your recovery VM should meet these criteria:

    • The recovery VM must be in the same zone as the disk that was created.
    • The recovery VM should also be using aWindows Serverimage.
    • Thesource image of the recoveryVM's boot disk should be different to the source image of troubled VM'sboot disk.
    Caution: Ensure that theboot diskimage of the recovery VM differsfrom the boot disk that is being repaired; failure to do so may result induplicate disk or partition GUID and unpredictable results asconfirmed byMicrosoft.
  4. You can now use Windows tools and utilities to attempt an offline repair ofthe additional attached disk. Refer to the following documentation fordetails about completing an offline repair of your VM:

  5. If the offline repair has completed successfully,update the bootdiskof the troubled VM to be the newly repaired boot disk.

  6. Optional: Delete the additional resources after you no longer need them:

Troubleshooting blue screen errors

The Windows operating system may experience a stop code or blue screen error,also know as a Blue Screen of Death. If a VM experiences a blue screen error,the VM stops running and needs to perform a restart before resuming normaloperations.

If you believe a blue screen error may have occurred, confirm this byidentifying presence of errors using one or more of the following methods:

Serial port 1

Note: Google providedWindows public images version20191112 and later contain thegoogle-compute-engine-driver-pvpanic driverwhich automatically sends kernel panic information to the serial port. If itis not installed on your instance,install thedriver.
  1. In the Google Cloud console, go to theVM instances page.

    Go to VM instances

  2. Click the name of the VM you want to view logs for. The VM instancedetails page opens.

  3. UnderLogs, clickSerial port 1.

  4. A stack trace dump similar to the following confirms a blue screen error:

    ntoskrnl.exe [0xFFFFF802C9606000, 0xFFFFF802C9E23000]netbios.sys [0xFFFFF80E98430000, 0xFFFFF80E98442000]volmgr.sys [0xFFFFF80E97E40000, 0xFFFFF80E97E58000]NTFS.sys [0xFFFFF80E98060000, 0xFFFFF80E98293000]crashdmp.sys [0xFFFFF80E986C0000, 0xFFFFF80E986D9000]pvpanic.sys [0xFFFFF80E99030000, 0xFFFFF80E9903C000]myfault.sys [0xFFFFF80E9A570000, 0xFFFFF80E9A578000]Dumping stack trace:0xFFFFF80E990317C7 (pvpanic.sys+0x17C7)0xFFFFF80E990316D3 (pvpanic.sys+0x16D3)0xFFFFF802C97D9681 (ntoskrnl.exe+0x1D3681)0xFFFFF802C97D8A1F (ntoskrnl.exe+0x1D2A1F)0xFFFFF802C97633F4 (ntoskrnl.exe+0x15D3F4)0xFFFFF802C9773329 (ntoskrnl.exe+0x16D329)0xFFFFF802C976F152 (ntoskrnl.exe+0x169152)0xFFFFF80E9A572794 (myfault.sys+0x2794)Current Process: notmyfault64.e
Note: Serial logs are kept as long as the instance is in theRUNNINGlife cycle state, unless youhave serial logging enable. For more information, seeViewing serial portoutput.

Serial port 2

Note: Google providedWindows public images version20191112 and later contain thegoogle-compute-engine-driver-pvpanic driverwhich automatically sends kernel panic information to the serial port. If itis not installed on your instance,install thedriver.
  1. In the Google Cloud console, go to theVM instances page.

    Go to VM instances

  2. Click the name of the VM you want to view logs for. The VM instancedetails page opens.

  3. UnderLogs, expandMore, then clickSerial port 2 (console).

  4. Review the serial port of the instance, and look for this output similarto the following:

    !SAC>Your PC ran into a problem and needs to restart.If you call a support person, give them this info:UNEXPECTED_KERNEL_MODE_TRAPmyfault.sys0x00000000000000080xFFFFC6812AB94F700xFFFFC6812E38EFF00xFFFFF80E9A572794We're just collecting some error info, and then we'll restart for you.100% complete
Note: Serial logs are kept as long as the instance is in theRUNNINGlife cycle state, unless youhave serial logging enable. For more information, seeViewing serial portoutput.

Command Prompt

  1. Connect to the instanceand open a Command Prompt withadministrativeaccess.

  2. To display the most recent blue screen event, run the following command:

    wevtutil qe System "/q:*[System [(EventID=1001)]]" /rd:True /c:1 /f:Text
  3. Review the output, which looks similar to the following:

    Event[0]:  Log Name: System  Source: Microsoft-Windows-WER-SystemErrorReporting  Date: 2021-04-14T08:53:52.933  Event ID: 1001  Task: N/A  Level: Error  Opcode: N/A  Keyword: Classic  User: N/A  User Name: N/A  Computer: WINDOWS  Description:The computer has rebooted from a bugcheck.  The bugcheck was: 0x1000007f (0x0000000000000008, 0xffffc6812ab94f70, 0xffffc6812e38eff0, 0xfffff80e9a572794). A dump was saved in: C:\Windows\Minidump\041421-12656-01.dmp. Report Id:a5710c98-a577-4b3e-a3c9-2fc0aa4e5d83.

For information about customizingwetutil queries, seewevtutil.

Disk Snapshot

If the VM is no longer operational, or the other methods have provenunsuccessful. You can inspect the boot disk of the suspected blue screen VMwith a secondary VM. Using a snapshot gives you a backup copy that can bemodified without changing the state of the original VM.

  1. Create a snapshot of thesuspected blue screen VM's boot disk.

  2. Create adiskusing that snapshot.

  3. Create a VM with an additional non-bootdisk, using the newly created disk of the suspected VM. Your recovery VM shouldmeet these criteria:

    • The recovery VM must be in the same zone as the disk that was created.
    • The recovery VM should also be using aWindows Serverimage.
    • Thesource image of therecovery VM's boot disk should be different to the source image oftroubled VM's boot disk.
    Caution: Ensure that theboot diskimage of the recovery VM differsfrom the boot disk that is being repaired; failure to do so mayresult in duplicate disk or partition GUID and unpredictable results asconfirmed byMicrosoft.
  4. Browse the additional disk and locate for the following files:

    %SystemRoot%\Memory.dmp%SystemRoot%\Minidump\DATE-TIME-NUM.dmp

    The date and time of the file can help you correlate if the suspectedinstance experienced a blue screen error. These files can also be used foranalysis and diagnosis.

  5. Optional: Delete the additional resources after you no longer need them:

After you obtain the blue screen error information and optionally obtainedaccess to the memory dump file, follow the diagnostic steps and recommendationsas provided by Microsoft:

Licensing issues

Windows operating systems renew their licenses every seven days by connecting totheKey Management Service (KMS) server. If you receive messagesabout license expiration or any other issues related to licenses on your WindowsVMs, do the following:

  1. Confirm that your Windows VM's VPC network is configured toallowcommunication withKMS.

  2. Confirm that the Windows Firewall permits outbound connections to the KMSserver:

    • IP address:35.190.247.13
    • Port:1688
    • Protocol:TCP

    For more information about configuring Windows Advanced Firewall rules, seeCreate an Outbound PortRule.

  3. Check that the connection to the KMS server is successful by running the followingcommand in Cloud Shell:

    gcloud network-management connectivity-tests create test-access-to-gcp-kms \    --source-ip-address=WINDOWS_VM_IP_ADDRESS \    --destination-ip-address=35.190.247.13 \    --destination-port=1688 \    --protocol=TCP

    As shown in the following image, you should seeNext hop: Internet gateway listed in theStatic route field of theConnectivity Test result card. If you see a different result, then the Windows activation will fail.KMS Connectivity Test result.. The result should show a status ofReachability and aSuccessful result.

  4. Run the following commands to confirm the current state of your license, setthe server IP address of the KMS and force an activation:

    cscript \windows\system32\slmgr.vbs /dlv
    cscript \windows\system32\slmgr.vbs /skms 35.190.247.13:1688
    cscript \windows\system32\slmgr.vbs /ato

Troubleshooting Interactive Serial Console

  1. Ensure that you meet theprerequsiste to access serial console.

  2. EnableEmergency Management Services.If EMS is turned off, the serial console won't take any keyboardinputs but present only a blank screen with a blinking cursor.

    Command Prompt

    1. Connect to the VM using RDPand openCommand Prompt as an Administrator. If you cannot RDP, add thesubsequent steps as values to thewindows-startup-script-cmdstartup key.

    2. Set the global EMS redirection settings to use COM2, a baud rate of115200, and enable EMS.

      bcdedit /emssettings EMSPORT:2 EMSBAUDRATE:115200bcdedit /ems on
    3. Reboot the VM to apply the updated configuration. If you're using ametadata script don't add the shutdown command.

      shutdown -r -t 0

    PowerShell

    1. Connect through RDPand openPowershell as Administrator. If you cannot RDP, add thesubsequent steps as values to thewindows-startup-script-ps1startup key.

    2. Set the global EMS redirection settings to use COM2, a baud rate of115200, and enable EMS.

      bcdedit /emssettings EMSPORT:2 EMSBAUDRATE:115200bcdedit /ems on
    3. Reboot the VM to apply the updated configuration. If you're using ametadata script don't add the shutdown command.

      shutdown -r -t 0

What's next

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 2026-02-18 UTC.