From e64b880da130eb18e81c599b8410b6880ac52465 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 27 Apr 2024 00:24:50 +0200 Subject: [PATCH] windows: added wsl --- wiki/windows/wsl.md | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 wiki/windows/wsl.md diff --git a/wiki/windows/wsl.md b/wiki/windows/wsl.md new file mode 100644 index 0000000..8a94ab2 --- /dev/null +++ b/wiki/windows/wsl.md @@ -0,0 +1,62 @@ +# WSL + +[WSL](https://learn.microsoft.com/en-us/windows/wsl/) - short for Windows Subsystem for Linux - is +a Tool of [Windows](/wiki/windows.md) that allows users and developers to run a +[Linux](/wiki/linux.md) environment. + +## Setup + +WSL ist preinstalled on the newer Windows versions. +Then the distribution to run may have to be [installed](#installing-a-distribution). + +## Usage + +### Installing a Distribution + +First make sure to update WSL. +This can be done by running the following command. + +```powershell +wsl --update +``` + +If the Microsoft Store is disabled on the system the command needs to be adapted. + +```powershell +wsl --update --web-download +``` + +Then the distribution will be installed. +First get the name of the distribution to be installed. +This can be done by running the following command. + +```powershell +wsl.exe -l -o +``` + +Afterwards install the distribution. +`` is the name of the distribution obtained in the previous stepa. + +```powershell +wsl.exe --install -d +``` + +On systems that have the Microsoft store disabled the distribution needs to be imported instead. +For this a file system image of the distribution inside a tar archive is needed. +These archives can be found on the websites of the distribution. +For example Ubuntu file system images can be found +[on their cloud image site](https://cloud-images.ubuntu.com/wsl/noble/current/). +`` should be set to the name of the distribution. +`` is the path where the systems files will be stored. +`` is the path to the file obtained from the distributions website. + +```powershell +wsl --import +``` + +Afterwards the default distribution may have to be set. +Once again `` is the name of the distribution to make the new default. + +```powershell +wsl --setdefault +```