Get the UUID of a VM

Linux Windows

This document shows you how to get the universally unique identifier (UUID) of avirtual machine (VM) instance by using a tool that is specific to the VM'soperating system.

Each VM has a UUID that has the following properties:

  • It is unique among Compute Engine VMs.

  • It is generated from the VM's project ID, zone, and name.

  • It is stable for the lifetime of the VM. If the VM is deleted andrecreated in the same project, zone, and with the same name, the VM receivesthe same UUID.

UUIDs are only available for VMs created on or after October 30, 2014. If youhave a VM created before that date, recreate the VM so Compute Enginecan assign it a UUID.

Use operating system tools to get the UUID of a VM

To get the UUID of a VM, run the command that corresponds to the VM'soperating system:

Linux

  1. From the Linux VM, run the followingdmidecode command:

    sudo dmidecode -t system | grep UUID
  2. Verify a response similar to the following:

    UUID: 3748eb17-a207-5bc3-aa4f-3113a1b9409d

Windows (Cmd.exe)

  1. From the Command Prompt on the Windows VM, run the followingwmic command:

    wmic path win32_computersystemproduct get uuid
  2. Verify a response similar to the following:

    UUID81CBB42C-73A0-9660-6C7D-2FE94627F3A3

Windows (PowerShell)

  1. From PowerShell, run the followingWindows Management Instrumentation (WMI) command:

    (Get-WmiObject -Class Win32_ComputerSystemProduct).UUID
  2. Verify a response similar to the following:

    81CBB42C-73A0-9660-6C7D-2FE94627F3A3

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.