windows:wsl:trouble_shooting

WSL 2 トラブルシューティング

WSL2 トラブルシューティング 001

WSL 2 で問題が発生して解決しない場合は、GitHub の Issues · microsoft/WSL で最新情報を確認しましょう。

$ bash
???? ?????? ???????????
リモート プロシージャ コールに失敗しました。
 
[プロセスはコード 4294967295 で終了しました]

WSL のインストール状況

$ wsl -l -v
  NAME             STATE           VERSION
* FedoraRemix      Stopped         2
  Fedora           Stopped         2
  Fedora32-WSL1    Stopped         1
  Fedora32         Stopped         2

WSL 1 だと起動するときもあるので念のため確認

$ LxRunOffline r -n Fedora32-WSL1
リモート プロシージャ コールに失敗しました。

WSL1, WSL2 ともに全滅です。潔く諦めましょう😅💦💦💦
昨日の最新情報: WSL2 distro can't start: the remote procedure call failed (build 20211) · Issue #5907 · microsoft/WSL

動かないものは諦めて Hyper-V - ハイパーバイザベース仮想化 で暮らすのも手です。
つまり、軽量ユーティリティ VM ではなく、重量ハイパーバイザー VM を使うと言うことです。

どうしても WSL を使用したい場合は [設定] - [更新とセキュリティ] - [回復] へ行き、「まえのバージョンの Windows 10 に戻す」 を実行する。(ディスク クリーンアップ (cleanmgr.exe)以前の Windows のインストール を破棄してしまった場合は、これが不可能なので次の更新で改善されるのを待つしたありません)

wsl コマンドのヘルプも半分以上英語で中途半端に日本語です😅💦💦💦(徹夜で作ったのかな❓)

$ wsl --help
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 <CommandLine>
        Execute the specified command without using the default Linux shell.
 
    --
        Pass the remaining command line as is.
 
Options:
    --distribution, -d <Distro>
        Run the specified distribution.
 
    --user, -u <UserName>
        Run as the specified user.
 
Arguments for managing Windows Subsystem for Linux:
 
    --export <Distro> <FileName>
        Exports the distribution to a tar file.
        The filename can be - for standard output.
 
    --import <Distro> <InstallLocation> <FileName> [Options]
        Imports the specified tar file as a new distribution.
        The filename can be - for standard input.
 
        Options:
            --version <Version>
                Specifies the version to use for the new distribution.
 
    --list, -l [Options]
        Lists distributions.
 
        Options:
            --all
                List all distributions, including distributions that are currently
                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, -s <Distro>
        Sets the distribution as the default.
 
    --set-default-version <Version>
        Changes the default install version for new distributions.
 
    --set-version <Distro> <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, -t <Distro>
        Terminates the specified distribution.
 
    --unregister <Distro>
        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.
 
    --マウント <Disk>
        すべての WSL2 配布に物理ディスクをアタッチしてマウントします。
 
        オプション:
            --ベア
                ディスクを WSL2 に接続しますが、マウントしないでください。
 
    --入力 <Type>
        ディスクのマウント時に使用するファイルシステムです。指定しない場合は、既定で ext4 になります。

OS 情報

$ Get-CimInstance Win32_OperatingSystem | Format-List
SystemDirectory : C:\WINDOWS\system32
Organization    :
BuildNumber     : 20211
RegisteredUser  : tomoyan
SerialNumber    : 00330-80000-00000-AA490
Version         : 10.0.20211

WSL ステータス

$ wsl --status
Default Distribution: FedoraRemix
Default Version: 2
 
Linux 用 Windows サブシステムの最終更新日: 2020/09/10
WSL の自動更新が有効になっています。
カーネル バージョン: 4.19.128

以下のように表示されて bash が起動しない。

WSL 2

もしくは、

WSL 2
[プロセスはコード 4294967295 で終了しました]

Windows バージョンは以下の通り。

$ cmd /c ver
Microsoft Windows [Version 10.0.19645.1]

Build 19645.mn_release.20065-1502WSL 2 が動作しないことに気が付いた。

WSL 1 のディストリビューションは動作するか?

$ wsl -l -v
  NAME           STATE           VERSION
* fedoraremix    Stopped         2
  Fedora         Stopped         2
  Fedora-WSL1    Stopped         1

WSL 1 のディストリビューションを起動する。

$ wsl -d Fedora-WSL1
[root@Cmon tomoyan]# uname -a
Linux Cmon 4.4.0-19645-Microsoft #1-Microsoft Thu Jun 05 15:02:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux

WSL 1 のディストリビューションは問題なく動作するので、利用したいディストリビューションを WSL 1 に戻して、不具合が解消されるまで待つことにする。

$ wsl --set-version fedoraremix 1

しかし、今回は WSL 2 から WSL 1 に変換しようとしても、WSL 2 と表示されるだけで変換すらできない。

変換中です。この処理には数分かかることがあります...
WSL 2

このような場合は潔く諦める。😅💦💦💦笑
(うそです。Windows Update を確認しましょう。)

$ sudo netsh winsock reset
Winsock カタログをリセットしました。
リセットを完了するためにコンピューターを再起動する必要があります。

WSL 2 - Custom Kernel - Process exited with code 4294967295 · Issue #4904 · microsoft/WSL

WSL 2 プロセス 終了コード 4294967295 Windows Update

更新後に bash を起動する。

$ uname -a
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

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

>

※プロンプトが $ に切り替わらない。

wsl –set-version <Distro> 2 を実行する。
※ここでは <Distro> は fedoraremix である。

> wsl -l -v
  NAME           STATE           VERSION
* fedoraremix    Stopped         2

> wsl --set-version fedoraremix 1
Conversion in progress, this may take a few minutes...
Conversion complete.

> wsl -l -v
  NAME           STATE           VERSION
* fedoraremix    Stopped         1

> bash
$

※WSL 1 だとプロンプトが $ に切り替わる。

wsl –set-version <Distro> 2 を実行する。
※ここでは <Distro> は fedoraremix である。

>wsl -l -v
  NAME           STATE           VERSION
* fedoraremix    Running         1

> 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://aka.ms/wsl2
Conversion complete.

> wsl -l -v
  NAME           STATE           VERSION
* fedoraremix    Stopped         2

> bash

>

※WLS 2 だとプロンプトが $ に切り替わらない。
原因不明なのでひとまず WSL 1 で使用することとする。

  • windows/wsl/trouble_shooting.txt
  • 最終更新: 2020/09/16 06:51
  • by ともやん