Op Windows 10 kunt u meerdere Linux-distributies installeren met WSL2 (Windows Subsystem for Linux 2). Het enige voorbehoud is dat de eerste die je installeert automatisch de standaard is, wat betekent dat je je favoriete distro niet kunt uitvoeren met bepaalde commando's (zoals wsl) out-of-the-box als je een andere distro hebt geïnstalleerd vóór degene die je leuk vindt.
However, if you want to use another Linux distribution, WSL includes a command to set any distro as the new default on Windows 10.
In this guide, you will learn the steps to make your preferred distro the new default on Windows 10.
Set default Linux distro on WSL2
To set a Linux distro as the default on Windows Subsystem for Linux 2, use these steps:
-
Open Start on Windows 10.
-
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
-
Type the following command to view a list of all available distros and press Enter:
wsl --list
Quick tip: You can also write the command like this: wsl -l.
-
Typ de volgende opdracht om een distro in te stellen als de nieuwe standaard en druk op Enter :
wsl --setdefault DISTRO-NAAM
Vervang in de opdracht DISTRO-NAME door de naam van de distro om deze als standaard in te stellen (zie stap nr. 3 ).
Deze opdracht maakt bijvoorbeeld Kali Linux tot de standaarddistro:
wsl --setdefault Kali-linux

Snelle tip: je kunt het commando ook als volgt schrijven: wsl -s Kali-linux.
Nadat u de stappen hebt voltooid, wordt de distro ingesteld als de nieuwe standaard op Windows 10, dus wanneer u een opdracht uitvoert zoals wsl, wordt Ubuntu standaard uitgevoerd.