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

# virtualMachine(_:didStopWithError:)

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

```
optional func virtualMachine(_ virtualMachine: VZVirtualMachine, didStopWithError error: any Error)
```

## Parameters

`virtualMachine`

The VM that called the delegate method.

`error`

The error.

## Discussion

---

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)