microsoft/openvmm
Publicmirrored from https://github.com/microsoft/openvmmAvailable
Guide/src/dev_guide/getting_started/linux.md
86lines · modeblame
3fb1f627Daniel Prilik1 years ago | 1 | # Getting started on Linux / WSL2 |
| 2 | | |
| 3 | This page provides instructions for installing the necessary dependencies to | |
| 4 | build OpenVMM or OpenHCL on Linux / WSL2. | |
| 5 | | |
| 6 | ## \[WSL2] Installing WSL2 | |
| 7 | | |
| 8 | To install Windows Subsystem for Linux, run the following command in an | |
| 9 | elevated Powershell window: | |
| 10 | | |
| 11 | ```powershell | |
| 12 | PS> wsl --install | |
| 13 | ``` | |
| 14 | | |
| 15 | This should install WSL2 using the default Ubuntu linux distribution. | |
| 16 | You can check that the installation completed successfully by running the | |
| 17 | following command in a Powershell window. | |
5813d39cMatt LaFayette (Kurjanowicz)6 months ago | 18 | |
3fb1f627Daniel Prilik1 years ago | 19 | ```powershell |
| 20 | PS> wsl -l -v | |
| 21 | NAME STATE VERSION | |
| 22 | * Ubuntu Running 2 | |
| 23 | ``` | |
5813d39cMatt LaFayette (Kurjanowicz)6 months ago | 24 | |
3fb1f627Daniel Prilik1 years ago | 25 | Once that command has completed, you will need to open WSL to complete the |
| 26 | installation and set your password. You can open WSL by typing `wsl` or `bash` | |
| 27 | into Command Prompt or Powershell, or by opening the "Ubuntu" Windows Terminal | |
| 28 | profile that should have been created. | |
| 29 | | |
25103b44Daniel Prilik1 years ago | 30 | ```admonish info |
| 31 | If you intend to cross-compile OpenVMM for Windows, please ensure you are | |
| 32 | running a recent version of Windows 11. Windows 10 is no longer supported as a | |
| 33 | development platform, due to needed WHP APIs. | |
4b6ad1f1Matt LaFayette (Kurjanowicz)3 months ago | 34 | |
| 35 | For the best OpenHCL development experience, we recommend **Windows 11 26H1** | |
| 36 | (Insider Canary channel, build 28000+) if available for your device — this | |
| 37 | enables COM3 serial output for kernel logs and matches the CI runners. See | |
| 38 | [Debugging OpenHCL](../../reference/openhcl/debugging.md#recommended-host-os-for-openhcl-development) | |
| 39 | for details. | |
25103b44Daniel Prilik1 years ago | 40 | ``` |
3fb1f627Daniel Prilik1 years ago | 41 | |
| 42 | All subsequent commands on this page must be run within WSL2. | |
| 43 | | |
| 44 | ## Installing Rust | |
| 45 | | |
| 46 | To build OpenVMM or OpenHCL, you first need to install Rust. | |
| 47 | | |
| 48 | The OpenVMM project actively tracks the latest stable release of Rust, though it | |
| 49 | may take a week or two after a new stable is released until OpenVMM switches | |
| 50 | over to it. | |
| 51 | | |
| 52 | Please follow the [official instructions](https://www.rust-lang.org/tools/install) to do so. | |
| 53 | | |
78d50d66Matt Kurjanowicz1 years ago | 54 | ## \[Linux] Additional Dependencies |
| 55 | | |
| 56 | On Linux, there are various other dependencies you will need depending on what | |
| 57 | you're working on. On Debian-based distros such as Ubuntu, running the following | |
| 58 | command within WSL will install these dependencies. | |
| 59 | | |
| 60 | In the future, it is likely that this step will be folded into the | |
| 61 | `cargo xflowey restore-packages` command. | |
| 62 | | |
| 63 | ```bash | |
| 64 | $ sudo apt install \ | |
| 65 | binutils \ | |
| 66 | build-essential \ | |
| 67 | gcc-aarch64-linux-gnu \ | |
2edf894cMatt LaFayette (Kurjanowicz)1 years ago | 68 | libssl-dev \ |
| 69 | pkg-config | |
78d50d66Matt Kurjanowicz1 years ago | 70 | ``` |
| 71 | | |
3fb1f627Daniel Prilik1 years ago | 72 | ## Cloning the OpenVMM source |
| 73 | | |
| 74 | **If using WSL2:** Do NOT clone the repo into Windows then try to access said | |
ab6b8b87Daniel Prilik1 years ago | 75 | clone from Linux! It will result in serious performance issues, and may break |
| 76 | certain functionality (e.g: cross-compiling Windows binaries). | |
3fb1f627Daniel Prilik1 years ago | 77 | |
| 78 | ```bash | |
5813d39cMatt LaFayette (Kurjanowicz)6 months ago | 79 | cd ~/src/ |
| 80 | git clone https://github.com/microsoft/openvmm.git | |
3fb1f627Daniel Prilik1 years ago | 81 | ``` |
| 82 | | |
| 83 | ## Next Steps | |
| 84 | | |
| 85 | You are now ready to build [OpenVMM](./build_openvmm.md) or | |
| 86 | [OpenHCL](./build_openhcl.md)! |