Stay organized with collectionsSave and categorize content based on your preferences.
LinuxWindows
You create a virtual machine (VM) instance from either anOS
imageor a disk image. This document
shows you how to determine the source OS image or source disk image of a VM.
Before you begin
If you haven't already, set upauthentication.
Authentication verifies your identity for access to Google Cloud services and APIs. To run
code or samples from a local development environment, you can authenticate to
Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Installthe Google Cloud CLI.
After installation,initializethe Google Cloud CLI by running the following command:
DISK_NAME: the name of the disk to view the
source of.
ZONE: the zone that the disk is located in.
SOURCE: a value that specifies whether to
return the source OS image or the source disk image. Set tosourceDiskor tosourceImage. No value is returned when specifyingsourceDiskorsourceImageunless there is a corresponding source OS image or a
source disk image. If no value is returned, specify the other value and
run the command again.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME
Replace the following:
PROJECT_ID: the project ID
ZONE: the zone containing the VM
VM_NAME: the name of the VM
View the source OS image or source disk image of the disk by using thedisks.getmethod.
For a VM that has a source OS image, this method returns the source image
that was used to create the disk in thesourceImagefield. For a VM
that has a source disk image, this method instead returns the source
image in thesourceDiskfield.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-02 UTC."],[[["\u003cp\u003eThis guide explains how to identify the source OS image or source disk image used to create a virtual machine (VM) instance.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the source image using the Google Cloud console, the Google Cloud CLI (gcloud), or the Compute Engine API.\u003c/p\u003e\n"],["\u003cp\u003eTo access and use the services, authentication is needed and the methods to authenticate are explained for the Google Cloud Console, the gcloud CLI, and REST.\u003c/p\u003e\n"],["\u003cp\u003eRequired permissions include \u003ccode\u003ecompute.instances.get\u003c/code\u003e on the specific VM instance.\u003c/p\u003e\n"],["\u003cp\u003eThe location of the required source image information can be found in the storage section under the boot disk in the Google Cloud Console and by using the gcloud command lines to view the disk and then its source.\u003c/p\u003e\n"]]],[],null,["# View the source image of a VM\n\nLinux Windows\n\n*** ** * ** ***\n\nYou create a virtual machine (VM) instance from either an [OS\nimage](/compute/docs/images/os-details) or a disk image. This document\nshows you how to determine the source OS image or source disk image of a VM.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nView the source OS image or source disk image of a VM\n-----------------------------------------------------\n\nTo view the source OS image or source disk image of a VM, use the\nGoogle Cloud console, Google Cloud CLI, or Compute Engine API.\n\n#### Permissions required for this task\n\nTo perform this task, you must have the following\n[permissions](/iam/docs/overview#permissions):\n\n\n- `compute.instances.get` on the instance \n\n### Console\n\n1. In the Google Cloud console, go to the **VM instances** page.\n\n [Go to VM instances](https://console.cloud.google.com/compute/instances)\n2. Click the **Name** of the VM.\n\n3. The name of the source OS image or source disk image is in\n **Storage** \\\u003e **Boot\n disk** \\\u003e **Image**.\n\n### gcloud\n\n1. View the disks attached to a VM by using the following [`gcloud compute\n instances describe`\n command](/sdk/gcloud/reference/compute/instances/describe):\n\n ```\n gcloud compute instances describe VM_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e with the name of the VM.\n2. View the source OS image or source disk image of the disk by using the\n following [`gcloud compute disks describe`\n command](/sdk/gcloud/reference/compute/disks/describe):\n\n ```\n gcloud compute disks describe DISK_NAME \\\n --zone=ZONE \\\n --format=\"get(SOURCE)\"\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e: the name of the disk to view the\n source of.\n\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone that the disk is located in.\n\n - \u003cvar translate=\"no\"\u003eSOURCE\u003c/var\u003e: a value that specifies whether to\n return the source OS image or the source disk image. Set to `sourceDisk`\n or to `sourceImage`. No value is returned when specifying `sourceDisk`\n or `sourceImage` unless there is a corresponding source OS image or a\n source disk image. If no value is returned, specify the other value and\n run the command again.\n\n### REST\n\n1. View the disks attached to a VM by using the following [`instances.get`\n method](/compute/docs/reference/rest/v1/instances/get):\n\n ```\n GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone containing the VM\n - \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM\n2. View the source OS image or source disk image of the disk by using the\n [`disks.get` method](/compute/docs/reference/rest/v1/disks/get).\n\n For a VM that has a source OS image, this method returns the source image\n that was used to create the disk in the `sourceImage` field. For a VM\n that has a source disk image, this method instead returns the source\n image in the `sourceDisk` field. \n\n ```\n GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone containing the disk\n - \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e: the name of the disk\n\nWhat's next\n-----------\n\n- Learn more about [OS images](/compute/docs/images) on Compute Engine."]]