- USING VISUAL STUDIO CODE UBUNTU ON WINDOWS INSTALL
- USING VISUAL STUDIO CODE UBUNTU ON WINDOWS WINDOWS
USING VISUAL STUDIO CODE UBUNTU ON WINDOWS INSTALL
Check out the Visual Studio Code Change Log v1.44: Remote Development and the extension's page for more use case scenarios.How to install visual studio code text editor in ubuntu system using command prompt or terminal. For example, it can also attach to kubernetes containers. Side Note: Also, be aware that the "Remote Extension" is not limited to working with files on WSL. It abstracts all implementation details and allows you to focus on what matters.
USING VISUAL STUDIO CODE UBUNTU ON WINDOWS WINDOWS
VS Code and the "WSL Remote Development" plugin are powerful tools that can greatly improve your coding productivity and support complex development scenarios by allowing you to work with Linux files on WSL as if they were a part of a Windows file system. Let's finish this example by making a change into one file and see that "diff" view is working as expected: VS Code - Diff View Conclusion: The last step is to press the "OK" button: VS Code Open Folder Drop-down - After SelectionĪnd that's it! Now, you'll see all WSL files from the "deployments" folder in VS Code "Explorer" window as if they were opened in Windows: VS Code - WSL Files in the Explorer Panelįrom here you could do pretty anything you could do with a project inside a Windows folder: open command prompt and run commands, use source control, debug, etc. You'll see it populate the line with the requested path. Then start typing a folder you'd like to open (in our case it's "~/deployments") and select it from the list: VS Code Open Folder Drop-down - Selection Here we should open the "Explorer" panel and click "Open Folder" button (it also possible to just press "Open folder." under the "Start" section): VS Code New Window - Explorer PanelĪfter that you'll see a Drop-down menu with a list of folders inside your home folder on WSL: VS Code Open Folder Drop-down After selecting, a new VS Code window will be opened and it should ask your permission for accessing the network (or may not, depending on your Windows configuration): VS Code New Window - Network Access RequestĪfter giving access to the network, we will see a familiar VS Code welcome window: VS Code New Window Here we should select "Remote-WSL: New Window". After pressing Ctrl+Shift+P inside VS Code and starting typing "Remote" we will see something like this: Selecting "Remote-WSL: New Window" I'll skip the installation of the extension though. Let's try to open our "~/deployments" folder. Pick up a folder you'd like to open and press "OK".In VS Code, Press Ctrl+Shift+P, start typing and choose "Remote-WSL: New Window".Install Remote Development extension for VS Code.Here are the steps needed to access Linux folders outside WSL: To achieve what we want some prerequisites must be satisfied - those should be already installed and configured on your Windows OS: So, the goal is to access those files in VS Code, make a change to one of them and see the diff for the change. In that folder, we have three YAML files (they are taken from Run a Replicated Stateful Application - MySQL | kubernetes.io example): The content of the ~/deployments folder So, let's say we have the "deployments" folder inside the user's home directory on Ubuntu (WSL): The result of ls command - deployments folder inside our home folder ~/ The reason behind is simple - Linux provides a lot of utilities that can enhance your experience with kubectl (like xarg, awk) and you can use bash (or any other) scripting language for automating your deployments. This guide shows you how.įor example, I'd like to use WSL for editing YAML files (kubernetes deployments) with NeoVim, and "kubectl" util for managing kubernetes clusters. Let's say, you found a project on GitHub (or it's your own) that has to be accessed from Linux (WSL) using VS Code. This article is based on the official Visual Studio Code documentation: Developing in WSL | VS Code Docs but extends it with a practical example.