DEV Community

ComCl7
ComCl7

Posted on

Exploring WSL on Windows

Hi together,

when using Windows and writing IaC, you are almost in need to install a linux emulation as some of needed binarys like ansible.
Or, as it comes to me personally, I like to work in a linux environment to use some advantages as easy to use package manager.

In this article, I don't really want to go into every detail and just want to show you:

  • How to install WSL and a Distro
  • Reset your Distro, if you want to start over.

Install WSL and Distro

  1. Open your command line (cmd or powershell)
  2. Type wls --install
  3. Accept User Access Control request, if necessary
  4. Wait for installation

Install WSL

  1. Now type in wsl to install default distro (in my case ubuntu) and type in a username, password and set metrics. After that, the distro should be installed succesfully

Configure Ubuntu

  1. To get out, you can type exit and enter

List distro's

You can list your distro' using wsl -l

WSLK List Distro's

Remove distro

Sometimes you need to delete the distro, for example if you need a new environment if you want to start over again after something went wrong.

To do this, you can just open your command line and type wsl --unregister ubuntu (instead of Ubuntu, you can type your distro used)

WSL Remove Distros

Top comments (0)