Selfhosting on Windows WSL
mickelmansour edited this page Dec 19, 2021
·
9 revisions
Pages 70
Project Management
- Roadmap
- Iteration Plans
- Development Process
- Issue Tracking
- Build Champion
- Release Process
- Running the Endgame
- Related Projects
Contributing
- How to Contribute
- Submitting Bugs and Suggestions
- Feedback Channels
- Source Code Organization
- Coding Guidelines
- Smoke Test
- Dealing with Test Flakiness
- Contributor License Agreement
- Extension API Guidelines
Documentation
Clone this wiki locally
Selfhosting on Windows/WSL
This guide is for you if you want to selfhost VS Code on Windows but have a fast compile toolchain by running it in WSL. The drawback is that running VS Code from sources actually runs on Linux which is OK for most development tasks.

Setup
In Windows:
- Install WSL2 and Ubuntu.
- Install vcxsrv, it will create a
XLaunchshortcut in your Desktop`. - Download the
config.xlaunchfile from this gist to your user home directoryC:\Users\USERNAME\. - Hit Win R and type
shell:startup, hit Enter. Add a shortcut here forC:\Program Files\VcXsrv\xlaunch.exe. - Right-click, Properties on that shortcut and change
Targetto"C:\Program Files\VcXsrv\xlaunch.exe" -run C:\Users\USERNAME\config.xlaunch. This will make the X server launch on startup. Double click it to make sure it launches.
In WSL:
- Add the following to the end of your WSL
.bashrcor equivalent:
if [ -z $DISPLAY ]; then
export DISPLAY="$(tail -1 /etc/resolv.conf | cut -d' ' -f2):0"
fi
- To test everything, open a new WSL shell and
sudo apt install x11-apps && xcalc. You should see an XCalc window pop up. 👍
You may see errors like
Error: Can't open display: 172.20.192.1:0": open Windows Defender Firewall with Advanced Security, check inbound rules and make sure that VcXsrv windows server doesn't block private connections.
- Install build deps
sudo apt install python libsecret-1-dev libxss1 libx11-dev libxkbfile-dev libasound2 libgtk-3-0 libgdk-pixbuf2.0-0 libnss3 libxtst6 libxi6 libxdamage1 libxcursor1 libxcomposite1 libx11-xcb1
- In Windows, install VS Code Insiders for Windows and the Remote - WSL extension.
- In VS Code, clone
vscode, runyarn, start the build and run./scripts/code.shto run dev.

