wsl.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 28 Nov 2020 14:37:48 +0200
changeset 2469 d6eb5318b6ff
parent 2459 607f6d056e26
child 2486 796bbf279e20
permissions -rw-r--r--
Automatically Configuring WSL.


==================================
 WSL, Windows subsystem for Linux
==================================
.. contents::
   :local:

Documentation
=============

https://docs.microsoft.com/en-us/windows/wsl/
  Windows Subsystem for Linux Documentation.
https://github.com/sirredbeard/Awesome-WSL
  Awesome list dedicated to Windows Subsystem for Linux.
https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/
  Automatically Configuring WSL.

wsl utility
===========

Run Linux command from default distro::

  wsl ls
  wsl -e /bin/ls
  wsl --exec /bin/bash

Run Linux command from specific distro::

  wsl -d ubuntu ls
  wsl -d debian -e /bin/ls
  wsl -d debian --exec /bin/bash
  wsl -distribution debian --exec /bin/bash

Run Linux command from specific user::

  wsl -u user ls
  wsl --user root ls

Combining user & distro::

  wsl -u root -d alpine -- ls

https://docs.microsoft.com/en-us/windows/wsl/wsl-config
  Ways to run WSL.

wslconfig utility
=================

List distros::

  wslconfig /l
  wslconfig /list

Set default distro::

  wslconfig /s debian
  wslconfig /setdefault debian

Terminate any running parts of distro::

  wslconfig /s debian
  wslconfig /terminate debian

Mounting external drives
========================

::

  sudo mkdir /mnt/f
  sudo mount -t drvfs f: /mnt/f

https://docs.microsoft.com/en-us/windows/wsl/wsl-config
  ``/etc/wsl.conf`` configuration options.