How to SSH Access to a WSL Distro from a Remote Computer

To access a WSL distribution from a remote computer via SSH, you need to install the OpenSSH server in your WSL, decide on an SSH port number, and edit the sshd_config file to specify the port and listening address. Then, obtain the WSL IP address using ‘ifconfig’, start the SSH service within WSL, and set up port forwarding from Windows using ‘netsh’. Finally, open the necessary port in the Windows Firewall to allow incoming connections.

How to Configure Memory Limits in WSL2

In some cases, you want to configure or limit the memory (RAM) for a WSL instance. By default, WSL will take 50% of the host memory. You can check how much memory and swap space are allocated to WSL using the free command from within a WSL distribution: