Skip to content

tpapagian/macos-hypervisor-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hv_simple

A minimal Virtual Machine Monitor (VMM) for macOS on Apple Silicon using the Hypervisor.framework. This was inspired by the Using the KVM API article, which provides a similar example for KVM on Linux.

It demonstrates how to:

  1. Initialize a Virtual Machine.
  2. Create and configure a VCPU.
  3. Map guest memory.
  4. Execute ARM64 guest code.
  5. Handle VM exits.

Prerequisites

  • An Apple Silicon Mac.
  • macOS 11.0 or later.
  • Xcode Command Line Tools installed (xcode-select --install).

Building

The binary must be signed with the com.apple.security.hypervisor entitlement to run. The provided Makefile handles the compilation and codesigning automatically.

make

Running

./hv_simple

Expected Output:

4
Guest halted.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Minimal macOS ARM64 Hypervisor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors