Stay organized with collections
Save and categorize content based on your preferences.
Linux
Windows
This document shows you how to get the universally unique identifier (UUID) of a
virtual machine (VM) instance by using a tool that is specific to the VM's
operating 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 and
recreated in the same project, zone, and with the same name, the VM receives
the same UUID.
UUIDs are only available for VMs created on or after October 30, 2014. If you
have a VM created before that date, recreate the VM so Compute Engine
can 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's
operating system:
Linux
From the Linux VM, run the following
dmidecode command:
sudo dmidecode -t system | grep UUID
Verify a response similar to the following:
UUID: 3748eb17-a207-5bc3-aa4f-3113a1b9409d
Windows (Cmd.exe)
From the Command Prompt on the Windows VM, run the following
wmic command:
[[["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-03-05 UTC."],[[["This guide provides instructions on how to retrieve the Universally Unique Identifier (UUID) of a virtual machine (VM) instance using operating system-specific tools."],["Each Compute Engine VM has a unique and stable UUID, which is generated from the VM's project ID, zone, and name, and remains consistent throughout the VM's lifetime."],["For Linux VMs, you can use the `dmidecode` command to obtain the UUID, while for Windows VMs, you can use either the `wmic` command in the Command Prompt or a Windows Management Instrumentation (WMI) command in PowerShell."],["VMs created before October 30, 2014, do not have UUIDs and will require recreation to be assigned one."]]],[]]