fbpx
  • Thu. Oct 21st, 2021

Remote – WSL – Visual Studio Marketplace

lanwo ayotunde

ByRemotepro

Jan 19, 2020

The Remote – WSL extension extension lets you use the Windows Subsystem for Linux (WSL) as your full-time development environment right from VS Code. This new, optimized support lets you:

  • Use Windows to develop in a Linux based environment, using Linux specific toolchains and utilities.
  • Edit files located in WSL or the mounted Windows filesystem (e.g. /mnt/c).
  • Run and debug your Linux based applications on Windows, in VS Code.

Remote – WSL runs commands and extensions directly in WSL 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.

demo

Installation

  1. Install VS Code or VS Code Insiders and this extension.

    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 or code-insiders command.

  2. Install the Windows Subsystem for Linux along with your preferred Linux distribution.

    Note: WSL2 support is experimental. Also, extensions installed in Alpine Linux may not work due to glibc dependencies in native code inside the extension. See the Remote Development and Linux article for details.

Working with Git? Here are two tips to consider:

  • If you are working with the same repository in WSL and Windows, be sure to set up consistent line endings. See tips and tricks to learn how.
  • You can also avoid passwords by configuring WSL to use the Windows Git credential manager. See tips and tricks to for details.

Getting started

Follow the step-by-step tutorial or if you already have WSL running:

  1. Follow the installation steps above.
  2. Open a WSL terminal for your installed distribution (e.g. Ubuntu 18.04 LTS)
  3. Go to any folder and type: code .

Or you can:

  1. Start VS Code.
  2. Press F1, enter Remote-WSL: New Window, and hit enter.
  3. Use the File menu to open your folder.

VS Code will set up the environment and a new VS Code window will appear with the contents of the WSL folder!

Another way to learn what you can do with the extension is to browse the commands it provides. Press F1 to bring up the Command Palette and type in Remote-WSL for a full list.

Command palette

You can also click on the Remote “Quick Access” status bar item in the lower left corner to get a list of the most common commands.

Quick actions status bar item

For more information, please see the extension documentation.

Questions, Feedback, Contributing

Have a question or feedback?

Or connect with the community…

Twitter Stack Overflow VS Code Dev Community Slack VS CodeGitter

Telemetry

Visual Studio Code Remote – WSL and related extensions collect telemetry data to help us build a better experience working remotely from VS Code. We only collect data on which commands are executed. We do not collect any information about image names, paths, etc. The extension respects the telemetry.enableTelemetry setting which you can learn more about in the Visual Studio Code FAQ.

License

By downloading and using the Visual Studio Remote – WSL extension and its related components, you agree to the product license terms and privacy statement.

Source

Leave a Reply

Your email address will not be published. Required fields are marked *