2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WSLがネットワークにつながらないときにやること

Last updated at Posted at 2022-01-07

WSL2を起動してもネットワークに接続できないことがあります。

備忘録として記します。

WSL2がネットワークに繋がらない時の対処法

Powershellを管理者権限で実行し、以下のコマンドを順に実行します。
・LxssManagerの再起動


Restart-Service LxssManager

・Host Network Serviceの再起動


Stop-Service -name "hns" 
Start-Service -name "hns"

・Hyper-Vアダプタの再起動


Get-NetAdapter -IncludeHidden | Where-Object `
{$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
| Disable-NetAdapter -Confirm:$False

Get-NetAdapter -IncludeHidden | Where-Object `
{$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
| Enable-NetAdapter -Confirm:$False

再起動は不要
WSLで通信ができるようになっているはずです。

参考

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?