Skip to content

Instantly share code, notes, and snippets.

@frama21
Last active June 29, 2024 04:47
Show Gist options
  • Save frama21/28cd3454f4e567b6e2b2e91ca3808abc to your computer and use it in GitHub Desktop.
Save frama21/28cd3454f4e567b6e2b2e91ca3808abc to your computer and use it in GitHub Desktop.
My personal WSL setting
[wsl2]
memory=6GB # set ram
processors=2 # set VM processor
swap=2GB # set swap 0 for disable

1. Run this Command on Windows Terminal

$ netsh interface portproxy add v4tov4 listenport=22 listenaddress=0.0.0.0 connectport=22 connectaddress=<WSL_IP_ADDRESS>

Change the <WSL_IP_ADDRESS> into your WSL IP Address, for check the IP run this command ip addr show eth0 on WSL Terminal

2. then go to windows firewall

  • add rule inbound & outbound
  • choose the port setting & fill with 22 g
  • then grant all access
  • then save

3. Now run ssh your_username@windows_ip

and that how your IP windows access with WSL not your windows machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment