{"id":4045,"date":"2020-06-15T11:10:21","date_gmt":"2020-06-15T11:10:21","guid":{"rendered":"http:\/\/jameseduard.com\/?p=4045"},"modified":"2020-06-15T11:10:21","modified_gmt":"2020-06-15T11:10:21","slug":"visual-studio-code-remote-on-windows-subsystem-on-linux","status":"publish","type":"post","link":"https:\/\/www.jameseduard.com\/?p=4045","title":{"rendered":"Visual Studio Code Remote on Windows Subsystem on Linux"},"content":{"rendered":"<p><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start\">\ufeff<\/span>The\u00a0<strong>Remote &#8211; WSL extension<\/strong>\u00a0extension lets you use the\u00a0<a title=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\">Windows Subsystem for Linux (WSL)<\/a>\u00a0as your full-time development environment right from VS Code. This new, optimized support lets you:<\/p>\n<ul>\n<li>Use Windows to develop in a Linux based environment, using Linux specific toolchains and utilities.<\/li>\n<li>Edit files located in WSL or the mounted Windows filesystem (e.g.\u00a0<code>\/mnt\/c<\/code>).<\/li>\n<li>Run and debug your Linux based applications on Windows, in VS Code.<\/li>\n<\/ul>\n<p>Remote &#8211; WSL runs commands and extensions directly in WSL so you don&#8217;t have to worry about pathing issues, binary compatibility, or other cross-OS challenges. You&#8217;re able to use VS Code in WSL just as you would from Windows.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/microsoft.github.io\/vscode-remote-release\/images\/wsl-readme.gif\" alt=\"demo\" \/><\/p>\n<h2 id=\"installation\">Installation<\/h2>\n<ol>\n<li>Install\u00a0<a title=\"https:\/\/code.visualstudio.com\/Download\" href=\"https:\/\/code.visualstudio.com\/Download\">VS Code<\/a>\u00a0or\u00a0<a title=\"https:\/\/code.visualstudio.com\/insiders\" href=\"https:\/\/code.visualstudio.com\/insiders\">VS Code Insiders<\/a>\u00a0and this extension.<br \/>\n<blockquote><p><strong>Note:<\/strong>\u00a0When prompted to\u00a0<strong>Select Additional Tasks<\/strong>\u00a0during installation, be sure to check the\u00a0<strong>Add to PATH<\/strong>\u00a0option so you can easily open a folder in WSL using the\u00a0<code>code<\/code>\u00a0or\u00a0<code>code-insiders<\/code>\u00a0command.<\/p><\/blockquote>\n<\/li>\n<li>Install the\u00a0<a title=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install-win10\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install-win10\">Windows Subsystem for Linux<\/a>\u00a0along with your preferred Linux distribution.<br \/>\n<blockquote><p><strong>Note:<\/strong>\u00a0WSL2 support is\u00a0<strong>experimental<\/strong>. Also, extensions installed in Alpine Linux may not work due to\u00a0<code>glibc<\/code>\u00a0dependencies in native code inside the extension. See the\u00a0<a title=\"https:\/\/aka.ms\/vscode-remote\/linux\" href=\"https:\/\/aka.ms\/vscode-remote\/linux\">Remote Development and Linux<\/a>\u00a0article for details.<\/p><\/blockquote>\n<\/li>\n<\/ol>\n<p><strong>Working with Git?<\/strong>\u00a0Here are two tips to consider:<\/p>\n<ul>\n<li>If you are working with the same repository in WSL and Windows, be sure to set up consistent line endings. See\u00a0<a title=\"https:\/\/aka.ms\/vscode-remote\/wsl\/troubleshooting\/crlf\" href=\"https:\/\/aka.ms\/vscode-remote\/wsl\/troubleshooting\/crlf\">tips and tricks<\/a>\u00a0to learn how.<\/li>\n<li>You can also avoid passwords by configuring WSL to use the Windows Git credential manager. See\u00a0<a title=\"https:\/\/aka.ms\/vscode-remote\/wsl\/troubleshooting\/cred-manager\" href=\"https:\/\/aka.ms\/vscode-remote\/wsl\/troubleshooting\/cred-manager\">tips and tricks<\/a>\u00a0to for details.<\/li>\n<\/ul>\n<h2 id=\"getting-started\">Getting started<\/h2>\n<p><strong><a title=\"https:\/\/aka.ms\/vscode-remote\/wsl\/tutorial\" href=\"https:\/\/aka.ms\/vscode-remote\/wsl\/tutorial\">Follow the step-by-step tutorial<\/a><\/strong>\u00a0or if you already have WSL running:<\/p>\n<ol>\n<li>Follow the installation steps above.<\/li>\n<li>Open a WSL terminal for your installed distribution (e.g. Ubuntu 18.04 LTS)<\/li>\n<li>Go to any folder and type:\u00a0<code>code .<\/code><\/li>\n<\/ol>\n<p>Or you can:<\/p>\n<ol>\n<li>Start VS Code.<\/li>\n<li>Press\u00a0<code>F1<\/code>, enter\u00a0<strong>Remote-WSL: New Window<\/strong>, and hit enter.<\/li>\n<li>Use the File menu to open your folder.<\/li>\n<\/ol>\n<p>VS Code will set up the environment and a new VS Code window will appear with the contents of the WSL folder!<\/p>\n<p>Another way to learn what you can do with the extension is to browse the commands it provides. Press\u00a0<code>F1<\/code>\u00a0to bring up the Command Palette and type in\u00a0<code>Remote-WSL<\/code>\u00a0for a full list.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/microsoft.github.io\/vscode-remote-release\/images\/remote-wsl-command-palette.png\" alt=\"Command palette\" \/><\/p>\n<p>You can also click on the Remote &#8220;Quick Access&#8221; status bar item in the lower left corner to get a list of the most common commands.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/microsoft.github.io\/vscode-remote-release\/images\/remote-dev-status-bar.png\" alt=\"Quick actions status bar item\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ufeffThe\u00a0Remote &#8211; WSL extension\u00a0extension lets you use the\u00a0Windows Subsystem for Linux (WSL)\u00a0as 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.\u00a0\/mnt\/c). Run and debug<\/p>\n","protected":false},"author":1,"featured_media":4057,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52,47,807],"tags":[46,806,808,51],"class_list":["post-4045","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-how-tos","category-visual-studio","tag-devops","tag-visual-studio","tag-windows-subsystem","tag-wsl"],"_links":{"self":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/4045","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4045"}],"version-history":[{"count":0,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/4045\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4045"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4045"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4045"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}