microsoft/openvmm
Publicmirrored from https://github.com/microsoft/openvmmAvailable
Guide/src/dev_guide/getting_started/linux.md
77lines · 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. | |
| 18 | ```powershell | |
| 19 | PS> wsl -l -v | |
| 20 | NAME STATE VERSION | |
| 21 | * Ubuntu Running 2 | |
| 22 | ``` | |
| 23 | Once that command has completed, you will need to open WSL to complete the | |
| 24 | installation and set your password. You can open WSL by typing `wsl` or `bash` | |
| 25 | into Command Prompt or Powershell, or by opening the "Ubuntu" Windows Terminal | |
| 26 | profile that should have been created. | |
| 27 | | |
25103b44Daniel Prilik1 years ago | 28 | ```admonish info |
| 29 | If you intend to cross-compile OpenVMM for Windows, please ensure you are | |
| 30 | running a recent version of Windows 11. Windows 10 is no longer supported as a | |
| 31 | development platform, due to needed WHP APIs. | |
| 32 | ``` | |
3fb1f627Daniel Prilik1 years ago | 33 | |
| 34 | All subsequent commands on this page must be run within WSL2. | |
| 35 | | |
| 36 | ## Installing Rust | |
| 37 | | |
| 38 | To build OpenVMM or OpenHCL, you first need to install Rust. | |
| 39 | | |
| 40 | The OpenVMM project actively tracks the latest stable release of Rust, though it | |
| 41 | may take a week or two after a new stable is released until OpenVMM switches | |
| 42 | over to it. | |
| 43 | | |
| 44 | Please follow the [official instructions](https://www.rust-lang.org/tools/install) to do so. | |
| 45 | | |
78d50d66Matt Kurjanowicz1 years ago | 46 | ## \[Linux] Additional Dependencies |
| 47 | | |
| 48 | On Linux, there are various other dependencies you will need depending on what | |
| 49 | you're working on. On Debian-based distros such as Ubuntu, running the following | |
| 50 | command within WSL will install these dependencies. | |
| 51 | | |
| 52 | In the future, it is likely that this step will be folded into the | |
| 53 | `cargo xflowey restore-packages` command. | |
| 54 | | |
| 55 | ```bash | |
| 56 | $ sudo apt install \ | |
| 57 | binutils \ | |
| 58 | build-essential \ | |
| 59 | gcc-aarch64-linux-gnu \ | |
| 60 | libssl-dev | |
| 61 | ``` | |
| 62 | | |
3fb1f627Daniel Prilik1 years ago | 63 | ## Cloning the OpenVMM source |
| 64 | | |
| 65 | **If using WSL2:** Do NOT clone the repo into Windows then try to access said | |
ab6b8b87Daniel Prilik1 years ago | 66 | clone from Linux! It will result in serious performance issues, and may break |
| 67 | certain functionality (e.g: cross-compiling Windows binaries). | |
3fb1f627Daniel Prilik1 years ago | 68 | |
| 69 | ```bash | |
ab6b8b87Daniel Prilik1 years ago | 70 | $ cd ~/src/ |
3fb1f627Daniel Prilik1 years ago | 71 | $ git clone https://github.com/microsoft/openvmm.git |
| 72 | ``` | |
| 73 | | |
| 74 | ## Next Steps | |
| 75 | | |
| 76 | You are now ready to build [OpenVMM](./build_openvmm.md) or | |
| 77 | [OpenHCL](./build_openhcl.md)! |