Text of code.visualstudio.com › docs › remote › wsl as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Developing in WSL

AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. Join VS Code at Microsoft Ignite or catch the sessions online. A year of VS Code, wrapped. Explore the highlights. Developing in WSL View as Markdown Ask in VS Code Ask in VS Code Insiders The Visual Studio Code WSL extension lets you use the Windows Subsystem for Linux (WSL) as your full-time development environment right from VS Code.

You can develop in a Linux-based environment, use Linux-specific toolchains and utilities, and run and debug your Linux-based applications all from the comfort of Windows. The extension runs commands and other extensions directly in WSL so you can edit files located in WSL or the mounted Windows filesystem (for example /mnt/c ) without worrying about pathing issues, binary compatibility, or other cross-OS challenges. The extension will install VS Code Server inside WSL; the server is independent of any existing VS Code installation in WSL.

This lets VS Code provide a local-quality development experience — including full IntelliSense (completions), code navigation, and debugging — regardless of where your code is hosted . Getting started Note : After reviewing this topic, you can get started with the introductory WSL tutorial . Installation To get started, you need to: Install the Windows Subsystem for Linux along with your preferred Linux distribution.

Note: WSL 1 does have some known limitations for certain types of development. Also, extensions installed in Alpine Linux may not work due to glibc dependencies in native source code inside the extension. See the Remote Development and Linux article for details. Install Visual Studio Code on the Windows side (not in WSL). Note: When prompted to Select Additional Tasks during installation, be sure to check the Add to PATH option so you can easily open a folder in WSL using the code command.

Install the WSL extension . If you plan to work with other remote extensions in VS Code, you may choose to install the Remote Development extension pack . Open a remote folder or workspace From the WSL terminal Opening a folder inside the Windows Subsystem for Linux in VS Code is very similar to opening up a Windows folder from the command prompt or PowerShell. Open a WSL terminal window (using the start menu item or by typing wsl from a command prompt / PowerShell).

Navigate to a folder you'd like to open in VS Code (including, but not limited to, Windows filesystem mounts like /mnt/c ) Type code . in the terminal. When doing this for the first time, you should see VS Code fetching components needed to run in WSL. This should only take a short while, and is only needed once. Note: If this command does not work, you may need to restart your terminal or you may not have added VS Code to your path when it was installed.

After a moment, a new VS Code window will appear, and you'll see a notification that VS Code is opening the folder in WSL. VS Code will now continue to configure itself in WSL and keep you up to date as it makes progress. Once finished, you now see a WSL indicator in the bottom left corner, and you'll be able to use VS Code as you would normally! That's it! Any VS Code operations you perform in this window will be executed in the WSL environment, everything from editing and file operations, to debugging, using terminals, and more.

From VS Code Alternatively, you can open a WSL window directly from VS Code: Start VS Code. Press F1 , select WSL: Connect to WSL for the default distro or WSL: Connect to WSL using Distro for a specific distro. Use the File menu to open your folder. If you already have a folder open, you can also use the WSL: Reopen Folder in WSL command. You will be prompted which distro to use. If you are in a WSL window and want to open the current input in a local window, use WSL: Reopen in Windows .

From the Windows command prompt To open a WSL window directly from a Windows prompt use the --remote command line parameter: code --remote wsl+<distro name> <path in WSL> for example: code --remote wsl+Ubuntu /home/jim/projects/c We need to do some guessing on whether the input path is a file or a folder. If it has a file extension, it is considered a file. To force that a folder is opened, add slash to the path or use: code --folder-uri vscode-remote://wsl+Ubuntu/home/ubuntu/folder.with.dot To force that a file is opened add --goto or use: code --file-uri vscode-remote://wsl+Ubuntu/home/ubuntu/fileWithoutExtension Working with Git If you are working with the same repository in WSL and Windows, be sure to set up consistent line endings.

See tips and tricks for details. You can also avoid passwords by configuring WSL to use the Windows Git credential manager. See tips and tricks for details. Managing extensions VS Code runs extensions in one of two places: locally on the UI / client side, or in WSL. While extensions that affect the VS Code UI, like themes and snippets, are installed locally, most extensions will reside inside WSL. If you install an extension from the Extensions view, it will automatically be installed in the correct location.

Once installed, you can tell where an extension is installed based on the category grouping. There will be Local - Installed category and one for WSL. Note: If you are an extension author and your extension is not working properly or installs in the wrong place, see Supporting Remote Development for details. Local extensions that actually need to run remotely will appear dimmed and disabled in the Local - Installed category.

Select Install to install an extension on your remote host. You can also install all locally installed extensions inside WSL by going to the Extensions view and selecting Install Local Extensions in WSL: {Name} using the cloud button at the right of the Local - Installed title bar. This will display a dropdown where you can select which locally installed extensions to install in your WSL instance. Opening a terminal in WSL Opening a terminal in WSL from VS Code is simple.

Once folder is opened in WSL, any terminal window you open in VS Code ( Terminal > New Terminal ) will automatically run in WSL rather than locally. You can also use the code command line from this same terminal window to perform a number of operations such as opening a new file or folder in WSL. Type code --help to see what options are available from the command line. Using WSL over an existing SSH connection You can connect to a WSL distribution on a remote Windows machine through Remote - SSH, without setting up an SSH server inside WSL.

Before you begin, make sure that: WSL and your target Linux distribution are installed on the remote Windows machine. The WSL extension and Remote - SSH extension are installed locally. To connect to the remote WSL distribution: Use Remote - SSH to connect to the remote Windows machine, not directly to the WSL distribution. In the SSH-connected window, open the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ) and run WSL: Connect to WSL using Distro... .

Select the target WSL distribution on the remote Windows machine. Alternatively, after connecting to the Windows machine over SSH, use the Remote Explorer view to connect to the target WSL distribution. Debugging in WSL Once you've opened a folder in WSL, you can use VS Code's debugger in the same way you would when running the application locally. For example, if you select a launch configuration in launch.json and start debugging ( F5 ), the application will start on remote host and attach the debugger to it.

See the debugging documentation for details on configuring VS Code's debugging features in .vscode/launch.json . WSL specific settings VS Code's local user settings are also reused when you have opened a folder in WSL. While this keeps your user experience consistent, you may want to vary some of these settings between your local machine and WSL. Fortunately, once you h

The rest of this page is on the live site.