<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vishnu</title>
    <description>The latest articles on DEV Community by Vishnu (@vishnumohanrk).</description>
    <link>https://dev.to/vishnumohanrk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F423107%2Fede1da07-973a-4b42-9b3b-613d3782912c.jpg</url>
      <title>DEV Community: Vishnu</title>
      <link>https://dev.to/vishnumohanrk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vishnumohanrk"/>
    <language>en</language>
    <item>
      <title>WSL Port Forwarding</title>
      <dc:creator>Vishnu</dc:creator>
      <pubDate>Wed, 15 Jul 2020 12:26:17 +0000</pubDate>
      <link>https://dev.to/vishnumohanrk/wsl-port-forwarding-2e22</link>
      <guid>https://dev.to/vishnumohanrk/wsl-port-forwarding-2e22</guid>
      <description>&lt;p&gt;When you start a server in WSL, both Windows and Linux share the same local host. When using a WSL 1 distribution, if your computer was set up to be accessed by your LAN, then applications running in WSL could be accessed on your LAN as well. &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/compare-versions#accessing-a-wsl-2-distribution-from-your-local-area-network-lan"&gt;This isn't the default case in WSL 2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, in order to access the server from your local devices, you need to port forward the WSL local IP using &lt;a href="https://docs.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh"&gt;netsh&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First, install net-tools in your linux distro.&lt;br&gt;
For Ubuntu,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;net-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, in Windows, create &lt;code&gt;network.ps1&lt;/code&gt; PowerShell script file with the following content.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="kr"&gt;If&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-NOT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Security.Principal.WindowsPrincipal&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;Security.Principal.WindowsIdentity&lt;/span&gt;&lt;span class="p"&gt;]::&lt;/span&gt;&lt;span class="n"&gt;GetCurrent&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsInRole&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;Security.Principal.WindowsBuiltInRole&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Administrator"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;   
  &lt;/span&gt;&lt;span class="nv"&gt;$arguments&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;amp; '"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$myinvocation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mycommand&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;definition&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Start-Process&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;powershell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Verb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;runAs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ArgumentList&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$arguments&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="kr"&gt;Break&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="nv"&gt;$remoteport&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;bash.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-c&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ifconfig eth0 | grep 'inet '"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$found&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$remoteport&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-match&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="kr"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$found&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nv"&gt;$remoteport&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$matches&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="kr"&gt;else&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Write-Output&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"IP address could not be found"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="kr"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="nv"&gt;$ports&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;@(&lt;/span&gt;&lt;span class="mi"&gt;5001&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;19000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;19001&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="kr"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-lt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$ports&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$ports&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Invoke-Expression&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"netsh interface portproxy delete v4tov4 listenport=&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Invoke-Expression&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"netsh advfirewall firewall delete rule name=&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;

  &lt;/span&gt;&lt;span class="n"&gt;Invoke-Expression&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"netsh interface portproxy add v4tov4 listenport=&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="s2"&gt; connectport=&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="s2"&gt; connectaddress=&lt;/span&gt;&lt;span class="nv"&gt;$remoteport&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;Invoke-Expression&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"netsh advfirewall firewall add rule name=&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="s2"&gt; dir=in action=allow protocol=TCP localport=&lt;/span&gt;&lt;span class="nv"&gt;$port&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Invoke-Expression&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"netsh interface portproxy show v4tov4"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script is taken from &lt;a href="https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723"&gt;here&lt;/a&gt;, I added command to automatically ask for admin permission, when opening the script, instead of right clicking and clicking run as admin every time you run the script.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The network should be a &lt;a href="https://support.microsoft.com/en-us/windows/make-a-wi-fi-network-public-or-private-in-windows-10-0460117d-8d3e-a7ac-f003-7a0da607448d"&gt;private network&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The script will ask for admin access. &lt;/p&gt;

&lt;p&gt;The script gets the WSL IP address and then executes &lt;a href="https://docs.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-interface-portproxy"&gt;netsh commands&lt;/a&gt; to forward the connection to your Windows' local IP, which you can see by executing &lt;code&gt;ipconfig&lt;/code&gt; in either PowerShell or Command Prompt.&lt;/p&gt;

&lt;p&gt;The script also resets all previous forwards and at the end displays the list of ipv4 connections forwarded.&lt;/p&gt;

&lt;p&gt;You can modify the &lt;code&gt;$ports&lt;/code&gt; array with your commonly used ports.&lt;/p&gt;

&lt;p&gt;Since WSL2 uses virtual network adapters, its IP address resets after every startup.&lt;/p&gt;

&lt;h2&gt;
  
  
  For &lt;a href="https://expo.io/"&gt;Expo&lt;/a&gt; users
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Include both ports 19000 and 19001 in the &lt;code&gt;$ports&lt;/code&gt; array. (Don't include 19002 - dev tool server).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In your Android device (connected to the same network as your PC), copy &lt;code&gt;exp://&amp;lt;your-windows-ip-address&amp;gt;:19000&lt;/code&gt; to the clipboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open &lt;a href="https://play.google.com/store/apps/details?id=host.exp.exponent"&gt;Expo Go&lt;/a&gt;, "Open from Clipboard" option will appear.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PowerShell command to view all forwards
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;netsh&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;interface&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;portproxy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;v4tov4&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Have a desktop shortcut for the script. It could be handy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The network should be a &lt;a href="https://support.microsoft.com/en-us/windows/make-a-wi-fi-network-public-or-private-in-windows-10-0460117d-8d3e-a7ac-f003-7a0da607448d"&gt;private network&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If your primary purpose is to only check your website for responsive design with your mobile, there is a simple way for that in chrome. See &lt;a href="https://developers.google.com/web/tools/chrome-devtools/remote-debugging"&gt;Chrome remote debugging&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.microsoft.com/en-us/windows/wsl/compare-versions#accessing-a-wsl-2-distribution-from-your-local-area-network-lan"&gt;Accessing a WSL 2 distribution from your local area network (LAN)&lt;/a&gt; - WSL Docs&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/microsoft/WSL/issues"&gt;WSL issues on Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723"&gt;Script Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://stackoverflow.com/a/11440595"&gt;Running a command as Administrator using PowerShell&lt;/a&gt; - From StackOverFlow&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Setup WSL 2 for Web Development</title>
      <dc:creator>Vishnu</dc:creator>
      <pubDate>Sun, 05 Jul 2020 09:07:41 +0000</pubDate>
      <link>https://dev.to/vishnumohanrk/setup-wsl-2-for-web-development-42o4</link>
      <guid>https://dev.to/vishnumohanrk/setup-wsl-2-for-web-development-42o4</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/vishnumohanrk/setup-wsl-2-hop"&gt;previous post&lt;/a&gt;, we saw how to install and setup WSL2. In this post we will setup WSL2 with Git, VSCode, Hyper and NodeJS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial Setup
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;You can skip this section if you haven't used LXrunoffline WSL management tool for installing a distro, but rather directly from MS Store&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In powershell&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will open the default WSL distro's terminal inside Powershell. Follow the steps,&lt;/p&gt;

&lt;p&gt;Create a new user&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;adduser &amp;lt;username&amp;gt;
&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember the ID.&lt;/p&gt;

&lt;p&gt;Give root permissions to the newly added user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; &lt;span class="nb"&gt;sudo&lt;/span&gt; &amp;lt;username&amp;gt;
&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we have to change the default user for WSL. To do this open &lt;strong&gt;powershell&lt;/strong&gt; and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt; &lt;span class="nf"&gt;--shutdown&lt;/span&gt;
&lt;span class="nf"&gt;lxrunoffline&lt;/span&gt; &lt;span class="nf"&gt;su&lt;/span&gt; &lt;span class="nf"&gt;-n&lt;/span&gt; &lt;span class="nf"&gt;Ubuntu-20.04&lt;/span&gt; &lt;span class="nf"&gt;-v&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nf"&gt;id&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;&amp;lt;id&amp;gt;&lt;/code&gt; is the ID of the user you just added. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Replace Ubuntu-20.04 with your default distro's name.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, this will set the newly added user as default user for the mentioned distro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Hyper
&lt;/h2&gt;

&lt;p&gt;Install Hyper from &lt;a href="https://hyper.is/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hyper is a Cross Platform terminal app built with ElectronJS. You can install plugins directly with NPM. Do check out this &lt;a href="https://github.com/bnb/awesome-hyper"&gt;repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, if you open up hyper, you will see that it is opening windows' cmd prompt by default. We have to change default shell to our default WSL distro's shell.&lt;/p&gt;

&lt;p&gt;To do so, open preferences. &lt;em&gt;Shortcut - &lt;code&gt;ctrl + ,&lt;/code&gt;&lt;/em&gt;&lt;br&gt;
It will open a .hyper JS file. In that file scroll down to this section&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// PowerShell on Windows&lt;/span&gt;
&lt;span class="c1"&gt;// -Example:`C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`&lt;/span&gt;
&lt;span class="nx"&gt;shell&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="c1"&gt;// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)&lt;/span&gt;
&lt;span class="c1"&gt;// by default `['--login']` will be used&lt;/span&gt;
&lt;span class="nx"&gt;shellArgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;It is the config file for Hyper and it IS JavaScript.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Change &lt;code&gt;shell&lt;/code&gt; and &lt;code&gt;shellArgs&lt;/code&gt; values to,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;shell&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C:&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;Windows&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;System32&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s1"&gt;wsl.exe&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nx"&gt;shellArgs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;~&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now relaunch Hyper. It will open your default WSL distro's shell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Replace apt with your distro's pkg manger.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Node
&lt;/h2&gt;

&lt;p&gt;First install NVM&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o-&lt;/span&gt; https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install LTS version of Node&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--lts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install Git
&lt;/h2&gt;

&lt;p&gt;WSL requires git to be installed on both Windows and your distro, and both should be same version.(&lt;em&gt;I am not sure about the version thing&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;Most of the distros comes pre-installed with git. To check,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not available install,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setup VSCode
&lt;/h2&gt;

&lt;p&gt;You don't have to install VSCode for your distro. Just install latest version of VSCode for windows and you are good to go.&lt;/p&gt;

&lt;p&gt;However, you have to install &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl"&gt;this extension&lt;/a&gt; for usage with WSL.&lt;/p&gt;

&lt;p&gt;To demonstrate the usage with VSCode, we will test a react app as an example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~
&lt;span class="nb"&gt;mkdir &lt;/span&gt;demo
npx create-react-app &lt;span class="nb"&gt;test
cd test
&lt;/span&gt;code &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will open VSCode in our windows environment. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;While loading VSCode for the first time from WSL, it will take some time, but it is a one time process.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now if you open VSCode's integrated terminal, you can see that it is opening the bash shell of our distro and not windows' shell. The same applies to the VSCode's integrated git feature as well.&lt;/p&gt;

&lt;p&gt;Now if you move to the extensions tab in VSCode, you can see it requires us to install some extensions separately for WSL. Go ahead and install them and reload VSCode.&lt;/p&gt;

&lt;p&gt;Now from VSCode's integrated terminal, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start our development server at &lt;a href="http://localhost:3000/"&gt;localhost:3000&lt;/a&gt;, and it will automatically open the app in browser. Here it will open in windows' default browser with same localhost and same port. How cool is that. Two OS share the same localhost.&lt;/p&gt;

&lt;p&gt;Now the procedure is pretty much the same for express or other Node based applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;p&gt;One nice and neat trick, in your distro's terminal, in any directory, run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;explorer.exe &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Don't forget the dot. Dot means open the mentioned program with the current working directory as the path for that program. Without dot, it will simply open the program's default window&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This will open the current working directory in windows explorer. Just like with nautilus or with any other linux file manager, when you have used linux with a GUI desktop env.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Get Started with WSL 2</title>
      <dc:creator>Vishnu</dc:creator>
      <pubDate>Sun, 05 Jul 2020 07:01:36 +0000</pubDate>
      <link>https://dev.to/vishnumohanrk/setup-wsl-2-hop</link>
      <guid>https://dev.to/vishnumohanrk/setup-wsl-2-hop</guid>
      <description>&lt;h1&gt;
  
  
  How to setup WSL 2
&lt;/h1&gt;

&lt;p&gt;Before we begin, update Windows to the latest version.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Version&lt;/strong&gt;: 2004&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OS Build&lt;/strong&gt;: 19041 or later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can check this by going to Settings =&amp;gt; Update and Security =&amp;gt; OS build Info&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In this post, we will setup Ubuntu 20.04, but the procedure is same, only name and download links differ, at the end of the post, I will leave links for other distros&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install &lt;a href="https://scoop.sh/"&gt;Scoop&lt;/a&gt; or &lt;a href="https://chocolatey.org/"&gt;Chocolatey&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;These are package managers for Windows.&lt;/p&gt;

&lt;p&gt;We need a package manager for installing &lt;a href="https://github.com/DDoSolitary/LxRunOffline"&gt;LxRunOffline&lt;/a&gt;,  a WSL management tool. It is useful for installing, uninstalling, moving our distros.&lt;/p&gt;

&lt;p&gt;To install scoop, Open Powershell as Admin and execute&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;Invoke-Expression&lt;/span&gt; &lt;span class="s"&gt;(New-Object System.Net.WebClient)&lt;/span&gt;&lt;span class="nf"&gt;.DownloadString&lt;/span&gt;&lt;span class="s"&gt;('https://get.scoop.sh')&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A quick side note, Windows is finally getting an official package manager called &lt;a href="https://devblogs.microsoft.com/commandline/windows-package-manager-preview/"&gt;Winget&lt;/a&gt;. But now we will use either of the above.&lt;/p&gt;

&lt;p&gt;After scoop is installed successfully, install LxRunOffline by executing the following commands one by one in powershell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;scoop&lt;/span&gt; &lt;span class="nf"&gt;bucket&lt;/span&gt; &lt;span class="nb"&gt;add&lt;/span&gt; &lt;span class="nf"&gt;extras&lt;/span&gt;
&lt;span class="nf"&gt;scoop&lt;/span&gt; &lt;span class="nf"&gt;install&lt;/span&gt; &lt;span class="nf"&gt;lxrunoffline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Enable WSL 2
&lt;/h2&gt;

&lt;p&gt;WSL is a optional feature, so you have to manually enable it to use it.&lt;br&gt;
To do so, in Powershell (as admin), execute the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;dism.exe&lt;/span&gt; &lt;span class="nv"&gt;/online&lt;/span&gt; &lt;span class="nv"&gt;/enable-feature&lt;/span&gt; &lt;span class="nv"&gt;/featurename:Microsoft-Windows-Subsystem-Linux&lt;/span&gt; &lt;span class="nv"&gt;/all&lt;/span&gt; &lt;span class="nv"&gt;/norestart&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To upgrade to WSL 2, you must enable another optional feature, "Virtual Machine Platform"&lt;br&gt;
This can be done by executing the following in Powershell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;dism.exe&lt;/span&gt; &lt;span class="nv"&gt;/online&lt;/span&gt; &lt;span class="nv"&gt;/enable-feature&lt;/span&gt; &lt;span class="nv"&gt;/featurename:VirtualMachinePlatform&lt;/span&gt; &lt;span class="nv"&gt;/all&lt;/span&gt; &lt;span class="nv"&gt;/norestart&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After completion, &lt;strong&gt;Restart&lt;/strong&gt; your system.&lt;/p&gt;

&lt;p&gt;After boot, Set WSL 2 as default version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt; &lt;span class="nf"&gt;--set-default-version&lt;/span&gt; &lt;span class="mf"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install distro
&lt;/h2&gt;

&lt;p&gt;There are quite a few distros available to install from. You can directly install any one or more from Microsoft store or manually from powershell. The problem with installing from store is that by default, all apps from store, if you have not changed the settings, will be saved in the system drive - "C" drive.&lt;/p&gt;

&lt;p&gt;So, if you don't want to save all your project files (that you will be working with in WSL) in C drive. Consider not to save the distro in C drive, rather in another partition.&lt;/p&gt;

&lt;p&gt;So, installing distro manually through Powershell is the best option.&lt;br&gt;
&lt;strong&gt;Navigate to the directory, where you want to save the distro image&lt;/strong&gt;, in Powershell and execute&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;Invoke-WebRequest&lt;/span&gt; &lt;span class="nf"&gt;-Uri&lt;/span&gt; &lt;span class="nf"&gt;https:&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="nv"&gt;/aka.ms/wslubuntu2004&lt;/span&gt; &lt;span class="nf"&gt;-OutFile&lt;/span&gt; &lt;span class="nf"&gt;Ubuntu.appx&lt;/span&gt; &lt;span class="nf"&gt;-UseBasicParsing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will download Ubuntu 20.04 image to the current working directory.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you want to install other distro, check the end of the post for links, then replace the link in the above command with that link.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After successful download, execute the following commands one by one in powershell&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;move&lt;/span&gt; &lt;span class="nf"&gt;.\Ubuntu.appx&lt;/span&gt; &lt;span class="nf"&gt;.\Ubuntu.zip&lt;/span&gt;
&lt;span class="nf"&gt;Expand-Archive&lt;/span&gt; &lt;span class="nf"&gt;.\Ubuntu.zip&lt;/span&gt;
&lt;span class="nf"&gt;cd&lt;/span&gt; &lt;span class="nf"&gt;.\Ubuntu\&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, inside this directory you will have a tarball named &lt;code&gt;install.tar.gz&lt;/code&gt;, we will use it with the WSL management tool that we installed in the beginning.&lt;/p&gt;

&lt;p&gt;Now , in Powershell, execute&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;lxrunoffline&lt;/span&gt; &lt;span class="nf"&gt;install&lt;/span&gt; &lt;span class="nf"&gt;-n&lt;/span&gt; &lt;span class="nf"&gt;Ubuntu-20.04&lt;/span&gt; &lt;span class="nf"&gt;-d&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nf"&gt;install-dir&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;-f&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nf"&gt;distro&lt;/span&gt; &lt;span class="nf"&gt;img&lt;/span&gt; &lt;span class="nf"&gt;dir&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;\install.tar.gz&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where &lt;code&gt;&amp;lt;install-dir&amp;gt;&lt;/code&gt; is where you have want your distro, with its entire file system to live, and &lt;code&gt;&amp;lt;distro img dir&amp;gt;&lt;/code&gt; is where you have installed your distro image (this will probably be your current working directory, if you have been following along).&lt;/p&gt;

&lt;p&gt;Now this will install the distro, in the &lt;code&gt;&amp;lt;install-dir&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify installation
&lt;/h2&gt;

&lt;p&gt;[All commands in Powershell]&lt;/p&gt;

&lt;p&gt;To check installed distros, with status and WSL version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt; &lt;span class="nf"&gt;--list&lt;/span&gt; &lt;span class="nf"&gt;--verbose&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To change WSL version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt; &lt;span class="nf"&gt;--set-version&lt;/span&gt; &lt;span class="nf"&gt;Ubuntu-20.04&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nf"&gt;ver-num&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;ver-num&amp;gt;&lt;/code&gt; is 1 or 2.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;WSL 2 is recommended.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To check distro location,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;lxrunoffline&lt;/span&gt; &lt;span class="nf"&gt;get-dir&lt;/span&gt; &lt;span class="nf"&gt;-n&lt;/span&gt; &lt;span class="nf"&gt;Ubuntu-20.04&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;replace Ubuntu-20.04 with name of the distro you installed&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Open the distro's Terminal
&lt;/h2&gt;

&lt;p&gt;Open powershell and execute&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have only one distro installed, then it will be set as default, and it will open.&lt;br&gt;
If you have installed multiple distros, to set one as default, execute&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight postscript"&gt;&lt;code&gt;&lt;span class="nf"&gt;wsl&lt;/span&gt; &lt;span class="nf"&gt;--set-default&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nf"&gt;distro-name&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now execute the first command to open the default distro.&lt;/p&gt;

&lt;p&gt;The distro's terminal will open inside Powershell.&lt;/p&gt;

&lt;h3&gt;
  
  
  References and Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;WSL docs =&amp;gt; &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/"&gt;https://docs.microsoft.com/en-us/windows/wsl/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Available Distro Links =&amp;gt; &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros"&gt;https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Why to use Linux File System for WSL projects and not Windows' =&amp;gt;  &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/compare-versions#use-the-linux-file-system-for-faster-performance"&gt;https://docs.microsoft.com/en-us/windows/wsl/compare-versions#use-the-linux-file-system-for-faster-performance&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PS: This is my first blog post, feedback appreciated.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
