access running wsl distro code example

Example 1: windows how to access wsl from explorer

from explorer \\wsl$
from powershell: cd \\wsl$\<DistributionName> 

in my case DistributionName is Ubuntu20.04

Example 2: running docker in wsl

# Update the apt package list.
sudo apt-get update -y

# Install Docker's package dependencies.
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

# Download and add Docker's official public PGP key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

# Verify the fingerprint.
sudo apt-key fingerprint 0EBFCD88

# Add the `stable` channel's Docker upstream repository.
#
# If you want to live on the edge, you can change "stable" below to "test" or
# "nightly". I highly recommend sticking with stable!
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

# Update the apt package list (for the new apt repo).
sudo apt-get update -y

# Install the latest version of Docker CE.
sudo apt-get install -y docker-ce

# Allow your user to access the Docker CLI without needing root access.
sudo usermod -aG docker $USER

Example 3: how to access the local machine using WSL

You can access your local machine using Windows Linux subsystem by accessing mnt folder in the root directory of the bash.
Just type, cd / 
-- this will get you to the root folder.
Then type, cd mnt
-- this will get you inside the mnt directory
Then type, ls -ltr
-- this will list down the drives in your local computer. From here yo can access anything you want on your local computer.