---
title: hv_vm_destroy()
framework: hypervisor
role: symbol
role_heading: Function
path: hypervisor/hv_vm_destroy()
---

# hv_vm_destroy()

Destroys the VM instance associated with the current process.

## Declaration

```swift
func hv_vm_destroy() -> hv_return_t
```

## Return Value

Return Value HV_SUCCESS if the operation was successful, otherwise an error code specified in hv_return_t.

## See Also

### Virtual machine management

- [hv_vm_config_create()](hypervisor/hv_vm_config_create().md)
- [hv_vm_create(_:)](hypervisor/hv_vm_create(_:).md)
- [OS_hv_vm_config](hypervisor/os_hv_vm_config.md)
- [hv_vm_config_t](hypervisor/hv_vm_config_t.md)
