Hello amazing people 👋
Hope you guys had great weekend, I surely did 👇
Rishab KumarWent on 5km trek, and it was so relaxing, also spotted these 👀23:49 PM - 04 Apr 2021
So for quite a while now, I have been using WSL - Windows Subsystem for Linux. It was really impressive to see this from Microsoft and I ever since then, I have loved it for development. So in today's blog I will be sharing how I utilize it with VSCode.
The Windows Subsystem for Linux lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.
Choose your favorite GNU/Linux distributions from the Microsoft Store.
Run common command-line tools such as grep, sed, awk, or other ELF-64 binaries.
Run Bash shell scripts and GNU/Linux command-line applications including:
Install additional software using your own GNU/Linux distribution package manager.
Invoke Windows applications using a Unix-like command-line shell.
Invoke GNU/Linux applications on Windows.
Enable the "Windows Subsystem for Linux" optional feature before installing any Linux distributions on Windows. Open PowerShell as Administrator and run:
1dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
This step is optional, if you want to run WSL 1, please proceed to step 6.
To update to WSL 2, you must be running Windows 10.
For x64 systems: Version 1903 or higher, with Build 18362 or higher.
For ARM64 systems: Version 2004 or higher, with Build 19041 or higher.
Builds lower than 18362 do not support WSL 2.
Before installing WSL 2, you must enable the Virtual Machine Platform optional feature. Your machine will require virtualization capabilities to use this feature.
Open PowerShell as Administrator and run:
1dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart the machine.
Download the latest package:
WSL2 Linux kernel update package for x64 machines
Run the update package downloaded in the previous step. (Double-click to run - you will be prompted for elevated permissions, select 'yes' to approve this installation.)
Open PowerShell and run this command to set WSL 2 as the default version when installing a new Linux distribution:
1wsl --set-default-version 2
Open the Microsoft Store and select your favorite Linux distribution.
From the distribution's page, select "Get".
The first time you launch a newly installed Linux distribution, a console window will open and you'll be asked to wait for a minute or two for files to de-compress and be stored on your PC. All future launches should take less than a second.
You will then need to create a user account.
The Remote - WSL extension lets you use VS Code on Windows to build Linux applications that run on the Windows Subsystem for Linux(WSL). You get all the productivity of Windows while developing with Linux-based tools, runtimes, and utilities.
Remote - WSL lets you use VS Code in WSL just as you would from Windows.
Download the extension.
You can launch a new instance of VS Code connected to WSL by opening a WSL terminal, navigating to the folder of your choice, and typing