LoginSignup
19
16

More than 1 year has passed since last update.

WSL2(Ubuntu 22.04)環境を可能な限りコマンドラインでインストールする

Last updated at Posted at 2023-05-19

WSL2の手順が毎回手間に感じたので、可能な限りコマンドラインでインストールしたいです
ダイアログは数回でますが、基本ポチポチするだけです

Microsoft-Windows-Subsystem-LinuxとVirtualMachinePlatformを有効化

PowerShell 管理者実行

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all

再起動要求されるのでYで再起動

再起動後の続き wslのアップデート〜Ubuntu22.04インストールまで

PowerShell 管理者実行

wsl --set-default-version 2
wget https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi -OutFile wsl_update_x64.msi
msiexec /i wsl_update_x64.msi /passive
del wsl_update_x64.msi
wsl --update
wsl --install Ubuntu-22.04

成功するとUserとPasswordを聞いてくるので適切にいれてください

19
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
16