Install WSL with a single command now available in Windows 10 version 2004 and higher

In the latest Windows Insider Preview builds, you can install everything you need to run WSL just by running wsl.exe --install. We’re excited to announce that this functionality is now officially backported to Windows 10 version 2004 and higher, which will make installing WSL on those builds much easier!

Using wsl --install


wslupdate.png

The process to set up WSL was previously too complicated, involving turning on multiple settings and installing multiple packages. We’ve simplified the process down to just one command, simply open a command prompt window with admin privileges and run wsl.exe --install. Once you hit enter, the process will automatically enable the WSL optional features required, install the Ubuntu distribution by default, and install the latest WSL Linux kernel version onto your machine. When it’s completed and you restart your machine, your distribution will start after you boot up again, completing the installation.

Additionally, you can find a list of Linux distributions available to install by entering the command wsl --list --online in PowerShell or Windows Command Prompt. To install a distribution other than, or in addition to, the Ubuntu default, use this command: wsl --install -d <DistroName>

Replace <DistroName> with the name of a Linux distribution found in the previous list command. This install command can be used for first time installation or for adding additional distributions after you already have WSL installed with the default Ubuntu distribution.

Additional commands​


We’ve also included some additional commands to help you manage your WSL instances with this backport.

You can use wsl --update to manually update your WSL Linux kernel, and you can use wsl --update rollback to rollback to a previous WSL Linux kernel version.

Lastly, you can use wsl --status to see general information about your WSL configuration, such as default distro type, default distro, and kernel version.

Update your Windows 10 version to support these commands​


You can get this backport just by updating Windows like normal. To manually do this open Windows Settings, go to ‘Updates and Security’ and hit ‘Check for Updates’.

Screenshot-2020-08-20-115048.png

This update is part of KB5004296 and you can find full instructions on how to ensure you have it installed and its changes here. At the time of writing, when you click “Check for Updates” you might see an available optional update, ensure that it has the same number as KB5004296, install it, and you’ll get access to wsl --update.

Where to give us your feedback​


As always, you can follow up with WSL team members, or with me on Twitter. If you’re experiencing technical issues please file them on the Microsoft/WSL Github repo. Learn more about WSL, including how to set up common development tools like Git, VS Code, Docker containers, databases, GPU acceleration for machine learning, and more, by visiting the WSL documentation. Happy coding!

The post Install WSL with a single command now available in Windows 10 version 2004 and higher appeared first on Windows Command Line.

Continue reading...
 

Similar threads

C
Replies
0
Views
73
Craig Loewen
C
C
Replies
0
Views
134
Craig Loewen
C
L
Replies
0
Views
85
Logan Iyer, Distinguished Engineer, Windows
L
Back
Top Bottom