Run Linux VS Code on WSL

Run Linux VS Code on WSL

This guide assumes you already have WSL installed in your system and you are currenly running an Ubuntu distro.

1. Get XFCE ready

If you are new to running WSL on Windows, we recommend you to follow our Guide to Run XFCE in Windows 10 via WSL.

Once XFCE is installed run VcXserv in your Windows side, open an Ubuntu Bash and run xfce4-session. XFCE4 isn’t a requirement as you can use other Window Managers in WSL, but that will be a topic for another post.

We recommend running VcXserv as a single window mode as it will allow you to see the Linux Desktop and we find that it’s the best experience for WSL at the moment.

At this point you should see an XFCE desktop enviroment. From there you can run bundled apps like Settings, File Manager and others. If everything works well at this point, you are ready to install Visual Studio Code.

2. Add VSCode repository

Add the repository as explained in the official VS Code Linux page. Once added your system will be able to install both code and code-insiders as well as keeping them up to date via apt

1
2
3
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

3. Install VSCode Insiders (or just Code)

sudo apt install code-insiders

After the installation is complete, you can go to your Applications menu and find Visual Studio Code (or Visual Studio Code Insiders) under the Development tab.

4. Run VSCode

If everything goes well you should see Code loading and working as expected.

More Content