Install WSL 2 on Windows 10

Q

How to Install WSL (Windows Subsystem Linux) 2 on Windows 10?

✍: FYIcenter.com

A

There are two options to support Docker Desktop on Windows:

  • Using WSL (Windows Subsystem Linux) 2 - WSL 2 is a Windows tool that allows you to install a Linux distribution as an app from the Windows store. WSL 2 actually uses the Linux kernel running under Hyper-V.
  • Using Hyper-V - Hyper-V is hypervisor-based virtualization technology developed by Microsoft. It provides similar functionalities as VirtualBox and Fusion.

If you want to try WSL 2 on Windows 10, following this tutorial.

1. Run PowerShell as Administrator, and enter the suggested command to enable "Virtual Machine Platform" and "Windows Subsystem Linux" system components:

PS> Enable-WindowsOptionalFeature -Online \
  -FeatureName $("VirtualMachinePlatform", "Microsoft-Windows-Subsystem-Linux")

2. Your Windows system will be forced to restart.

3. Start Docker Desktop again. You see a new warning: "WSL 2 installation is incomplete."

4. Click the https://aka.ms/wsl2kernel link in the warning message.

5. Follow the instruction to download "wsl_update_x64.msi".

6. Double-click on "wsl_update_x64.msi" to install the update.

Windows WSL 2 - Install Update
Windows WSL 2 - Install Update

7. Restart the system again.

8. Open a "CMD" window, and run the "wsl" command. You see Linux shell started.

C:\Users\fyicenter\> wsl

FYI-WIN:/tmp/docker-desktop-root/mnt/host/c/Users/fyicenter# ls -l

drwxrwxrwx  root  root  4096 Sep 16  2020 AppData
lrwxrwxrwx  root  root    43 Sep 16  2020 Application Data -> /mnt/host/c/Users/fyicenter/AppData/Roaming
drwxrwxrwx  root  root  4096 Aug 16 06:37 Desktop
drwxrwxrwx  root  root  4096 Aug 16 08:10 Downloads
lrwxrwxrwx  root  root    41 Sep 16  2020 Local Settings -> /mnt/host/c/Users/fyicenter/AppData/Local
lrwxrwxrwx  root  root    37 Sep 16  2020 My Documents -> /mnt/host/c/Users/fyicenter/Documents
...

In the default WSL 2 Linux environment, the "C:/Users" directory is mapped to "/mnt/host/c/Users".

 

Run "getting-started" Docker on Windows 10

Install Docker Desktop 2.5.0 on Windows 10

Install Docker Desktop on Windows

⇑⇑ Docker Container Platform - Tutorials

2023-01-30, 1021🔥, 0💬