[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73301":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":13,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},73301,"hyperlight","hyperlight-dev\u002Fhyperlight","hyperlight-dev","Hyperlight is a lightweight Virtual Machine Manager (VMM) designed to be embedded within applications. It enables safe execution of untrusted code within micro virtual machines with very low latency and minimal overhead.","",null,"Rust",4433,186,34,161,0,99,148,297,28.82,"Apache License 2.0",false,"main",[],"2026-06-12 02:03:11","\u003Cdiv align=\"center\">\n    \u003Ch1>Hyperlight\u003C\u002Fh1>\n    \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fhyperlight-dev\u002Fhyperlight\u002Frefs\u002Fheads\u002Fmain\u002Fdocs\u002Fassets\u002Fhyperlight-logo.png\" width=\"150px\" alt=\"hyperlight logo\"\u002F>\n    \u003Cp>\u003Cstrong>Hyperlight is a lightweight Virtual Machine Manager (VMM) designed to be embedded within applications. It enables safe execution of untrusted code within \u003Ci>micro virtual machines\u003C\u002Fi> with very low latency and minimal overhead.\u003C\u002Fstrong> \u003Cbr> We are a \u003Ca href=\"https:\u002F\u002Fcncf.io\u002F\">Cloud Native Computing Foundation\u003C\u002Fa> sandbox project. \u003C\u002Fp>\n\u003C\u002Fdiv>\n\n> Note: Hyperlight is a nascent project with an evolving API and no guaranteed support. Assistance is provided on a\n> best-effort basis by the developers.\n\n---\n\n## Overview\n\nHyperlight is a library for creating _micro virtual machines_  — or _sandboxes_ — specifically optimized for securely\nrunning untrusted code with minimal impact. It supports both Windows and Linux,\nutilizing [Windows Hypervisor Platform](https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fvirtualization\u002Fapi\u002F#windows-hypervisor-platform)\non Windows, and either Microsoft Hypervisor (mshv) or [KVM](https:\u002F\u002Flinux-kvm.org\u002Fpage\u002FMain_Page) on Linux.\n\nThese micro VMs operate without a kernel or operating system, keeping overhead low. Instead, guests are built\nspecifically for Hyperlight using the Hyperlight Guest library, which provides a controlled set of APIs that facilitate\ninteraction between host and guest:\n\n- The host can call functions implemented and exposed by the guest (known as _guest functions_).\n- Once running, the guest can call functions implemented and exposed by the host (known as _host functions_).\n\nBy default, Hyperlight restricts guest access to a minimal API. The only _host function_ available by default allows the\nguest to print messages, which are displayed on the host console or redirected to stdout, as configured. Hosts can\nchoose to expose additional host functions, expanding the guest’s capabilities as needed.\n\nBelow is an example demonstrating the use of the Hyperlight host library in Rust to execute a simple guest application.\nIt is followed by an example of a simple guest application using the Hyperlight guest library, also written in Rust.\n\n### Host\n\n```rust\nuse std::thread;\n\nuse hyperlight_host::{MultiUseSandbox, UninitializedSandbox};\n\nfn main() -> hyperlight_host::Result\u003C()> {\n    \u002F\u002F Create an uninitialized sandbox with a guest binary\n    let mut uninitialized_sandbox = UninitializedSandbox::new(\n        hyperlight_host::GuestBinary::FilePath(\"path\u002Fto\u002Fyour\u002Fguest\u002Fbinary\".to_string()),\n        None \u002F\u002F default configuration\n    )?;\n\n    \u002F\u002F Registering a host function makes it available to be called by the guest\n    uninitialized_sandbox.register(\"Sleep5Secs\", || {\n        thread::sleep(std::time::Duration::from_secs(5));\n        Ok(())\n    })?;\n    \u002F\u002F Note: This function is unused by the guest code below, it's just here for demonstration purposes\n\n    \u002F\u002F Initialize sandbox to be able to call host functions\n    let mut multi_use_sandbox: MultiUseSandbox = uninitialized_sandbox.evolve()?;\n\n    \u002F\u002F Call a function in the guest\n    let message = \"Hello, World! I am executing inside of a VM :)\\n\".to_string();\n    \u002F\u002F in order to call a function it first must be defined in the guest and exposed so that\n    \u002F\u002F the host can call it\n    multi_use_sandbox.call::\u003Ci32>(\n        \"PrintOutput\",\n        message,\n    )?;\n\n    Ok(())\n}\n```\n\n### Guest\n\nFirst, create a `Cargo.toml` with the required dependencies:\n\n```toml\n[package]\nname = \"my-hyperlight-guest\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[dependencies]\nhyperlight-guest = \"0.12\"\nhyperlight-guest-bin = \"0.12\"\nhyperlight-common = { version = \"0.12\", default-features = false }\n```\n\n> **Important:** The `hyperlight-common` crate must have `default-features = false` to avoid pulling in\n> the standard library, which conflicts with the `no_std` requirement for guests.\n\nThen, create `src\u002Fmain.rs`:\n\n```rust\n#![no_std]\n#![no_main]\nextern crate alloc;\nextern crate hyperlight_guest_bin;\n\nuse alloc::vec::Vec;\nuse alloc::string::String;\nuse hyperlight_common::flatbuffer_wrappers::function_call::FunctionCall;\nuse hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode;\n\nuse hyperlight_guest::bail;\nuse hyperlight_guest::error::Result;\nuse hyperlight_guest_bin::{guest_function, host_function};\n\n#[host_function(\"HostPrint\")]\nfn host_print(message: String) -> Result\u003Ci32>;\n\n#[guest_function(\"PrintOutput\")]\nfn print_output(message: String) -> Result\u003Ci32> {\n    let result = host_print(message)?;\n    Ok(result)\n}\n\n#[no_mangle]\npub extern \"C\" fn hyperlight_main() {\n    \u002F\u002F any initialization code goes here\n}\n\n#[no_mangle]\npub fn guest_dispatch_function(function_call: FunctionCall) -> Result\u003CVec\u003Cu8>> {\n    let function_name = function_call.function_name;\n    bail!(ErrorCode::GuestFunctionNotFound => \"{function_name}\");\n}\n```\n\nBuild the guest using [cargo-hyperlight](https:\u002F\u002Fgithub.com\u002Fhyperlight-dev\u002Fcargo-hyperlight):\n\n```sh\ncargo install --locked cargo-hyperlight\ncargo hyperlight build\n```\n\n> **Note:** You must use `cargo hyperlight build` instead of the regular `cargo build` command.\n> The `cargo-hyperlight` tool sets up the required custom target, sysroot, and compiler flags\n> that are necessary for building Hyperlight guests.\n\nFor additional examples of using the Hyperlight host Rust library, see\nthe [.\u002Fsrc\u002Fhyperlight_host\u002Fexamples](.\u002Fsrc\u002Fhyperlight_host\u002Fexamples) directory.\n\nFor examples of guest applications, see the [.\u002Fsrc\u002Ftests\u002Fc_guests](.\u002Fsrc\u002Ftests\u002Fc_guests) directory for C guests and\nthe [.\u002Fsrc\u002Ftests\u002Frust_guests](.\u002Fsrc\u002Ftests\u002Frust_guests) directory for Rust guests.\n\n> Note: Hyperlight guests can be written using the Hyperlight Rust or C Guest libraries.\n\n## Repository Structure\n\n- Hyperlight Host Libraries (i.e., the ones that create and manage the VMs)\n    - [src\u002Fhyperlight_host](.\u002Fsrc\u002Fhyperlight_host) - This is the Rust Hyperlight host library.\n\n- Hyperlight Guest Libraries (i.e., the ones to make it easier to create guests that run inside the VMs)\n    - [src\u002Fhyperlight_guest](.\u002Fsrc\u002Fhyperlight_guest) - The core Rust library for Hyperlight guests. It provides only the essential building blocks for interacting with the host environment, including the VM exit mechanism (`outb`), abstractions for calling host functions and receiving return values, and the input\u002Foutput stacks used for guest-host communication.\n    - [src\u002Fhyperlight_guest_bin](.\u002Fsrc\u002Fhyperlight_guest_bin\u002F) - An extension to the core Rust library for Hyperlight guests. It contains more opinionated components (e.g., panic handler, heap initialization, musl-specific imports, logging, and exception handling).\n    - [src\u002Fhyperlight_guest_capi](.\u002Fsrc\u002Fhyperlight_guest_capi) - A C-compatible wrapper around `hyperlight_guest_bin`, exposing its core functionality for use in C programs and other languages via FFI.\n\n- Hyperlight Common (functionality used by both the host and the guest)\n    - [src\u002Fhyperlight_common](.\u002Fsrc\u002Fhyperlight_common)\n\n- Test Guest Applications:\n    - [src\u002Ftests\u002Frust_guests](.\u002Fsrc\u002Ftests\u002Frust_guests) - This directory contains three Hyperlight Guest programs written\n      in Rust, which are intended to be launched within partitions as \"guests\".\n    - [src\u002Ftests\u002Fc_guests](.\u002Fsrc\u002Ftests\u002Fc_guests) - This directory contains two Hyperlight Guest programs written in C,\n      which are intended to be launched within partitions as \"guests\".\n\n- Tests:\n    - [src\u002Fhyperlight-testing](.\u002Fsrc\u002Fhyperlight_testing) - Shared testing code for Hyperlight projects built in Rust.\n\n## Try it yourself!\n\nYou can run Hyperlight on:\n\n- [Linux with KVM][kvm].\n- [Windows with Windows Hypervisor Platform (WHP).][whp] -  Note that you need Windows 11 \u002F Windows Server 2022 or later to use hyperlight, if you are running on earlier versions of Windows then you should consider using our devcontainer on [GitHub codespaces]((https:\u002F\u002Fcodespaces.new\u002Fhyperlight-dev\u002Fhyperlight)) or WSL2.\n- Windows Subsystem for Linux 2 (see instructions [here](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall) for Windows client and [here](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall-on-server) for Windows Server) with KVM.\n- Azure Linux with mshv (note that you need mshv to be installed to use Hyperlight)\n\nAfter having an environment with a hypervisor setup, running the example has the following pre-requisites:\n\n1. On Linux or WSL, you'll most likely need build essential. For Ubuntu, run `sudo apt install build-essential`. For\n   Azure Linux, run `sudo dnf install build-essential`.\n2. [Rust](https:\u002F\u002Fwww.rust-lang.org\u002Ftools\u002Finstall). Install toolchain v1.89 or later.\n3. [just](https:\u002F\u002Fgithub.com\u002Fcasey\u002Fjust). `cargo install just` On Windows you also need [pwsh](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fpowershell\u002Fscripting\u002Finstall\u002Finstalling-powershell-on-windows?view=powershell-7.4).\n4. [clang and LLVM](https:\u002F\u002Fclang.llvm.org\u002Fget_started.html).\n    - On Ubuntu, run:\n\n        ```sh\n        wget https:\u002F\u002Fapt.llvm.org\u002Fllvm.sh\n        chmod +x .\u002Fllvm.sh\n        sudo .\u002Fllvm.sh 18 clang clang-tools-extra\n        sudo ln -s \u002Fusr\u002Flib\u002Fllvm-18\u002Fbin\u002Fld.lld \u002Fusr\u002Fbin\u002Fld.lld\n        sudo ln -s \u002Fusr\u002Flib\u002Fllvm-18\u002Fbin\u002Fclang \u002Fusr\u002Fbin\u002Fclang\n        ```\n\n    - On Windows, see [this](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fcpp\u002Fbuild\u002Fclang-support-msbuild?view=msvc-170).\n\n    - On Azure Linux, run:\n\n        ```sh\n        if ! command -v clang > \u002Fdev\u002Fnull 2>&1; then\n            sudo dnf install clang -y\n            sudo dnf install clang-tools-extra -y\n        fi\n        ```\n\nThen, we are ready to build and run the example:\n\n```sh\njust build  # build the Hyperlight library\njust rg     # build the rust test guest binaries\ncargo run --example hello-world\n```\n\nIf all worked as expected, you should see the following message in your console:\n\n```text\nHello, World! I am executing inside of a VM :)\n```\n\nIf you get the error `Error: NoHypervisorFound` and KVM or mshv is set up then this may be a permissions issue. In bash,\nyou can use `ls -l \u002Fdev\u002Fkvm` or  `ls -l \u002Fdev\u002Fmshv` to check which group owns that device and then `groups` to make sure\nyour user is a member of that group.\n\nFor more details on how to verify that KVM is correctly installed and permissions are correct, follow the\nguide [here](https:\u002F\u002Fhelp.ubuntu.com\u002Fcommunity\u002FKVM\u002FInstallation).\n\nFor additional debugging tips, including common build and runtime issues, see the [How to build a Hyperlight guest binary](.\u002Fdocs\u002Fhow-to-build-a-hyperlight-guest-binary.md) guide.\n\n### Or you can use a codespace\n\n[![Open in GitHub Codespaces](https:\u002F\u002Fgithub.com\u002Fcodespaces\u002Fbadge.svg)](https:\u002F\u002Fcodespaces.new\u002Fhyperlight-dev\u002Fhyperlight)\n\n## Contributing to Hyperlight\n\nIf you are interested in contributing to Hyperlight, running the entire test-suite is a good way to get started. To do\nso, on your console, run the following commands:\n\n```sh\njust guests  # build the c and rust test guests\njust build  # build the Hyperlight library\njust test # runs the tests\n```\n\nAlso , please review the [CONTRIBUTING.md](.\u002FCONTRIBUTING.md) file for more information on how to contribute to\nHyperlight.\n\n> Note: For general Hyperlight development, you may also need flatc (Flatbuffer compiler): for instructions,\n> see [here](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fflatbuffers).\n> Copyright © contributors to Hyperlight, established as Hyperlight a Series of LF Projects, LLC.\n\n## Join our Community Meetings\n\nThis project holds fortnightly community meetings to discuss the project's progress, roadmap, and any other topics of interest. The meetings are open to everyone, and we encourage you to join us.\n\n- **When**: Every other Wednesday 09:00 (PST\u002FPDT) [Convert to your local time](https:\u002F\u002Fdateful.com\u002Fconvert\u002Fpst-pdt-pacific-time?t=09)\n- **Where**: Zoom! - Agenda and information on how to join can be found in the [Hyperlight Community Meeting Notes](https:\u002F\u002Fhackmd.io\u002FblCrncfOSEuqSbRVT9KYkg#Agenda). Please log into hackmd to edit!\n\n## Chat with us on the CNCF Slack\n\nThe Hyperlight project Slack is hosted in the CNCF Slack #hyperlight. To join the Slack, [join the CNCF Slack](https:\u002F\u002Fwww.cncf.io\u002Fmembership-faq\u002F#how-do-i-join-cncfs-slack), and join the #hyperlight channel.\n\n## More Information\n\nFor more information, please refer to our compilation of documents in the [`docs\u002F` directory](.\u002Fdocs\u002FREADME.md).\n\n## Code of Conduct\n\nSee the [CNCF Code of Conduct](https:\u002F\u002Fgithub.com\u002Fcncf\u002Ffoundation\u002Fblob\u002Fmain\u002Fcode-of-conduct.md).\n\n[wsl2]: https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall\n\n[kvm]: https:\u002F\u002Fhelp.ubuntu.com\u002Fcommunity\u002FKVM\u002FInstallation\n\n[whp]: https:\u002F\u002Fdevblogs.microsoft.com\u002Fvisualstudio\u002Fhyper-v-android-emulator-support\u002F#1-enable-hyper-v-and-the-windows-hypervisor-platform\n\n\n## FOSSA Status\n[![FOSSA Status](https:\u002F\u002Fapp.fossa.com\u002Fapi\u002Fprojects\u002Fgit%2Bgithub.com%2Fhyperlight-dev%2Fhyperlight.svg?type=large)](https:\u002F\u002Fapp.fossa.com\u002Fprojects\u002Fgit%2Bgithub.com%2Fhyperlight-dev%2Fhyperlight?ref=badge_large)\n","Hyperlight 是一个轻量级虚拟机管理器（VMM），专为嵌入应用程序而设计，旨在通过微虚拟机以极低延迟和最小开销安全地执行不可信代码。其核心功能包括支持在Windows和Linux平台上创建微虚拟机，这些虚拟机无需内核或操作系统即可运行，从而保持了较低的资源消耗。Hyperlight使用Rust语言编写，利用了Windows Hypervisor Platform（针对Windows）以及Microsoft Hypervisor (mshv) 或 KVM（针对Linux）。它提供了一套控制良好的API，允许主机与客体之间进行函数调用，同时默认限制了客体对主机功能的访问权限，增强了安全性。此项目非常适合需要在隔离环境中快速、安全地运行第三方代码的应用场景，如云原生服务、在线编程环境等。",2,"2026-06-11 03:44:54","high_star"]