<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtualMachineDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(pl)VZVirtualMachineDelegate"
  },
  "title" : "VZVirtualMachineDelegate"
}
-->

# VZVirtualMachineDelegate

The methods you use to respond to changes in the state of the VM.

```
protocol VZVirtualMachineDelegate : NSObjectProtocol
```

## Topics

### Stopping the VM

[`guestDidStop(_:)`](/documentation/Virtualization/VZVirtualMachineDelegate/guestDidStop(_:))

Tells the delegate that the guest operating system stopped the VM.

[`virtualMachine(_:didStopWithError:)`](/documentation/Virtualization/VZVirtualMachineDelegate/virtualMachine(_:didStopWithError:))

Tells the delegate that the VM stopped because of an error.

### Responding to network device errors

[`virtualMachine(_:networkDevice:attachmentWasDisconnectedWithError:)`](/documentation/Virtualization/VZVirtualMachineDelegate/virtualMachine(_:networkDevice:attachmentWasDisconnectedWithError:))

The method the framework calls when an error causes a VM’s network attachment to disconnect.



---

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)