差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| windows:wsl:trouble_shooting [2020/09/13 03:54] – 作成 ともやん | windows:wsl:trouble_shooting [2020/09/16 06:51] (現在) – ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== トラブルシューティング ====== | + | ====== | 
| + | {{windows: | ||
| - | ===== WSL 2 が起動しない場合 ===== | + | ===== WSL 2 が起動しない場合... ===== | 
| + | WSL 2 で問題が発生して解決しない場合は、GitHub の [[https:// | ||
| + | |||
| + | ==== リモート プロシージャ コールに失敗する (Windows 10 Pro Insider Preview Build 20211.rs_prerelease.200904-1619) で発生 | ||
| <WRAP prewrap 100%> | <WRAP prewrap 100%> | ||
| <code powershell> | <code powershell> | ||
| 行 17: | 行 21: | ||
| </ | </ | ||
| </ | </ | ||
| + | |||
| + | **WSL のインストール状況**\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ wsl -l -v | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| + | NAME | ||
| + | * FedoraRemix | ||
| + | Fedora | ||
| + | Fedora32-WSL1 | ||
| + | Fedora32 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | **WSL 1** だと起動するときもあるので念のため確認\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ LxRunOffline r -n Fedora32-WSL1 | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| + | リモート プロシージャ コールに失敗しました。 | ||
| + | </ | ||
| + | </ | ||
| + | **WSL1, WSL2** ともに全滅です。潔く諦めましょう😅💦💦💦\\ | ||
| + | 昨日の最新情報: | ||
| + | |||
| + | 動かないものは諦めて [[windows: | ||
| + | つまり、軽量ユーティリティ VM ではなく、重量ハイパーバイザー VM を使うと言うことです。\\ | ||
| + | |||
| + | どうしても WSL を使用したい場合は **[設定] - [更新とセキュリティ] - [回復]** へ行き、**「まえのバージョンの Windows 10 に戻す」** を実行する。(**ディスク クリーンアップ (cleanmgr.exe)** で **以前の Windows のインストール** を破棄してしまった場合は、これが不可能なので次の更新で改善されるのを待つしたありません)\\ | ||
| + | {{windows: | ||
| + | {{windows: | ||
| + | |||
| + | **wsl** コマンドのヘルプも半分以上英語で中途半端に日本語です😅💦💦💦(徹夜で作ったのかな❓)\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ wsl --help | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% # | ||
| + | <code powershell> | ||
| + | Copyright (c) Microsoft Corporation. All rights reserved. | ||
| + | |||
| + | Usage: wsl.exe [Argument] [Options...] [CommandLine] | ||
| + | |||
| + | Arguments for running Linux binaries: | ||
| + | |||
| + | If no command line is provided, wsl.exe launches the default shell. | ||
| + | |||
| + | --exec, -e < | ||
| + | Execute the specified command without using the default Linux shell. | ||
| + | |||
| + | -- | ||
| + | Pass the remaining command line as is. | ||
| + | |||
| + | Options: | ||
| + | --distribution, | ||
| + | Run the specified distribution. | ||
| + | |||
| + | --user, -u < | ||
| + | Run as the specified user. | ||
| + | |||
| + | Arguments for managing Windows Subsystem for Linux: | ||
| + | |||
| + | --export < | ||
| + | Exports the distribution to a tar file. | ||
| + | The filename can be - for standard output. | ||
| + | |||
| + | --import < | ||
| + | Imports the specified tar file as a new distribution. | ||
| + | The filename can be - for standard input. | ||
| + | |||
| + | Options: | ||
| + | --version < | ||
| + | Specifies the version to use for the new distribution. | ||
| + | |||
| + | --list, -l [Options] | ||
| + | Lists distributions. | ||
| + | |||
| + | Options: | ||
| + | --all | ||
| + | List all distributions, | ||
| + | being installed or uninstalled. | ||
| + | |||
| + | --running | ||
| + | List only distributions that are currently running. | ||
| + | |||
| + | --quiet, -q | ||
| + | Only show distribution names. | ||
| + | |||
| + | --verbose, -v | ||
| + | Show detailed information about all distributions. | ||
| + | |||
| + | --set-default, | ||
| + | Sets the distribution as the default. | ||
| + | |||
| + | --set-default-version < | ||
| + | Changes the default install version for new distributions. | ||
| + | |||
| + | --set-version < | ||
| + | Changes the version of the specified distribution. | ||
| + | |||
| + | --shutdown | ||
| + | Immediately terminates all running distributions and the WSL 2 lightweight utility virtual machine. | ||
| + | |||
| + | --status | ||
| + | Show the status of Windows Subsystem for Linux. | ||
| + | |||
| + | --terminate, | ||
| + | Terminates the specified distribution. | ||
| + | |||
| + | --unregister < | ||
| + | Unregisters the distribution and deletes the root filesystem. | ||
| + | |||
| + | --update [Options] | ||
| + | Manage updates to the WSL 2 kernel. If no options are specified, this will | ||
| + | update to the latest kernel version. | ||
| + | |||
| + | Options: | ||
| + | --rollback | ||
| + | Revert to the previous version of the WSL 2 kernel. | ||
| + | |||
| + | --help | ||
| + | Display usage information. | ||
| + | |||
| + | --マウント < | ||
| + | すべての WSL2 配布に物理ディスクをアタッチしてマウントします。 | ||
| + | |||
| + | オプション: | ||
| + | --ベア | ||
| + | ディスクを WSL2 に接続しますが、マウントしないでください。 | ||
| + | |||
| + | --入力 < | ||
| + | ディスクのマウント時に使用するファイルシステムです。指定しない場合は、既定で ext4 になります。 | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | **OS 情報**\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ Get-CimInstance Win32_OperatingSystem | Format-List | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| + | |||
| + | SystemDirectory : C: | ||
| + | Organization | ||
| + | BuildNumber | ||
| + | RegisteredUser | ||
| + | SerialNumber | ||
| + | Version | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | **WSL ステータス**\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ wsl --status | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | <code powershell> | ||
| + | Default Distribution: | ||
| + | Default Version: 2 | ||
| + | |||
| + | Linux 用 Windows サブシステムの最終更新日: | ||
| + | WSL の自動更新が有効になっています。 | ||
| + | カーネル バージョン: | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== 「WSL 2 プロセスはコード 4294967295 で終了しました」が発生する場合 ===== | ||
| + | 以下のように表示されて bash が起動しない。\\ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | WSL 2 | ||
| + | </ | ||
| + | </ | ||
| + | もしくは、\\ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | WSL 2 | ||
| + | [プロセスはコード 4294967295 で終了しました] | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Windows バージョンは以下の通り。\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ cmd /c ver | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | |||
| + | Microsoft Windows [Version 10.0.19645.1] | ||
| + | </ | ||
| + | </ | ||
| + | **Build 19645.mn_release.20065-1502** で **WSL 2** が動作しないことに気が付いた。\\ | ||
| + | |||
| + | ==== このような時に試すこと ==== | ||
| + | **WSL 1** のディストリビューションは動作するか?\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ wsl -l -v | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | NAME | ||
| + | * fedoraremix | ||
| + | Fedora | ||
| + | Fedora-WSL1 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | **WSL 1** のディストリビューションを起動する。\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ wsl -d Fedora-WSL1 | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | [root@Cmon tomoyan]# uname -a | ||
| + | Linux Cmon 4.4.0-19645-Microsoft # | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | **WSL 1** のディストリビューションは問題なく動作するので、利用したいディストリビューションを **WSL 1** に戻して、不具合が解消されるまで待つことにする。\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ wsl --set-version fedoraremix 1 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | しかし、今回は **WSL 2** から **WSL 1** に変換しようとしても、**WSL 2** と表示されるだけで変換すらできない。\\ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | 変換中です。この処理には数分かかることがあります... | ||
| + | WSL 2 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | このような場合は潔く諦める。😅💦💦💦笑\\ | ||
| + | (うそです。Windows Update を確認しましょう。)\\ | ||
| + | |||
| + | ==== ちなみに以下の方法では解決しなかった ==== | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ sudo netsh winsock reset | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | |||
| + | Winsock カタログをリセットしました。 | ||
| + | リセットを完了するためにコンピューターを再起動する必要があります。 | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ==== 最新の Windows Update で更新する ==== | ||
| + | {{: | ||
| + | |||
| + | 更新後に **bash** を起動する。\\ | ||
| + | <WRAP prewrap 100%> | ||
| + | <code powershell> | ||
| + | $ uname -a | ||
| + | </ | ||
| + | </ | ||
| + | <WRAP prewrap 100% #result> | ||
| + | < | ||
| + | Linux Cmon-wsl 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ===== WSL 2 で bash に接続されない場合 (Windows 10 Prp Insider Preview Build 19559.rs_prerelease.200131-1437 で発生) ===== | ||
| + | **2020/2/21 - build 19564.rs_prerelease.200207-1438** で改善\\ | ||
| + | < | ||
| + | Microsoft Windows [Version 10.0.19559.1000] | ||
| + | (c) 2020 Microsoft Corporation. All rights reserved. | ||
| + | |||
| + | > bash | ||
| + | |||
| + | > bash | ||
| + | |||
| + | > | ||
| + | </ | ||
| + | **※プロンプトが $ に切り替わらない。**\\ | ||
| + | |||
| + | ==== Windows Subsystem for Linux 1 (WSL 1) を使用するようにディストリビューションを設定してみる ==== | ||
| + | **wsl –set-version < | ||
| + | ※ここでは < | ||
| + | \\ | ||
| + | < | ||
| + | > wsl -l -v | ||
| + | NAME | ||
| + | * fedoraremix | ||
| + | |||
| + | > wsl --set-version fedoraremix 1 | ||
| + | Conversion in progress, this may take a few minutes... | ||
| + | Conversion complete. | ||
| + | |||
| + | > wsl -l -v | ||
| + | NAME | ||
| + | * fedoraremix | ||
| + | |||
| + | > bash | ||
| + | $ | ||
| + | </ | ||
| + | **※WSL 1 だとプロンプトが $ に切り替わる。**\\ | ||
| + | |||
| + | ==== 再び Windows Subsystem for Linux 2 (WSL 2) を使用するようにディストリビューションを設定してみる ==== | ||
| + | **wsl –set-version < | ||
| + | ※ここでは < | ||
| + | \\ | ||
| + | < | ||
| + | >wsl -l -v | ||
| + | NAME | ||
| + | * fedoraremix | ||
| + | |||
| + | > wsl --set-version fedoraremix 1 | ||
| + | Conversion in progress, this may take a few minutes... | ||
| + | The distribution is already the requested version. | ||
| + | |||
| + | > wsl --set-version fedoraremix 2 | ||
| + | Conversion in progress, this may take a few minutes... | ||
| + | For information on key differences with WSL 2 please visit https:// | ||
| + | Conversion complete. | ||
| + | |||
| + | > wsl -l -v | ||
| + | NAME | ||
| + | * fedoraremix | ||
| + | |||
| + | > bash | ||
| + | |||
| + | > | ||
| + | </ | ||
| + | **※WLS 2 だとプロンプトが $ に切り替わらない。**\\ | ||
| + | 原因不明なのでひとまず WSL 1 で使用することとする。\\ | ||
| + | |||
