Skip to content

Commit 80a57c2

Browse files
committed
Add WSL to Academy
This adds a WSL directory to the Academy repo and a file for issue 85.
1 parent 2fa2a21 commit 80a57c2

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

wsl/how-to/install-ubuntu-wsl2.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Install Ubuntu on WSL2
2+
*Authored by Oliver Smith ([[email protected]](mailto:[email protected])) and edited by Edu Gómez Escandell ([[email protected]](mailto:[email protected]))*
3+
4+
## What you will learn:
5+
6+
* How to enable and install WSL on Windows 10 and Windows 11
7+
8+
## What you will need:
9+
10+
* A Windows 10 or Windows 11 physical or virtual machine with all the updates installed
11+
12+
## Install WSL
13+
14+
WSL can be installed from the command line. Open a PowerShell prompt as an Administrator (we recommend using Windows Terminal) and run:
15+
```
16+
wsl --install
17+
```
18+
19+
This command will enable the features necessary to run WSL and also install the default Ubuntu distribution of Linux available in the Microsoft Store. It is recommended to reboot your machine after this initial installation to complete the setup. You can also install WSL from the Microsoft Store.
20+
21+
## Install Ubuntu WSL
22+
23+
WSL supports a variety of Linux distributions including the latest Ubuntu release. Check out [the documentation](../reference/distributions.md) to see which one you prefer. For the rest of this tutorial we'll use `Ubuntu` as the example.
24+
25+
There are multiple ways of installing distros on WSL, here we show three: via the Microsoft store, via Winget, and the WSL CLI. The result is equivalent.
26+
27+
### Method 1: Microsoft store
28+
29+
Find the distribution you prefer on the Microsoft Store and then select `Get`.
30+
31+
![|624x489](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/choose-distribution.png?raw=true)
32+
33+
Ubuntu will then be installed on your machine. Once installed, you can either launch the application directly from the store or search for Ubuntu in your Windows search bar.
34+
35+
![|624x580](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu-windows.png?raw=true)
36+
37+
### Method 2: WSL Command line interface
38+
39+
It is possible to install the same Ubuntu applications available on the Windows Store directly from the command line.
40+
In a PowerShell terminal, you can run `wsl --list --online` to see all available distros.
41+
42+
![image|690x388](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/wsl-list-online.png?raw=true)
43+
44+
You can install a distro using the NAME by running:
45+
```
46+
wsl --install -d Ubuntu-20.04
47+
```
48+
49+
![image|690x388](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/installing.png?raw=true)
50+
51+
Use `wsl -l -v` to see all your currently installed distros and which version of WSL they are using:
52+
53+
![image|690x311](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/wsl-l-v.png?raw=true?raw=true)
54+
55+
### Method 3: Winget
56+
Open a PowerShell terminal and type:
57+
```powershell
58+
winget show --name Ubuntu --source msstore
59+
```
60+
61+
You'll see a list of distros available and their ID. Choose the one you prefer and install it. For instance, Ubuntu:
62+
```powershell
63+
winget install --Id "9PDXGNCFSCZV" --source msstore
64+
```
65+
66+
You'll be prompted to accept the source and package agreements before installing. You need to accept them in order to proceed.
67+
68+
Check out [the documentation](../reference/distributions.md) to see which executable matches your application and run it.
69+
```
70+
ubuntu.exe
71+
```
72+
73+
## Configure Ubuntu
74+
75+
Congratulations, you now have an Ubuntu terminal running on your Windows machine!
76+
77+
Once it has finished its initial setup, you will be prompted to create a username and password. They don't need to match your Windows user credentials.
78+
79+
Finally, it’s always good practice to install the latest updates with the following commands, entering your password when prompted.
80+
```bash
81+
sudo apt update
82+
sudo apt full-upgrade -y
83+
```
84+
## Enjoy Ubuntu on WSL!
85+
86+
That’s it! In this tutorial, we’ve shown you how to install WSL and Ubuntu on Windows 11, set up your profile, install a few packages, and run a graphical application.
87+
88+
We hope you enjoy working with Ubuntu inside WSL. Don’t forget to check out [our blog](https://ubuntu.com/blog) for the latest news on all things Ubuntu.
89+
90+
### Further Reading
91+
* [Setting up WSL for Data Science](https://ubuntu.com/blog/upgrade-data-science-workflows-ubuntu-wsl)
92+
* [Whitepaper: Ubuntu WSL for Data Scientists](https://ubuntu.com/engage/ubuntu-wsl-for-data-scientists)
93+
* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/)
94+
* [Ask Ubuntu](https://askubuntu.com/)

0 commit comments

Comments
 (0)