LoginSignup
0
0

More than 1 year has passed since last update.

何もしてないのにdocker-desktopが起動しなくなった、原因はWSLでした【解決済】

Last updated at Posted at 2023-04-15

ある日、docker-desktopを起動すると、前日まで動いていたのにも関わらず、
突然An unexpected error occurredでdocker-desktopが起動できなかった。(何もしてないのに壊れた!)

docker-desktopが起動できるようになるまでの試行錯誤を書きます。
スクリーンショット 2023-04-15 172248.png

動作環境

docker-desktopは2年以上使用しています。

  • Windows10 21H2
  • WSL2導入済
  • docker-desktopを2年程度使用中

エラー内容

WSLへの接続エラーが原因のよう。WSLが怪しいので動作確認してみる。

An unexpected error occurred
Failed to deploy distro docker-desktop to C:\Users\XXX\AppData\Local\Docker\wsl\distro: :
Some WSL system related access rights are not set correctly.This sometimes happens after waking the computer or not being connected to your domain/active directory. Please try to reboot the computer. If not sufficient, WSL may need to be reinstalled fully. As a last resort, try to uninstall/reinstall Docker Desktop.

調査

WSL動作状況

Windows起動時にWSLが起動できていないみたい。
まずはWSLを起動することを目指す。

 wsl -v                                                                   
指定されたサービスは無効であるか、または
有効なデバイスが関連付けられていないため、開始できません。

Ubuntuを起動するとエラーが出てしまう。
スクリーンショット 2023-04-15 174547.png

WSL起動方法

再起動

PC再起動してWSLが起動するか確認
→起動せず

Linux用サブシステム 無効化→有効化

「コントロールパネル→プログラムと機能→Windowsの機能の有効化または無効化」よりLinux用サブシステムを無効化し、再起動する。
次にLinux用サブシステムを有効化し、再起動する。
スクリーンショット 2023-04-15 175618.png

WSLが起動できていることを確認。

 wsl --list                                                                      
Linux 用 Windows サブシステム ディストリビューション:
Ubuntu (既定)
Ubuntu-22.04
Ubuntu-18.04
docker-desktop

docker-desktopが起動した。
PC再起動時の動作はまだ確認していないけど、一旦これでよし。
スクリーンショット 2023-04-15 180828.png

まとめ

突然、docker-desktopが起動しなくなったら、まずWSLを確認しましょう。

参考

0
0
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
0
0