Windows Subsystem For Linux (WSL): Unterschied zwischen den Versionen
Aus MattWiki
Matt (Diskussion | Beiträge) |
Matt (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
== Basic Commands == | This article focuses on managing and working with WSL or Windows Subsystem for Linux. | ||
For developing with containers see [[Development Containers]] | |||
== Managing WSL == | |||
=== Basic Commands === | |||
wsl --list or wsl -l # Show list of locally available distributions | wsl --list or wsl -l # Show list of locally available distributions | ||
wsl -l -o # Show list of online available distributions | wsl -l -o # Show list of online available distributions | ||
Zeile 7: | Zeile 13: | ||
wsl -u root # Run image as root | wsl -u root # Run image as root | ||
== Install == | === Install === | ||
wsl -l -o # Lookup available distributions online | wsl -l -o # Lookup available distributions online | ||
wsl -install <distro_name> # install distribution | wsl -install <distro_name> # install distribution | ||
wsl --set-default <Distribution Name> # Set default distribution name | wsl --set-default <Distribution Name> # Set default distribution name | ||
== Uninstall == | === Uninstall === | ||
wsl --unregister <distro> | wsl --unregister <distro> | ||
Hint: This unregisters the distribution from WLS and also removes most of the files from the disk (see disk locations below) | Hint: This unregisters the distribution from WLS and also removes most of the files from the disk (see disk locations below) | ||
== Clone Image == | === Clone Image === | ||
wsl --export <distro> <filename.tar.gz> | wsl --export <distro> <filename.tar.gz> | ||
wsl --import <new-distro-name> <distrolocation> <filename.tar.gz> | wsl --import <new-distro-name> <distrolocation> <filename.tar.gz> | ||
= Disk Location of Distributions = | === Disk Location of Distributions === | ||
Location of distros is | Location of distros is | ||
%LOCALAPPDATA%\packages\<subfolder-for-distro> | %LOCALAPPDATA%\packages\<subfolder-for-distro> | ||
Zeile 26: | Zeile 32: | ||
C:\Users\<username>\AppData\Local\packages\<subfolder-for-distro> | C:\Users\<username>\AppData\Local\packages\<subfolder-for-distro> | ||
== Sources == | === Sources === | ||
https://learn.microsoft.com/en-us/windows/wsl/basic-commands#list-available-linux-distributions | https://learn.microsoft.com/en-us/windows/wsl/basic-commands#list-available-linux-distributions | ||
== Working with Debian inside WSL == | |||
=== Installing Software === | |||
sudo apt-get install <softwarepackage> | |||
[[Kategorie:Windows]] | [[Kategorie:Windows]] | ||
[[Kategorie:Terminal]] | [[Kategorie:Terminal]] | ||
[[Kategorie:Linux]] | [[Kategorie:Linux]] |
Aktuelle Version vom 15. August 2024, 19:56 Uhr
This article focuses on managing and working with WSL or Windows Subsystem for Linux.
For developing with containers see Development Containers
Managing WSL
Basic Commands
wsl --list or wsl -l # Show list of locally available distributions wsl -l -o # Show list of online available distributions wsl -l -v # Show running status wsl -d <distro> # Run specific distribution wsl -u <username> # Run image with specific wsl -u root # Run image as root
Install
wsl -l -o # Lookup available distributions online wsl -install <distro_name> # install distribution wsl --set-default <Distribution Name> # Set default distribution name
Uninstall
wsl --unregister <distro>
Hint: This unregisters the distribution from WLS and also removes most of the files from the disk (see disk locations below)
Clone Image
wsl --export <distro> <filename.tar.gz> wsl --import <new-distro-name> <distrolocation> <filename.tar.gz>
Disk Location of Distributions
Location of distros is
%LOCALAPPDATA%\packages\<subfolder-for-distro>
or
C:\Users\<username>\AppData\Local\packages\<subfolder-for-distro>
Sources
https://learn.microsoft.com/en-us/windows/wsl/basic-commands#list-available-linux-distributions
Working with Debian inside WSL
Installing Software
sudo apt-get install <softwarepackage>