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

WSL2の初期設定

Last updated at Posted at 2021-07-31

はじめに

困ったときの自分用メモ(関係無いのも入っている)

  • Windowsから127.0.0.1で繋げられない
  • WSL2からSSHで外に出られない
  • WSL2で名前解決できない

とかなりませんように

Ubuntu 22.04

WSL2側

/etc/wsl.conf

[network]
generateHosts=false
generateResolvConf=false

[interop]
appendWindowsPath=false

/etc/resolv.conf

# unlink /etc/resolv.conf
# vi /etc/resolv.conf
--
nameserver 192.168.X.X
--
# chattr +i /etc/resolv.conf

Windows側

%USERPROFILE%\.wslconfig

[wsl2]
memory=12GB
swap=0
localhostForwarding=true
kernelCommandLine=ipv6.disable=1
1
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
1
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?