microsoft/openvmm

Public

mirrored fromhttps://github.com/microsoft/openvmmAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
99a7ff1205273631431408f66257923e938bc568

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Guide/src/dev_guide/getting_started/build_openvmm.md

94lines · modecode

1# Building OpenVMM
2
3**Prerequisites:**
4
5- One of:
6 - [Getting started on Windows](./windows.md)
7 - [Getting started on Linux / WSL2](./linux.md).
8
9```admonish tip
10It is strongly suggested that you use WSL2, and [cross compile](./cross_compile.md)
11for Windows when necessary.
12```
13
14## Build Dependencies
15
16OpenVMM currently requires a handful of external dependencies to be present in
17order to properly build / run. e.g: a copy of `protoc` to compile Protobuf
18files, a copy of the `mu_msvm` UEFI firmware, some test linux kernels, etc...
19
20Running the following command will fetch and unpack these various artifacts into
21the correct locations within the repo:
22
23```sh
24cargo xflowey restore-packages
25```
26
27If you intend to cross-compile, refer to the command's `--help` for additional
28options related to downloading packages for other architectures.
29
30## Building
31
32OpenVMM uses the standard Rust build system, `cargo`.
33
34To build OpenVMM, simply run:
35
36```sh
37cargo build
38```
39
40Note that certain features may require compiling with additional `--feature`
41flags.
42
43## Troubleshooting
44
45This section documents some common errors you may encounter while building
46OpenVMM.
47
48If you are still running into issues, consider filing an issue on the OpenVMM
49GitHub Issue tracker.
50
51### failed to invoke protoc
52
53**Error:**
54
55```text
56error: failed to run custom build command for `inspect_proto v0.0.0 (/home/daprilik/src/openvmm/support/inspect_proto)`
57
58Caused by:
59 process didn't exit successfully: `/home/daprilik/src/openvmm/target/debug/build/inspect_proto-e959f9d63c672ccc/build-script-build` (exit status: 101)
60 --- stderr
61 thread 'main' panicked at support/inspect_proto/build.rs:23:10:
62 called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: "failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: \"/home/daprilik/src/openvmm/.packages/Google.Protobuf.Tools/tools/protoc\"): No such file or directory (os error 2)" }
63 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
64warning: build failed, waiting for other jobs to finish...
65```
66
67Note: the specific package that throws this error may vary, and may not always be `inspect_proto`
68
69**Solution:**
70
71You attempted to build OpenVMM without first restoring necessary packages.
72
73Please run `cargo xflowey restore-packages`, and try again.
74
75### use of unstable library feature
76
77**Error:**
78
79```text
80error[E0658]: use of unstable library feature 'absolute_path'
81 --> flowey/flowey/src/lib.rs:37:17
82 |
8337 | std::path::absolute(self)
84 | ^^^^^^^^^^^^^^^^^^^
85 |
86 = note: see issue #92750 <https://github.com/rust-lang/rust/issues/92750> for more information
87
88For more information about this error, try `rustc --explain E0658`.
89error: could not compile `flowey` (lib) due to previous error
90```
91
92**Solution:**
93
94Install Rust using the official instructions for [Linux](https://openvmm.dev/guide/dev_guide/getting_started/linux.html#installing-rust) or [Windows](https://openvmm.dev/guide/dev_guide/getting_started/windows.html#installing-rust).
95