cmd または powershell をインストールするとき、または Linux を開くときに、次のエラーが不可解に発生しました。
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8007023e
Error: 0x8007023e {
Application Error}
The exception s (0x
たくさんの方法を試しましたが失敗しました。最終的に次の方法を試しました。おそらくうまくいくでしょう。
- BIOS で仮想化が有効になっていることを確認してください。(以前は使いやすかったのに突然機能しなくなったため、このステップでは何も設定しませんでした。これはオンになっているはずだと盲目的に推測していました)
- Windows イメージとオペレーティング システムが正常に動作していることを確認してください。
- すべての Hyper-V 設定をメモし、バックアップしてください。(バックアップも取っていませんでした。念のため、次回からは覚えておく必要があります)
- すべての仮想マシンの機能を削除します。つまり、Hyper-V、コンテナー、仮想マシン プラットフォーム、Windows ハイパーバイザー プラットフォーム、Windows サンドボックス、および Linux 用 Windows サブシステムです。対応するオプションは削除できます。
-
コンピューターを再起動してください!
-
その後、次を使用して
wsl --set-default-version 2
wsl2 に設定します -
コマンド
wsl --install
を使用してインストールします。エラー 0x80370114 が発生した場合は、コマンドを実行してEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
y を入力します。
-
再起動後は実行
wsl --install
できるようになります
PS C:\WINDOWS\system32> wsl --install
Ubuntu 已安装。
正在启动 Ubuntu...
Installing, this may take a few minutes...
Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: ***
New password:
Retype new password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
This message is shown once a day. To disable it please create the