====== WSL(Windows Subsystem for Linux) ====== {{template>:meta:template:pageinfo#tpl |desc=Introduce the base usage of WSL.}} ===== How to intall WSL to the destination directory? ===== - Refer to [[https://learn.microsoft.com/zh-cn/windows/wsl/install|this page]] to install WSL. - Refer to [[https://learn.microsoft.com/zh-cn/windows/wsl/install-manual#step-6---install-your -linux-distribution-of-choice|this page]] to select the desired Linux distribution. - Open a Windows Terminal and run the following commands. - wsl -l : list the installed distributions. - wsl --shutdown : Shutdown the running WSL. - wsl --export distro dst-dir/dst**.tar** : Export file system. - wsl --unregister distro : Unregister the old distribution. - wsl --import distro Install-Location FileName –version 2 * //InstallLocation// - The directory to which the file system is to be moved. * //FileName// - The file exported in Step c. - distro.exe config --default-user username * distro - The official name of the distribution, e.g. ''ubuntu2204.exe'', ''ubuntu.exe''.