# Evaluation of WSL 2 ## Environment - OS: Windows 10 Home Edition - CPU: Intel i3-4130 - Memory: 8GB ## Install - Download [wsl_update](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) and [Docker Desktop](https://desktop.docker.com/win/stable/amd64/Docker%20Desktop%20Installer.exe) - Run PowerShell as Administrator - Enable WSL ``` dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart ``` - Restart computer - Install **`wsl_update_x64.msi`** and **`Docker Desktop Installer.exe`** - Get Linux from [Microsoft Store](https://aka.ms/wslstore) - Set WSL 2 as default and start ``` wsl --set-default-version 2 wsl ``` - Install docker ``` apt update apt upgrade apt install docker.io ``` ## Compare with VirtualBox | 比較項目 | VirtualBox | WSL 2 | | -------- | ---------------------------- |:----------------------------------------------------------------- | | 作業系統 | Popular 64bit OS | Windows 10 / Windows Server 2019 | | 手動安裝 | 安裝vbox並匯入vm image | 安裝wsl更新檔及Docker Desktop, 輸入PowerShell指令, 過程需要重開機 | | 自動安裝 | 將vbox和image包裝成installer | 將安裝檔和指令包裝成installer, 過程需要重開機 | | Effort | 修改現有的ezmaster installer | 需要製作新的installer | | Usage | 1GB memory | [5GB memory](https://i.imgur.com/aoAR8iu.png)| ## Conclusions - 安裝步驟繁瑣且需要重開機 - 支援的作業系統少 - Linux只能從Microsoft Store取得 (待確認) - 耗費的記憶體過高 (可進一步研究如調整) - 較適合開發者而非一般使用者 ## References - https://docs.microsoft.com/zh-tw/windows/wsl/install-win10 - https://docs.docker.com/docker-for-windows/install/ - https://clay-atlas.com/blog/2020/10/12/windows-cn-wsl-2-memory-config/