Capturing VM screenshots

Linux Windows

This page describes how to capture a screenshot from a virtual machine (VM)instance by using the VM screenshot tool.

Capturing a screenshot from a VM can help you troubleshoot a VM that is nototherwise accessible. For example, a VM might not be accessible if it is bootingor has a disk image that is corrupted.

Windows-based operating systems

VM screenshots can help to troubleshoot failed RDP connections to Windows VMs,by identifying if the instance has started successfully. For information abouttroubleshooting RDP connections, seeTroubleshootingRDP.

Privacy considerations with remote desktop clients

The VM screenshot tool uses the display adapter of the VM to capture ascreenshot of the local console session through a remote desktop client.Capturing a screenshot through the local console session might capture sensitiveinformation from the user's desktop or browser.

If you are concerned about exposing sensitive information as part of ascreenshot, configure your respective remote desktop client in the following wayso that it does not use the local console session:

Before sharing screenshots withGoogleSupport, make sure to review them forsensitive information.

Before you begin

Limitations

  • The instance must be in theRUNNINGlife cyclestate.

  • The maximum rate for capturing screenshots is 20 per second, which is theAPIrate limit.

  • You can't initiate a screenshot while one is in progress.

  • You can capture one screenshot at a time.

Capturing a screenshot from a VM

Use the following procedures to capture a screenshot from a VM.

Permissions required for this task

To perform this task, you must have the followingpermissions:

  • compute.instances.getScreenshot

Console

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

    Go to VM instances

  2. From theVM instances page, click the name of the VM instance tocapture a screenshot from.

  3. On theVM instance details page, click theScreenshot tab.

  4. ClickRefresh to generate a screenshot from the VM. If you have notenabled a virtualdisplay, theGoogle Cloud console does not show a screenshot.

gcloud

Capture a screenshot from a VM by using thegcloud computeinstances get-screenshot command:

gcloud compute instances get-screenshotVM_NAME \  --destination=JPEG_FILENAME \  --zone=ZONE

Replace the following:

  • VM_NAME: name of the VM to capture a screenshotfrom.

  • JPEG_FILENAME: optional filename of the jpeg forthe screenshot output. If you do not specify a filename, the raw jpeg datais sent to standard output (stdout).

  • ZONE: zone of the VM to capture a screenshot from.

REST

With the Compute Engine API, capture a screenshot from a VM by using theinstances.getScreenshotrequest:

GET https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/ZONE/instances/VM_NAME/screenshot

Replace the following:

  • PROJECT: ID of the project containing the VM tocapture a screenshot from.

  • ZONE: zone containing the project.

  • VM_NAME: name of the VM to capture a screenshotfrom.

Example VM screenshots

The Compute Engine UEFI loading the boot manager

The following screenshot shows aWindowsServer VM that is unavailablewhile the boot manager is loading:

The UEFI loading the boot manager

Windows Server 2016 Datacenter performing updates

The following screenshot shows aWindows Server2016 VM that is unavailablewhile completing updates:

Windows Server 2016 Datacenter performing updates.

Windows Server 2016 loading system services

The following screenshot shows aWindows Server2016 VM that is unavailablewhile loading system services:

Windows Server 2016 loading system services.

Login screen for Windows Server 2016 Datacenter

The following screenshot shows aWindows Server2016 VM that has completedstartup and is ready to login:

Login screen for Windows Server 2016 Datacenter.

Sysprep process of Windows Server 2019 Core

The following screenshot shows thesysprepprocessof aWindows Server 2019Core VM instance:

Sysprep process for Windows Server 2019 Core.

Blue screen error from Windows Server 2016 Datacenter

The following screenshot shows a blue screen error from aWindows Server2016 Datacenter VM instance:

Blue screen from Windows Server 2016 Datacenter.

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 2025-12-15 UTC.