Visual Studio Code (VS Code) is a lightweight yet powerful source code editor that runs on your desktop. One of its most efficient features is its seamless integration with the Windows Subsystem for Linux (WSL). With WSL, developers can run a full Linux distribution directly on Windows without the need for a separate virtual machine. This provides a perfect environment for builds, testing, and scripting in a Linux shell while still enjoying the rich UI features that VS Code offers.
Getting VS Code Ready for WSL
Before diving into coding, users need to ensure a few prerequisites are in place:
- Install WSL: The latest WSL version (WSL 2) can be installed by following Microsoft’s official guide. This includes setting up a compatible Linux distribution such as Ubuntu.
- Install VS Code: VS Code can be downloaded and installed from the official Visual Studio Code website.
- Install the Remote – WSL Extension: In VS Code, navigate to the Extensions view (
Ctrl+Shift+X
) and search for ‘Remote – WSL‘ to install it.
After completing these steps, you’re ready to access your Linux environment directly within VS Code, taking advantage of your Windows setup while maintaining Linux development workflows.
Launching VS Code with WSL
There are two primary methods to start using VS Code with WSL:
- Via Command Line: Open your WSL terminal and type
code .
. This command launches VS Code in the current Linux directory. - Via VS Code Interface: Use the green status bar in the bottom-left corner and click “>WSL: New Window”.
After launching in WSL mode, all terminal commands inside VS Code will run in the selected Linux distro. Additionally, extensions installed in this environment will be located directly inside WSL, ensuring compatibility with Linux-based development tools.

Benefits of Using VS Code with WSL
This integration isn’t just about convenience—it dramatically improves developer productivity and project consistency. Some key benefits include:
- Native Linux tools: Easily access tools such as Bash, grep, sed, or compilers like gcc directly within your coding workflow.
- Improved performance: With WSL 2’s full Linux kernel, developers experience faster performance and better file I/O than previous solutions.
- Consistent environments: Work in the same environment used in production, especially useful for web development and Docker containers.

Working with Files
When working in WSL, it’s important to open files and projects that are located within the Linux file system (e.g., /home/username/project
) rather than directly from the Windows file system to ensure full compatibility. Accessing files from C:\
can lead to performance issues or unexpected behavior due to file system differences.
VS Code makes file navigation intuitive by integrating the Linux filesystem into the Explorer pane, allowing easy access to all project files.
Using Git and Extensions in WSL
Git integration within VS Code works seamlessly when operating in WSL mode. Developers can commit, push, and pull repositories directly within WSL using the same commands they’re used to, thanks to the presence of Git in the Linux environment.
Extensions that support Linux are automatically installed into the WSL environment each time they’re needed, and developers can configure project-specific extensions for optimal performance.
Conclusion
Using VS Code with WSL bridges the gap between Windows and Linux development, providing the best of both worlds. With just a few setup steps, developers can work in a powerful, flexible, and performance-optimized environment. Whether working on a web project or system-level application, WSL and VS Code offer an efficient, modern workflow.
FAQ
-
Q: Do I need to install VS Code inside Linux separately?
A: No, you only need to install VS Code on Windows. The Remote – WSL extension connects VS Code to your Linux system through WSL. -
Q: Can I use the same extensions in WSL that I use in Windows?
A: Some extensions can run in both environments, but for best performance, they should be installed in WSL separately when prompted by VS Code. -
Q: Does WSL support multiple Linux distributions?
A: Yes, you can install and use multiple distributions such as Ubuntu, Debian, and Kali. VS Code allows you to choose the target distribution when opening a new WSL window. -
Q: Can I debug applications in WSL using VS Code?
A: Absolutely. VS Code supports full debugging capabilities within the WSL environment for multiple languages and platforms.