Prerequisites
Installing WSL
Set up Ubuntu
Launch “Ubuntu” from the Start Menu and complete the initial setup (username and password).
Alternative: Installing a specific distribution
To use a different Linux distribution:Installing Build Dependencies
Once inside your WSL Ubuntu environment:These are the same dependencies as building on native Linux. See the Linux build guide for distribution-specific package names.
Building OpenRCT2
Clone the repository
You can clone the repository on the Windows filesystem (
/mnt/c/Users/...) and build from WSL, but performance will be better if you clone directly in WSL’s filesystem (~/).Running OpenRCT2 from WSL
Option 1: Using WSLg (Recommended for WSL 2)
WSL 2 includes WSLg, which provides GPU acceleration and native GUI support:WSLg is available in Windows 11 and Windows 10 (build 19044+). It provides the best experience for running GUI applications from WSL.
Option 2: Using X Server (WSL 1 or older WSL 2)
If WSLg is not available, install an X server on Windows:Install VcXsrv or X410
- VcXsrv: Download
- X410: Microsoft Store
Launch X Server
For VcXsrv:
- Run XLaunch
- Select “Multiple windows”
- Display number: 0
- Start “No Client”
- Check “Disable access control”
Option 3: Headless Server Only
For running a multiplayer server without GUI:Accessing Windows Files
Windows drives are mounted in WSL at/mnt/:
Accessing WSL Files from Windows
You can access WSL files from Windows Explorer:\\wsl$\Ubuntu\home\yourusername\ in Windows Explorer.
Build Options
Portable Build
Headless Server Build
Debug Build with Tests
Performance Optimization
Using CCache
Install CCache for faster rebuilds:Parallel Builds
Ninja automatically uses all CPU cores. To limit:File System Performance
For best performance, keep your source code and build artifacts in the WSL filesystem (
~/...), not on the Windows filesystem (/mnt/c/...)./mnt mount.
Troubleshooting
Cannot connect to display
If OpenRCT2 won’t launch graphically:xclock doesn’t work, your X server isn’t configured correctly.
WSLg not available
Check your Windows version:- Windows 11, or
- Windows 10 build 19044 or later
Missing dependencies
If CMake reports missing packages:GCC version too old
Install GCC 12:OpenGL/Mesa errors
If you encounter OpenGL issues with WSLg:Permission denied on /mnt/c
If you get permission errors accessing Windows files:Comparing WSL vs Native Windows
| Feature | WSL | Native Windows |
|---|---|---|
| Dependency management | Easy (apt) | Complex (vcpkg) |
| Build speed | Fast | Slower |
| Setup complexity | Simple | Moderate |
| Integration with Windows | Good | Native |
| Debugging tools | GDB | Visual Studio |
| File performance | Fast (WSL fs) | Fast |
WSL Tips
Limiting WSL memory usage
Create or edit%USERPROFILE%\.wslconfig on Windows:
Shutting down WSL
From Windows PowerShell:Updating WSL
Next Steps
- Building on Linux - Full Linux build documentation
- Building on Windows - Native Windows build method
- Contributing - Guidelines for contributing code

