概要
wordpress-developをインストールし、正常に起動できたが、その WordPress のプロジェクトを開発中に、Windows が強制シャットダウンした。
その結果、
"WSL integration with distro 'Ubuntu-24.04' unexpectedly stopped. Do you want to restart it?"
というメッセージが表示される ( Docker Desktop )
その後 Dockerコンテナを再度起動し、しばらく使用していると、WSLへの接続ができなくなる。( HCS_E_CONNECTION_TIMEOUT )
再現の流れ
1. WSL統合が有効なことを確認し、再起動
Settings>Resources>WSL integration
Click Restart the WSL Integration
2. WSL に接続 (vscode)
Ctrl Shift P > WSL に接続
3. シスログ ( WSL ) を確認
PowerShell 7.5.3
PS C:\Windows\System32> wsl -d Ubuntu-24.04
xxx@Ataraxia:/mnt/c/Windows/System32$ sudo journalctl -f
[sudo] password for xxx:
journalctlしてもなにもでてこない。
WSLではデフォルトでシステムログが無効になっている
Ubuntu-24.04 の /etc/wsl.conf に以下を追加:
[boot]
systemd=true
wsl を抜ける:
xxx@Ataraxia:/mnt/c/Windows/System32$ exit
その後、PowerShell で WSL を完全に再起動:
PS C:\Windows\System32> wsl --shutdown
PS C:\Windows\System32> wsl -d Ubuntu-24.04
システムログを表示:
xxx@Ataraxia:/mnt/c/Windows/System32$ sudo journalctl -f
WARNING Daemon: could not connect to Windows Agent: could not get address: could not read agent port file "/mnt/c/Users/cinem/.ubuntupro/.address": open /mnt/c/Users/cinem/.ubuntupro/.address: no such file or directory
Sep 28 11:47:16 Ataraxia wsl-pro-service[229]: INFO Reconnecting to Windows host in 60 seconds
シスログに出ているメッセージでググると↓
GitHub で issue が上がっていますが、解決策は特に提示されずにクローズされていました。
VS code 閉じる
普通に閉じる
WSL 起動
Wsl/Service/HCS_E_CONNECTION_TIMEOUT というエラーコードが出る。
PS C:\Users\cinem> wsl -d Ubuntu-24.04
仮想マシンまたはコンテナーからの応答が受信されなかったため、操作がタイムアウトしました。
エラー コード: Wsl/Service/HCS_E_CONNECTION_TIMEOUT
WSL の改善のためにできること
GitHubの WSL Issue Tracker にログを添えて報告する
Issue Tracker ってなんやねん
アイディア、フィードバック、課題、バグを追跡するもの
GitHub の仕様 (2025年 1月12日現在)
↓この GitHub Action bot が返信しているように「機能リクエスト」と「質問」以外は、isue あげてから 7日以内 に ログを 添付する必要がある。
WSLログを収集する方法
管理 PowerShell プロンプトでcollect-wsl-logs.ps1 をダウンロードして実行します。Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1スクリプトは完了するとログ ファイルのパスを出力します。
完了したら、出力ファイルをこの Github の問題にアップロードしてください。
これらのログをバグに添付するのではなく電子メールで送信する場合は、件名に github の問題番号、メッセージに github の問題へのコメントへのリンクを付けて、 wsl-gh-logs@microsoft.com に送信し、"/emailed-logs"と返信してください。
issue の方法
Understanding new issues
NoteYou'll need access to GitHub Copilot. For more information, see What is GitHub Copilot?.
When working on an unfamiliar or complex issue, GitHub Copilot can help you quickly understand the context, history, and key information, so you can get started faster and with more confidence.
Reviewing the issue:
Navigate to an issue on GitHub.
In the top right of any page on GitHub, click the icon next to the search bar.
The GitHub Copilot Chat panel is displayed. To resize the panel, click and drag the top or left edge.If the panel contains a previous conversation you had with Copilot, click the plus sign icon at the top right of the Copilot panel to start a new conversation.
At the bottom of the Copilot chat panel, in the "Ask Copilot" box, type a question and press Enter. For example, you could enter:
- Summarize the main points of this issue
- What’s the goal of this issue?
Copilot's summary will help you capture the purpose and scope of the work.
新しく issue をあげる方法の概要説明:
ただし、以下の点に注意してください
GitHub Copilot へのアクセスが必要です。詳細については、「GitHub Copilot とは?」をご覧ください。馴染みのない issue や複雑な issue に取り組む際に、GitHub Copilot を使用すると、コンテキスト、履歴、重要な情報を素早く理解できるため、より迅速かつ自信を持って作業を開始できます。
以下のようにして issue を確認します:
- GitHub で issue に移動します。
- GitHub の任意のページの右上にある検索バーの横にあるアイコンをクリックします。
GitHub Copilot チャットパネルが表示されます。パネルのサイズを変更するには、上端または左端をクリックしてドラッグします。- パネルに Copilot との以前の会話が含まれている場合は、Copilot パネルの右上にあるプラス記号アイコンをクリックして、新しい会話を開始します。
Copilot チャットパネルの下部にある「Ask Copilot」ボックスに質問を入力し、Enter キーを押します。例えば、次のように入力できます。
- この issue の要点を要約してください。
- この issue の目標は何ですか?
Copilot の要約機能は、作業の目的と範囲を把握するのに役立ちます。
issue
流れ
同じマシンにて検証 (再現) −> ログ→ issue (WSL issue tracker ) にログ添付してWSLチーム (microsoft/wsl) に送信
WSL issue:
以下のリンクの下の方に、issue のリンクがあるので、そこからフィードバックする。
github.com/microsoft/WSL/issues で
Create new issue> Blank issue
適当な説明を入力。
内容
WSLの Docker 統合を設定した状態で、システムログに起動時のログ出力する設定をwsl.conf の[boot]オプションに追加したことで、wsl 起動時にHCS_E_CONNECTION_TIMEOUT が発生する。
手順
ログの取得方法
PS C:\Users\xxx> Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
PS C:\Users\xxx> Set-ExecutionPolicy Bypass -Scope Process -Force
PS C:\Users\xxx> .\collect-wsl-logs.ps1
ログの収集方法は、これを実行後、下のすべての手順で再現を検証し、上記コマンドで WSLのログを取得。ログファイルへのパスが返って来る。
再現の検証
前提: WSL2, Docker 統合を設定済み。
システムログの (Systemd) 設定を wsl.conf にした。
- Windows triggered a forced shutdown
- Reboot Windows
- Docker Desktop shows:
"WSL integration with distro 'Ubuntu-24.04' unexpectedly stopped. Do you want to restart it?" - Restart the WSL Integration
- Retry WSL connection via VS Code or PowerShell.
- Once login attempting succeeded, but fails with
HCS_E_CONNECTION_TIMEOUTagain after a few days.
上記の手順で再現後、
Log collection is running. Please... の行で、Enter 押下。
Log collection is running. Please "reproduce the problem" and once done press any key to save the logs.
Saving logs...
100% [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]
Logs saved in: C:\Users\xxx\WslLogs-2025-09-29_11-05-52.zip. Please attach that file to the GitHub issue.
PS C:\Users\xxx>
参考
ログの収集方法について
実際に送った issue





