3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WSL2をインストールしてUbuntu20を動かす。

Posted at

もうすぐ公式リリースのためか、公式サイトからインストール方法が削除されていますので、
メモ代わりに載せておきます。

OSバージョンの確認

[ここに入力して検索]からpowershellを入れて、管理者として実行するを押して、Powershellを起動します。ここから先は、管理者モードのほうが間違いないです。

systeminfo | Select-String "^OS"

OS バージョン: 10.0.18363 N/A ビルド 18363

Windows Builds 18917 以上が必要です。
ビルドバージョンが全然足りなかったので、インサイダープログラムに参加します。

2020-05-13 15_37_46-Register to become an Insider _ Windows Insider Program.png

SUBMITを押して参加します。

Slow か Fast を選択します。

設定の更新とセキュリティの左から Windows Insider Programを開始します。

2020-05-13 15_40_27-設定.png

再起動後に、ウインドウズアップデートします。

一度入らなくて、再度インストールすると入りました。
OS バージョン: 10.0.19041 N/A ビルド 19041

WSL1をインストール

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

WSL2を有効化

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
wsl --set-default-version 2

終わったら再起動します。

インストールUbuntu20

Microsoft Storeを開いてUbuntuで検索します。
今回はUbuntu20をインストールしました。

WSL2をセットする。

wsl --set-version Ubuntu-20.04 2

もし、BIOSがと言われたら再起動が必要です。

WSL 2 を実行するには、カーネル コンポーネントの更新が必要です。詳細については https://aka.ms/wsl2kernel を参照してください
すぐ、返答が返ってくるので、おかしいと思ったらカーネル更新パッケージが必要なようです。

カーネル更新パッケージを当てる。

再度実行する。

wsl --set-default-version 2

返答が返ってくるまでしばらく待ちます。
動いているか気になる場合には、タスクマネージャーで、Vmmemが上に来ているかで確認できるのと、tempファイルの作成で確認できます。

2020-05-13 18_58_48-Window.png

WSLバージョン確認

wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-20.04    Stopped         2

これで、完了です。
あとは、ubuntuを起動すればWSL2で動かせます。

参考:
https://medium.com/@gmusumeci/linux-on-windows-totally-how-to-install-wsl-1-and-wsl-2-307c9dd38a36

3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?