<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Hypervisor",
  "identifier" : "/documentation/Hypervisor",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Hypervisor"
    ],
    "preciseIdentifier" : "Hypervisor"
  },
  "title" : "Hypervisor"
}
-->

# Hypervisor

Build virtualization solutions on top of a lightweight hypervisor, without third-party kernel extensions.

## Overview

Hypervisor provides C APIs so you can interact with virtualization technologies in user space, without writing kernel extensions (KEXTs). As a result, the apps you create using this framework are suitable for distribution on the [Mac App Store](https://www.appstore.com/).

Use this framework to create and control hardware-facilitated virtual machines and virtual processors (VMs and vCPUs) from your entitled, sandboxed, user-space process. Hypervisor abstracts virtual machines as processes, and virtual processors as threads.

### Requirements

The Hypervisor framework has the following requirements:

- term Supported hardware: The Hypervisor framework requires hardware support to virtualize hardware resources. On Apple silicon, that includes the Virtualization Extensions. On Intel-based Mac computers, the framework supports machines with an Intel VT-x feature set that includes Extended Page Tables (EPT) and Unrestricted Mode.

At runtime, determine whether the Hypervisor APIs are available on a particular machine with the sysctl command, passing `kern.hv_support` as an argument.

- term Entitlements: All process must have the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.security.hypervisor> entitlement to use Hypervisor API.

### Virtual Resource Mapping

A guest is an operating system that runs on top of the virtual hardware. The operating system and processes that run the virtualized hardware are together called the host. Virtual hardware in the guest maps to specific resources on the host.

Each virtual machine corresponds to a process on the host. There can only be one virtual machine at a time per process; the virtual machine creates it with [`hv_vm_create(_:)`](/documentation/Hypervisor/hv_vm_create(_:)).

Virtual CPUs (vCPUs) in a virtual machine map to POSIX threads. Create a new vCPU for the current thread with [`hv_vcpu_create(_:_:_:)`](/documentation/Hypervisor/hv_vcpu_create(_:_:_:)). The vCPU runs when the thread calls [`hv_vcpu_run(_:)`](/documentation/Hypervisor/hv_vcpu_run(_:)).

Hypervisor maps the physical memory in the guest to virtual memory of the host process. Create a new memory mapping with [`hv_vm_map(_:_:_:_:)`](/documentation/Hypervisor/hv_vm_map(_:_:_:_:)). Access to memory outside the mapped range causes [`hv_vcpu_run(_:)`](/documentation/Hypervisor/hv_vcpu_run(_:)) to exit. Emulate memory-mapped hardware by emulating the memory access on exit and re-enter the guest with [`hv_vcpu_run(_:)`](/documentation/Hypervisor/hv_vcpu_run(_:)).

### Example VM Life Cycle

The following figure illustrates a simplified life cycle of creating and running a virtual machine with one or more virtual CPUs using the Hypervisor API.

![A flow diagram that represents the life cycle of a virtual machine.](images/com.apple.hypervisor/media-2916425@2x.png)

At the start of a task:

- Create a VM with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vm_create(_:)``.
- Map a region in the virtual address space of the current task into the guest physical address space of the VM with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vm_map(_:_:_:_:)``.
- Create one or more POSIX threads with `pthread_create(_:_:_:_:)`.

In each thread:

- Create a virtual CPU with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vcpu_create(_:_:_:)``.
- Call ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vcpu_run(_:)`` to run the vCPU.

When a thread receives an exit event:

- Handle the event.
- Re-enter the guest with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vcpu_run(_:)`` or destroy the vCPU with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vcpu_destroy(_:)``.

After all threads finish:

- Unmap the memory region with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vm_unmap(_:_:)``.
- Destroy the VM with ``doc://com.apple.hypervisor/documentation/Hypervisor/hv_vm_destroy()``.

## Topics

### Platforms

[Apple Silicon](/documentation/Hypervisor/apple-silicon)

Create and run virtual machines on Apple silicon.

[Intel-based Mac](/documentation/Hypervisor/intel-based-mac)

Create and run virtual machines on Intel-based Mac computers.

### Entitlements

  <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.security.hypervisor>

  <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.vm.hypervisor>

  <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.vm.networking>

  <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.vm.device-access>

### Reference

[Hypervisor Structures](/documentation/Hypervisor/hypervisor-structures)

[Hypervisor Constants](/documentation/Hypervisor/hypervisor-constants)

[Hypervisor Functions](/documentation/Hypervisor/hypervisor-functions)

[Hypervisor Data Types](/documentation/Hypervisor/hypervisor-data-types)



---

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)
