You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [documentation] recenter logo on README
Signed-off-by: danbugs <danilochiarlone@gmail.com>
* [documentation] reverting to "align" attribute
GitHub markdown doesn't allow using styles, so we need to rely on the obsolote attribute to center the logo
Signed-off-by: danbugs <danilochiarlone@gmail.com>
---------
Signed-off-by: danbugs <danilochiarlone@gmail.com>
<strong>Hyperlight is a lightweight Virtual Machine Manager (VMM) designed to be embedded within applications. It enables safe execution of untrusted code within <i>micro virtual machines</i> with very low latency and minimal overhead.
<p><strong>Hyperlight is a lightweight Virtual Machine Manager (VMM) designed to be embedded within applications. It enables safe execution of untrusted code within <i>micro virtual machines</i> with very low latency and minimal overhead.</strong></p>
8
5
</div>
9
6
10
-
> Note: Hyperlight is a nascent project with an evolving API and no guaranteed support. Assistance is provided on a best-effort basis by the developers.
7
+
> Note: Hyperlight is a nascent project with an evolving API and no guaranteed support. Assistance is provided on a
8
+
> best-effort basis by the developers.
11
9
12
10
---
13
11
14
12
## Overview
15
13
16
-
Hyperlight is a library for creating _micro virtual machines_ — or _sandboxes_ — specifically optimized for securely running untrusted code with minimal impact. It supports both Windows and Linux, utilizing [Windows Hypervisor Platform](https://docs.microsoft.com/en-us/virtualization/api/#windows-hypervisor-platform) on Windows, and either Microsoft Hypervisor (mshv) or [KVM](https://linux-kvm.org/page/Main_Page) on Linux.
14
+
Hyperlight is a library for creating _micro virtual machines_ — or _sandboxes_ — specifically optimized for securely
15
+
running untrusted code with minimal impact. It supports both Windows and Linux,
on Windows, and either Microsoft Hypervisor (mshv) or [KVM](https://linux-kvm.org/page/Main_Page) on Linux.
17
18
18
-
These micro VMs operate without a kernel or operating system, keeping overhead low. Instead, guests are built specifically for Hyperlight using the Hyperlight Guest library, which provides a controlled set of APIs that facilitate interaction between host and guest:
19
+
These micro VMs operate without a kernel or operating system, keeping overhead low. Instead, guests are built
20
+
specifically for Hyperlight using the Hyperlight Guest library, which provides a controlled set of APIs that facilitate
21
+
interaction between host and guest:
19
22
20
23
- The host can call functions implemented and exposed by the guest (known as _guest functions_).
21
24
- Once running, the guest can call functions implemented and exposed by the host (known as _host functions_).
22
25
23
-
By default, Hyperlight restricts guest access to a minimal API. The only _host function_ available by default allows the guest to print messages, which are displayed on the host console or redirected to stdout, as configured. Hosts can choose to expose additional host functions, expanding the guest’s capabilities as needed.
26
+
By default, Hyperlight restricts guest access to a minimal API. The only _host function_ available by default allows the
27
+
guest to print messages, which are displayed on the host console or redirected to stdout, as configured. Hosts can
28
+
choose to expose additional host functions, expanding the guest’s capabilities as needed.
24
29
25
-
Below is an example demonstrating the use of the Hyperlight host library in Rust to execute a simple guest application and an example of a simple guest application using the Hyperlight guest library in also written in Rust.
30
+
Below is an example demonstrating the use of the Hyperlight host library in Rust to execute a simple guest application
31
+
and an example of a simple guest application using the Hyperlight guest library in also written in Rust.
For additional examples of using the Hyperlight host Rust library, see the [./src/hyperlight_host/examples](./src/hyperlight_host/examples) directory.
142
+
For additional examples of using the Hyperlight host Rust library, see
143
+
the [./src/hyperlight_host/examples](./src/hyperlight_host/examples) directory.
138
144
139
-
For examples of guest applications, see the [./src/tests/c_guests](./src/tests/c_guests) directory for C guests and the [./src/tests/rust_guests](./src/tests/rust_guests) directory for Rust guests.
145
+
For examples of guest applications, see the [./src/tests/c_guests](./src/tests/c_guests) directory for C guests and
146
+
the [./src/tests/rust_guests](./src/tests/rust_guests) directory for Rust guests.
140
147
141
148
> Note: Hyperlight guests can be written using the Hyperlight Rust or C Guest libraries.
142
149
143
150
## Repository Structure
144
151
145
152
- Hyperlight Host Libraries (i.e., the ones that create and manage the VMs)
146
-
-[src/hyperlight_host](./src/hyperlight_host) - This is the Rust Hyperlight host library.
153
+
-[src/hyperlight_host](./src/hyperlight_host) - This is the Rust Hyperlight host library.
147
154
148
155
- Hyperlight Guest Libraries (i.e., the ones to make it easier to create guests that run inside the VMs)
149
-
-[src/hyperlight_guest](./src/hyperlight_guest) - This is the Rust Hyperlight guest library.
150
-
-[src/hyperlight_guest_capi](./src/hyperlight_guest_capi) - This is the C compatible wrapper for the Hyperlight guest library.
156
+
-[src/hyperlight_guest](./src/hyperlight_guest) - This is the Rust Hyperlight guest library.
157
+
-[src/hyperlight_guest_capi](./src/hyperlight_guest_capi) - This is the C compatible wrapper for the Hyperlight
158
+
guest library.
151
159
152
160
- Hyperlight Common (functionality used by both the host and the guest)
153
-
-[src/hyperlight_common](./src/hyperlight_common)
161
+
-[src/hyperlight_common](./src/hyperlight_common)
154
162
155
163
- Test Guest Applications:
156
-
-[src/tests/rust_guests](./src/tests/rust_guests) - This directory contains three Hyperlight Guest programs written in Rust, which are intended to be launched within partitions as "guests".
157
-
-[src/tests/c_guests](./src/tests/c_guests) - This directory contains two Hyperlight Guest programs written in C, which are intended to be launched within partitions as "guests".
164
+
-[src/tests/rust_guests](./src/tests/rust_guests) - This directory contains three Hyperlight Guest programs written
165
+
in Rust, which are intended to be launched within partitions as "guests".
166
+
-[src/tests/c_guests](./src/tests/c_guests) - This directory contains two Hyperlight Guest programs written in C,
167
+
which are intended to be launched within partitions as "guests".
158
168
159
169
- Tests:
160
-
-[src/hyperlight-testing](./src/hyperlight_testing) - Shared testing code for Hyperlight projects built in Rust.
170
+
-[src/hyperlight-testing](./src/hyperlight_testing) - Shared testing code for Hyperlight projects built in Rust.
161
171
162
172
## Try it yourself!
163
173
@@ -170,10 +180,13 @@ You can run Hyperlight on:
170
180
171
181
After having an environment with a hypervisor setup, running the example has the following pre-requisites:
172
182
173
-
1. On Linux or WSL, you'll most likely need build essential. For Ubuntu, run `sudo apt install build-essential`. For Azure Linux, run `sudo dnf install build-essential`.
174
-
2.[Rust](https://www.rust-lang.org/tools/install). Install toolchain v1.78.0 or later.
183
+
1. On Linux or WSL, you'll most likely need build essential. For Ubuntu, run `sudo apt install build-essential`. For
184
+
Azure Linux, run `sudo dnf install build-essential`.
185
+
2.[Rust](https://www.rust-lang.org/tools/install). Install toolchain v1.78.0 or later.
175
186
176
-
Also, install the `x86_64-pc-windows-msvc` and `x86_64-unknown-none` targets, these are needed to build the test guest binaries. (Note: install both targets on either Linux or Windows: Hyperlight can load ELF or PE files on either OS, and the tests/examples are built for both):
187
+
Also, install the `x86_64-pc-windows-msvc` and `x86_64-unknown-none` targets, these are needed to build the test
188
+
guest binaries. (Note: install both targets on either Linux or Windows: Hyperlight can load ELF or PE files on either
189
+
OS, and the tests/examples are built for both):
177
190
178
191
```sh
179
192
rustup target add x86_64-unknown-none
@@ -220,27 +233,33 @@ If all worked as expected, you should see the following message in your console:
220
233
Hello, World! I am executing inside of a VM :)
221
234
```
222
235
223
-
If you get the error `Error: NoHypervisorFound` and KVM or mshv is set up then this may be a permissions issue. In bash, you can use `ls -l /dev/kvm` or `ls -l /dev/mshv` to check which group owns that device and then`groups` to make sure your user is a member of that group.
236
+
If you get the error `Error: NoHypervisorFound` and KVM or mshv is set up then this may be a permissions issue. In bash,
237
+
you can use `ls -l /dev/kvm` or `ls -l /dev/mshv` to check which group owns that device and then`groups` to make sure
238
+
your user is a member of that group.
224
239
225
-
For more details on how to verify that KVM is correctly installed and permissions are correct, follow the guide [here](https://help.ubuntu.com/community/KVM/Installation).
240
+
For more details on how to verify that KVM is correctly installed and permissions are correct, follow the
[](https://codespaces.new/hyperlight-dev/hyperlight)
230
246
231
247
## Contributing to Hyperlight
232
248
233
-
If you are interested in contributing to Hyperlight, running the entire test-suite is a good way to get started. To do so, on your console, run the following commands:
249
+
If you are interested in contributing to Hyperlight, running the entire test-suite is a good way to get started. To do
250
+
so, on your console, run the following commands:
234
251
235
252
```sh
236
253
just guests # build the c and rust test guests
237
254
just build # build the Hyperlight library
238
255
just test # runs the tests
239
256
```
240
257
241
-
Also , please review the [CONTRIBUTING.md](./CONTRIBUTING.md) file for more information on how to contribute to Hyperlight.
258
+
Also , please review the [CONTRIBUTING.md](./CONTRIBUTING.md) file for more information on how to contribute to
259
+
Hyperlight.
242
260
243
-
> Note: For general Hyperlight development, you may also need flatc (Flatbuffer compiler): for instructions, see [here](https://github.com/google/flatbuffers).
261
+
> Note: For general Hyperlight development, you may also need flatc (Flatbuffer compiler): for instructions,
262
+
> see [here](https://github.com/google/flatbuffers).
244
263
245
264
## More Information
246
265
@@ -251,5 +270,7 @@ For more information, please refer to our compilation of documents in the [`docs
0 commit comments