{"id":18449723,"url":"https://github.com/cloud-hypervisor/hypervisor-framework","last_synced_at":"2025-04-08T01:33:07.228Z","repository":{"id":44746222,"uuid":"452403501","full_name":"cloud-hypervisor/hypervisor-framework","owner":"cloud-hypervisor","description":"Crates for the Mac OS Hypervisor bindings and APIs","archived":false,"fork":false,"pushed_at":"2022-01-27T10:17:45.000Z","size":50,"stargazers_count":29,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-03-15T13:09:49.444Z","etag":null,"topics":["hypervisor","hypervisor-framework","microvm","rust","rust-crate","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloud-hypervisor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-26T19:02:11.000Z","updated_at":"2024-03-01T10:27:41.000Z","dependencies_parsed_at":"2022-08-17T02:30:24.314Z","dependency_job_id":null,"html_url":"https://github.com/cloud-hypervisor/hypervisor-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Fhypervisor-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Fhypervisor-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Fhypervisor-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-hypervisor%2Fhypervisor-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud-hypervisor","download_url":"https://codeload.github.com/cloud-hypervisor/hypervisor-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247760822,"owners_count":20991531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hypervisor","hypervisor-framework","microvm","rust","rust-crate","virtualization"],"created_at":"2024-11-06T07:21:41.455Z","updated_at":"2025-04-08T01:33:06.938Z","avatar_url":"https://github.com/cloud-hypervisor.png","language":"Rust","readme":"# hv\n\n[![CI](https://github.com/cloud-hypervisor/hypervisor-framework/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/cloud-hypervisor/hypervisor-framework/actions/workflows/ci.yml)\n[![GitHub](https://img.shields.io/github/license/cloud-hypervisor/hypervisor-framework)](https://github.com/cloud-hypervisor/hypervisor-framework/blob/main/LICENSE)\n[![docs.rs](https://img.shields.io/docsrs/hv)](https://docs.rs/hv/)\n\n`hv` is a high level Rust bindings for Hypervisor Framework.\n\n[Apple Documentation](https://developer.apple.com/documentation/hypervisor)\n\nBuild virtualization solutions on top of a lightweight hypervisor using Rust:\n- Full Hypervisor Framework support.\n- Supports Apple Silicon.\n- Safe Rust API.\n\nThis repository contains the following crates:\n| Name | Description | Links |\n| --- | --- | --- |\n| [`hv-sys`](./hv-sys) | Unsafe bindings generated with bindgen | [![Crates.io](https://img.shields.io/crates/v/hv-sys)](https://crates.io/crates/hv-sys) |\n| [`hv`](./hv) | High level API to access Hypervisor Framework | [![Crates.io](https://img.shields.io/crates/v/hv)](https://crates.io/crates/hv) |\n\n### Current list of things to do:\n- Make high level API safer.\n- Expand documentation.\n- Add more examples.\n\n## Requirements\n\n### Hypervisor Framework\n\nAt runtime, determine whether the Hypervisor APIs are available on a particular machine with the `sysctl`:\n\n```bash\n$ sysctl kern.hv_support\nkern.hv_support: 1\n```\n\nIn order to use Hypervisor API your app must have `com.apple.security.hypervisor` entitlement.\nRefer to [example.entitlements](example.entitlements) for example of how entitlement file might look like.\n\nUse the following command to self sign your binary for local development:\n\n```bash\n$ codesign --sign - --force --entitlements=example.entitlements ./binary\n```\n\n### Rust\n\nDeveloped and tested on latest stable Rust (1.53.0+).\n\nBe sure to have [Xcode](https://developer.apple.com/xcode/) installed and don't forget to `xcode-select --install`,\notherwise `bindgen` may fail to find Hypervisor headers.\n\n## Example\n\nHere is basic \"Hello world\" example on Apple Silicon:\n```rust\n// Init VM\nlet vm = Arc::new(hv::Vm::new(std::ptr::null_mut())?);\n\n// Initialize guest memory\nvm.map(load_addr, GUEST_ADDR, MEM_SIZE, hv::Memory::READ)?;\n\n// Create VCPU\nlet cpu = vm.create_cpu()?;\n\n// Set regs\ncpu.set_reg(Reg::PC, GUEST_ADDR)?\ncpu.set_reg(Reg::X1, GUEST_RESULT_ADDR)?\n\nloop {\n    cpu.run().expect(\"Failed to run CPU\");\n\n    let info = cpu.exit_info();\n    println!(\"{:?}\", info);\n\n    break;\n}\n```\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-hypervisor%2Fhypervisor-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud-hypervisor%2Fhypervisor-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-hypervisor%2Fhypervisor-framework/lists"}