Take your Linux development experience in Windows to the next level with WSL and Visual Studio Code Remote
Using VS Code Remote and the Windows Subsystem for Linux (WSL) gives you a fully featured Linux development environment on a Windows laptop or desktop. Let’s look at how using these tools will completely change how you develop with Linux tools in Windows.
First things first: Installing what you need
You will need WSL and VS Code with the VS Code Remote – WSL extension installed to complete the content in this blog post. We’ll quickly go over what both of those are, and how to install them.
The Windows Subsystem for Linux
Commonly abbreviated down to WSL, this tool lets you run unmodified Linux binaries directly on Windows. This means you can use your favorite Linux tools, command line applications and workflows on your Windows machine without having to use a complicated set up like dual booting. Best of all, WSL is a tightly integrated solution between Windows and Linux. So, if you love Linux you can access all your Windows files and executables right from the bash shell, and if you love Windows you can easily access your Linux binaries and files from PowerShell or CMD.
If you’re new to WSL and want to learn more you can complete our full course: Get started with Windows Subsystem for Linux, or you can find just the install instructions on the WSL docs.
Visual Studio Code
You’ll also need the VS Code Remote – WSL extension, which allows you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment. To learn more and get started please visit the VS Code Remote documentation page.
Ready, set, Linux!
Instead of writing a long section about how you get started with VS Code Remote in WSL, we have put together this quick video showcasing how to do python development in WSL using VS Code Remote.
This isn’t just isolated to python, you can use VSCode Remote and WSL on any Linux project
When using VS Code Remote in WSL, commands and extensions are run directly in the Linux distro, so you don’t have to worry about pathing issues, binary compatibility, or other cross-OS challenges. You’re able to use VS Code in WSL just as you would from Windows.
VS Code Remote and WSL are game changers when it comes to developing with Linux on Windows. These tools let you develop, run, and debug tons of Linux applications directly on your Windows machine, giving you the best of both a Windows and Linux environment.
If you want to learn more about the Windows Subsystem for Linux and everything command line in Windows, stay tuned to this blog! And if you are curious to learn more about VS Code Remote, you can read the announcement blog post here, and the extensive documentation covering the architecture here.
We are excited to bring you powerful combination of VS Code Remote and WSL!
Also in this series: An In Depth Tutorial on Linux Development on Windows with WSL and Visual Studio Code – Where we dive into the details how to get setup using WSL and VSCode Remote..
This is part 1 of our 3 part series. You can find the full series here:
- Part 1 – Take your Linux development experience in Windows to the next level with WSL and Visual Studio Code Remote
- Part 2 – An In Depth Tutorial on Linux Development on Windows with WSL and Visual Studio Code
- Part 3 – Tips and Tricks for Linux development with WSL and Visual Studio Code
- Updated header intro.
- Added link to next blog post.
Excellent. It is excellent for developing a server app. What do you think about using this for data science. Would it be better to use an Anaconda a native Windows Anaconda install or to use it under WSL? Would a native Anaconda have better performance?
In my opinion that comes up to personal preference, I could see both being valuable. And if you’re worried about performance you can always run your python script in Windows and then again in WSL and measure which took longer!
Some important tools (e.g., NCAR’s PyNGL) are not available on Windows Anaconda, so you have to hope WSL performs well enough for your use case.
Thank you for this article!Visual Studio Code must be installed in the Linux OS (Windows Subsystem for Linux), right?
Nope, you would install VSCode in the Windows side and install the remote extension inside of it. Check out the install instructions linked in the article!
This is an amazing tool from Microsoft. I have had some issues with creating an Angular development environment. It would be great to get some help. Here is my blog post: https://wpbest.io/angular-sample-project-for-trying-out-the-vs-code-remote-containers-extension and GitHub repository: https://github.com/wpbest/vscode-remote-try-angular
I recommend filing issues in VSCode/WSL repos as appropriate.
How about Visual Studio? Are there any plans to support the very same feature in the foreseeable future?
I have installed the remote development (it automatically installed Remote-WSL, Remote-SSH), however, when I use ‘ctrl+shift+P’ to open ‘Remote-WSL: new window,’ it gave the error “WSL executable not found. Please make sure that WSL is installed”, any hint to solve it? Thanks.
Please find/file a bug on the WSL repo: https://github.com/microsoft/wsl