<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Virtualization",
  "identifier" : "/documentation/Virtualization/VZVirtualMachine/stop(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Virtualization"
    ],
    "preciseIdentifier" : "c:objc(cs)VZVirtualMachine(im)stopWithCompletionHandler:"
  },
  "title" : "stop(completionHandler:)"
}
-->

# stop(completionHandler:)

Stops a VM that’s in either a running or paused state.

```
func stop(completionHandler: @escaping ((any Error)?) -> Void)
```

## Parameters

`completionHandler`

A block called after the VM stopped successfully, or on error. The error parameter passed to the block is `nil` if the stop was successful.

## Discussion

> Warning:
> This is a destructive operation. It stops the VM without giving the guest a chance to stop cleanly.

To determine if a VM is in a state that allows you to stop it, check the VM’s [`canStop`](/documentation/Virtualization/VZVirtualMachine/canStop) or [`canRequestStop`](/documentation/Virtualization/VZVirtualMachine/canRequestStop) properties.

---

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)