<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZMacMachineIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZMacMachineIdentifier"
  },
  "title" : "VZMacMachineIdentifier"
}
-->

# VZMacMachineIdentifier

A unique identifier for a VM.

```
class VZMacMachineIdentifier
```

## Overview

This value uniquely identifies a virtual Mac hardware instance. Two VMs running concurrently shouldn’t use the same identifier.

When serializing the VM to disk, you can preserve the identifier in a binary representation by serializing the data in the `VZMacMachineIdentifier`.[`dataRepresentation`](/documentation/Virtualization/VZMacHardwareModel/dataRepresentation) property. Conversely, you can recreate the identifier with [`init(dataRepresentation:)`](/documentation/Virtualization/VZMacMachineIdentifier/init(dataRepresentation:)) from the binary representation.

You can compare the contents of two identifiers with <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/isEqual(to:)>.

## Topics

### Creating a machine identifier

[`init(dataRepresentation:)`](/documentation/Virtualization/VZMacMachineIdentifier/init(dataRepresentation:))

Create a machine identifier described by the specified data representation.

[`init()`](/documentation/Virtualization/VZMacMachineIdentifier/init())

Creates a new unique machine identifier.

### Machine data representation

[`dataRepresentation`](/documentation/Virtualization/VZMacMachineIdentifier/dataRepresentation)

Returns the opaque data representation of the machine identifier.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)