LoginSignup
0
0

WSL2+devcontainer実行時のエラー(Failed to connect to the remote extension host server)対策

Last updated at Posted at 2023-11-20

エラー内容

WSLを使っているとき、Dev Containers: Rebuild Containerをすると以下のようなエラーで失敗することがあります

Failed to connect to the remote extension host server (Error: stream is closed)
shell server failed: error: unexpected end of parent stream

WSLと干渉しているようです

解決方法

方法1: VSCodeのWSL接続を止める

  1. 別ウィンドウでWSLが開いていたら閉じる
  2. VSCodeの左下のボタン(Remote-SSH)がWSLにつながっている状態を確認
  3. ボタンを押す > Close Remote Connection
  4. File > Open Recent > 以前開いていたDevContainerを選択

方法2: WSLを止める

issueに書かれている解決策

  1. Linux WSLタブとVSCodeを閉じ

  2. 管理者権限でコマンドプロンプトを開く

  3. wsl --shutdownを実行する

  4. Linuxタブを再度開く

    • 再度Linuxタブを開き、"code ."と入力

方法3: 再起動

諸々リセットされるので、再起動で直る場合もあります

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