| 1 | # WSLC-HelloWorld |
| 2 | |
| 3 | The simplest [WSL Container API](https://aka.ms/wslc) sample, written in **C** |
| 4 | using the flat C API (`wslcsdk.h`). Running `helloworld.exe` starts a lightweight |
| 5 | WSL container from a small Linux image (`alpine:latest`), runs `echo` inside it, |
| 6 | and prints the output to your terminal. |
| 7 | |
| 8 | ## Build |
| 9 | |
| 10 | Open `WSLCHelloWorld.sln` in Visual Studio and build (x64), or from a developer |
| 11 | command prompt: |
| 12 | |
| 13 | ``` |
| 14 | nuget restore WSLCHelloWorld.sln |
| 15 | msbuild WSLCHelloWorld.sln /p:Configuration=Debug /p:Platform=x64 |
| 16 | ``` |
| 17 | |
| 18 | ## Run |
| 19 | |
| 20 | ``` |
| 21 | x64\Debug\helloworld.exe |
| 22 | ``` |
| 23 | |
| 24 | You should see `Hello, World from a WSL container!` printed to stdout. Progress |
| 25 | messages (`[wslc] ...`) go to stderr. |