Installing WSL distor second time.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 09 Jun 2022 09:25:25 +0300
changeset 2534 f63a05c1ce4f
parent 2533 3d0d8ed75cb5
child 2535 6f7f3c2f40e1
Installing WSL distor second time.
wsl.rst
--- a/wsl.rst	Wed Jun 08 13:42:24 2022 +0300
+++ b/wsl.rst	Thu Jun 09 09:25:25 2022 +0300
@@ -49,6 +49,55 @@
 https://docs.microsoft.com/en-us/windows/wsl/wsl-config
   Ways to run WSL.
 
+Installing WSL distor second time
+=================================
+
+Microsoft provides certain Linux distros out of the box::
+
+  wsl --list --online
+  NAME            FRIENDLY NAME
+  Ubuntu          Ubuntu
+  Debian          Debian GNU/Linux
+  kali-linux      Kali Linux Rolling
+  openSUSE-42     openSUSE Leap 42
+  SLES-12         SUSE Linux Enterprise Server v12
+  Ubuntu-16.04    Ubuntu 16.04 LTS
+  Ubuntu-18.04    Ubuntu 18.04 LTS
+  Ubuntu-20.04    Ubuntu 20.04 LTS
+
+After the installation you will have an executable ``NAME.exe`` for convenient entering into
+distro, compare::
+
+  $ wsl -d NAME CMD
+  $ NAME.exe CMD
+
+You install such distros via::
+
+  wsl --install NAME
+
+What if you want 2 Debian distros? Unfortunately you have to deal with rootfs:
+
+* either export existing WSL distro::
+
+    wsl --export Alpine alpine.tar
+    wsl --import alpine-copy 'c:\srv\wsl\alpine-copy' alpine.tar
+
+* or use LXC / OCI rootfs (like one from https://alpinelinux.org/downloads/ or
+  http://cdimage.ubuntu.com/ubuntu-base/releases/)::
+
+    wget https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-minirootfs-3.16.0-x86_64.tar.gz
+    wsl --import alpine-x 'c:\srv\wsl\alpine-x' alpine-minirootfs-3.16.0-x86_64.tar.gz
+
+I'd suggest to use Ubuntu "base" images instead (less bloated than "cloud" images):
+
+* http://cdimage.ubuntu.com/ubuntu-base/releases - base images
+* https://cloud-images.ubuntu.com/releases/ - cloud images
+
+You download rootfs and import it::
+
+  wget http://cdimage.ubuntu.com/ubuntu-base/releases/22.04/release/ubuntu-base-22.04-base-amd64.tar.gz
+  wsl --import my-ubuntu c:\wsl\my-ubuntu ubuntu-base-22.04-base-amd64.tar.gz --version 2
+
 wslconfig utility
 =================
 
@@ -116,6 +165,9 @@
 https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/wsl.wprp
 https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1
 
+https://msrc-blog.microsoft.com/2018/12/10/first-steps-in-hyper-v-research/
+https://msrc-blog.microsoft.com/2019/09/11/attacking-the-vm-worker-process/
+
 Custom WSL 2 Linux kernel
 =========================