Capturing VM screenshots


This page describes how to capture a screenshot from a VM by using the VM screenshot tool.

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

Windows-based operating systems

For Windows-based operating systems, which rely on a virtual display device to report certain errors, a screenshot can help with troubleshooting if you can't connect by using Remote Desktop Protocol (RDP).

Privacy considerations with remote desktop clients

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

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

Before sharing screenshots with Google Support, make sure to review them for sensitive information.

Before you begin

Limitations

  • The maximum rate for capturing screenshots is 20 per second, which is the API rate 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.

Console

  1. In the Google Cloud Console, go to the VM instances page.

    Go to VM instances

  2. From the VM instances page, click the name of the VM instance to capture a screenshot from.

  3. On the VM instance details page, click the Screenshot tab.

  4. Click Refresh to generate a screenshot from the VM. If you have not enabled a virtual display, the Google Cloud Console does not show a screenshot.

gcloud

Capture a screenshot from a VM by using the gcloud compute instances get-screenshot command:

gcloud compute instances get-screenshot VM_NAME \
  --destination=JPEG_FILENAME \
  --zone=ZONE

Replace the following:

  • VM_NAME: name of the VM to capture a screenshot from.

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

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

API

With the Compute Engine API, capture a screenshot from a VM by using the instances.getScreenshot request:

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 to capture a screenshot from.

  • ZONE: zone containing the project.

  • VM_NAME: name of the VM to capture a screenshot from.

Example VM screenshots

Sysprep process of Windows Server 2019 Core

The following is a screenshot captured during the sysprep process of a Windows Server 2019 Core image:

Sysprep process for Windows Server 2019 Core.

BSOD from Windows Server 2016 Datacenter

The following is a screenshot captured during a BSOD from a Windows Server 2016 Datacenter image:

BSOD from Windows Server 2016 Datacenter.

What's next