Windows Subsystem for Linux
The Windows Subsystem for Linux is an alternative way to setup a complete development environment on Windows. It offers a Linux environment with a seamless bridge to the Windows world. We recommend this setup for Windows developers.
Setup
- Install WSL2 by following this guide . Important: Choose Ubuntu 24.04 LTS as the Linux distribution. Other distributions may not have a sufficient compiler.
- Optional but recommended: Install the new Windows Terminal
- Follow the developer guide for Linux from now on.
Using Visual Studio Code as IDE
You can use the native Windows Visual Studio Code IDE (VS Code) for developing in the WSL. It offers code completion, CMake integration, an integrated debugger, git integration and more.
Setup
- In the WSL shell run
sudo apt update && sudo apt install -y ninja-build gdb. - On Windows install Visual Studio Code
- Open VS Code and install the VS Code Remote Development extension
- In the WSL shell go to your OGS source code and run
code .. This will open the source code in VS Code. - Install the C/C++ , CMake and CMake Tools extensions
Build and debug OGS
- Configure your project by following this guide
. Select
GCC 13.3.0(or higher, depending on your installed version) as the CMake kit . - Follow this guide
for debug a target. Select
ogsas the debug target.
Additional notes
The filesystem of the WSL is not inside your regular user directories. You can find it by running explorer.exe . inside the WSL shell. It should be something like \\wsl$\Ubuntu-24.04\home\[username]\....
You can also run OGS inside the WSL with benchmarks located in your regular Windows directories. You regular filesystem can be accessed inside WSL with the /mnt/c/-prefix. E.g. to run an OGS benchmark:
bin/ogs -o _out /mnt/c/Users/[username]/ogs-src/Tests/Data/Elliptic/square_1x1_SteadyStateDiffusion/square_1e0.prjThis article was written by Lars Bilke. If you are missing something or you find an error please reach out
to us on our forum.
Generated with Hugo 0.164.0
in CI job 825193
|
Last revision: April 20, 2026
Commit: refactor(MeshLib): remove PropertyVector::push_back 870422dde
| Edit this page on