-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Selfhosting on Windows WSL
João Moreno edited this page Nov 5, 2020
·
12 revisions
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.
- Install WSL2 and Ubuntu.
- Install vcxsrv, it will create a
XLaunch
shortcut in your Desktop`. - Download the
config.xlaunch
file 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\vcxsrv.exe
. - Right-click, Properties on that shortcut and change
Target
to"C:\Program Files (x86)\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
.bashrc
or equivalent:
if [ -z $DISPLAY ]; then
export DISPLAY="$(tail -1 /etc/resolv.conf | cut -d' ' -f2):0"
fi
- Start a new shell session, install
x11-apps
and try runningxcalc
, make sure it comes up. - Clone
vscode
- 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
and make sureyarn
runs without errors and installs all dependencies within WSL. Linux Prerequisites section of our contribution guide - Install VS Code Insiders for Windows and the Remote - WSL extension.
- In VS Code, open the remote
vscode
WSL folder. Run./scripts/code.sh
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
- Testing
- Dealing with Test Flakiness
- Contributor License Agreement
- Extension API Guidelines
- Accessibility Guidelines
Documentation