WSL commands

To Nha Notes | June 27, 2023, 1:29 p.m.

High mem usage in Vmmem process on windows may relate to memory consuption of WSL, so sometime we may need to restart it to free memory.  

Check status

wsl --status

Default Distribution: Ubuntu-22.04
Default Version: 2

Windows Subsystem for Linux was last updated on 3/26/2022
WSL automatic updates are on.

Kernel version: 5.10.102.1

List running versions

wsl -l -v
  NAME            STATE           VERSION
* Ubuntu-22.04    Stopped         2
  Ubuntu-18.04    Stopped         2

Shutdown

wsl -t Ubuntu-18.04

Start

wsl -d Ubuntu-18.04

 

Access Ubuntu files on WSL from windows

\\wsl$\Ubuntu-18.04\home\<user>

\\wsl$\Ubuntu-18.04\lib\x86_64-linux-gnu