WSL: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
iwu
Tag: visualeditor
 
keep WSL2 running
Line 1: Line 1:
Install WSL<syntaxhighlight lang="powershell">
Install WSL<source lang="powershell">
PS C:\Users\micha> wsl --install
PS C:\Users\micha> wsl --install
Installing: Windows Subsystem for Linux
Installing: Windows Subsystem for Linux
Line 6: Line 6:
Ubuntu has been installed.
Ubuntu has been installed.
The requested operation is successful. Changes will not be effective until the system is rebooted.
The requested operation is successful. Changes will not be effective until the system is rebooted.
</syntaxhighlight>List available Linux distributions<syntaxhighlight lang="powershell">
</source>List available Linux distributions<source lang="powershell">
PS C:\Users\micha> wsl --list --online
PS C:\Users\micha> wsl --list --online
PS C:\Users\micha> wsl -l -o
PS C:\Users\micha> wsl -l -o
</syntaxhighlight>Install additional Linux distributions after the initial install<syntaxhighlight lang="powershell">
</source>Install additional Linux distributions after the initial install<source lang="powershell">
wsl --install -d <Distribution Name>
wsl --install -d <Distribution Name>
</syntaxhighlight>Check the installed version of WSL<syntaxhighlight lang="powershell">
</source>Check the installed version of WSL<source lang="powershell">
wsl -l -v
wsl -l -v
</syntaxhighlight>Change the default Linux distribution used with wsl<syntaxhighlight lang="powershell">
</source>Change the default Linux distribution used with wsl<source lang="powershell">
wsl -s <Distribution Name>
wsl -s <Distribution Name>
</syntaxhighlight>Run a specific distribution (when there are multiple ones)<syntaxhighlight lang="powershell">
</source>Run a specific distribution (when there are multiple ones)<source lang="powershell">
wsl -d <Distribution Name>
wsl -d <Distribution Name>
</syntaxhighlight>
</source>
Start WSL2, exit, and then keep WSL2 running
<source lang="powershell">
wsl --exec dbus-launch true
</source>

Revision as of 07:45, 31 August 2023

Install WSL

PS C:\Users\micha> wsl --install
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Installing: Ubuntu
Ubuntu has been installed.
The requested operation is successful. Changes will not be effective until the system is rebooted.

List available Linux distributions

PS C:\Users\micha> wsl --list --online
PS C:\Users\micha> wsl -l -o

Install additional Linux distributions after the initial install

wsl --install -d <Distribution Name>

Check the installed version of WSL

wsl -l -v

Change the default Linux distribution used with wsl

wsl -s <Distribution Name>

Run a specific distribution (when there are multiple ones)

wsl -d <Distribution Name>

Start WSL2, exit, and then keep WSL2 running

wsl --exec dbus-launch true