LoginSignup
25
12

More than 3 years have passed since last update.

WSL2 (Ubuntu) を長時間放置すると Input/output error が発生する

Posted at

事象

WSL2 に Ubuntu を入れて運用しているのですが、長時間放置したあとに再びコードの編集をしてから、ファイルを保存するとたまに以下のようなエラーが出ます。
シャットダウンしないでスリープ状態にしてから朝再度触ると高確率で発生します。


'/mnt/c/Program Files (x86)/Intel/iCLS Client/hg' access: Input/output error

理由

ls: cannot access '/mnt/c': Input/output error #4377

That error occurs if the hidden wslhost.exe process is died/killed. Just use wsl.exe --shutdown and restart it.

雑訳: wslhost.exe のプロセスが停止、または強制終了された場合に発生することがあるよ。 wsl.exe --shutdown したらいいよ。

対処

Windows Terminal(preview) とか VSCode とかだとなにもできない状態なので、管理者権限 PowerShell を起動して wsl.exe --shutdown します。
その後 VSCode のリモート接続も Windows Terminal なども再起動することで直ります。

25
12
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
25
12