Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Linux
Windows
Debes crear una instancia de máquina virtual (VM) a partir de una imagen de SO o una de disco. En este documento, se muestra cómo determinar la imagen del SO de origen o la imagen del disco de origen de una VM.
Antes de comenzar
Si aún no lo hiciste, configura la autenticación.
La autenticación es el proceso mediante el cual se verifica tu identidad para acceder a los servicios y las APIs de Google Cloud .
Para ejecutar código o muestras desde un entorno de desarrollo local, puedes autenticarte en Compute Engine seleccionando una de las siguientes opciones:
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
Instala Google Cloud CLI.
Después de la instalación,
inicializa Google Cloud CLI ejecutando el siguiente comando:
DISK_NAME: Es el nombre del disco del que deseas ver la fuente
ZONE: Es la zona en la que se encuentra el disco
SOURCE: Es un valor que especifica si se debe mostrar la imagen del SO de origen o la imagen del disco de origen Se establece en sourceDisk o en sourceImage No se muestra ningún valor cuando se especifica sourceDisk o sourceImage, a menos que haya una imagen de SO de origen o una imagen de disco de origen correspondientes. Si no se muestra ningún valor, especifica el otro valor y vuelve a ejecutar el comando.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME
Reemplaza lo siguiente:
PROJECT_ID: El ID del proyecto
ZONE: la zona que contiene la VM
VM_NAME: El nombre de la VM
Visualiza la imagen del SO de origen o la imagen del disco de origen del disco con el método disks.get.
En una VM que tiene una imagen de SO de origen, este método muestra la imagen de origen que se usó para crear el disco en el campo sourceImage. En el caso de una VM que tiene una imagen de disco de origen, este método muestra la imagen de origen en el campo sourceDisk.
GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/DISK_NAME
Reemplaza lo siguiente:
PROJECT_ID: El ID del proyecto
ZONE: Es la zona que contiene el disco.
DISK_NAME: Es el nombre del disco
¿Qué sigue?
Obtén más información sobre las imágenes de SO en Compute Engine.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-18 (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."]]