Skip to content

Commit db21ad7

Browse files
committed
documented fix for failed installation for WSL
1 parent 715661c commit db21ad7

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed
55.8 KB
Loading
63.8 KB
Loading

getting-started/start_with_WSL.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ WSL is the Windows Subsystem for Linux. It sets aside some space on your compute
88

99
## Install VS Code on your Windows machine
1010

11-
It might seem strange to install VS Code before we install WSL, but by doing things this way round we'll save ourselves several fiddly steps later!
11+
It might seem strange to install VS Code before we install WSL, but by doing things this way round, we'll save ourselves several fiddly steps later!
1212

13-
You will need a text editor to be able to make changes to the content you're working with, and the best editor is VS Code. It can be installed on your windows machine, and then WSL can use it – even from inside your Ubuntu virtual machine.
13+
You will need a text editor to be able to make changes to the content you're working with, and the best editor is VS Code. It can be installed on your Windows machine, and then WSL can use it – even from inside your Ubuntu virtual machine.
1414

1515
Go to the [Visual Studio code website](https://code.visualstudio.com/) and scroll down until you see the download button for Windows.
1616

@@ -34,11 +34,37 @@ When asked if you want to allow WSL to make changes to your device, click "yes".
3434

3535
After WSL has finished installing, you'll need to restart your computer (your physical machine, not just the Terminal window) before you can continue.
3636

37+
38+
## Troubleshooting WSL Failed Installation
39+
40+
If the `wsl --install` command does not work for you, especially if it returns the message "This operation timed out", you can debug the issue by following these steps:
41+
42+
1. Using your search bar, search for "Turn Windows features on or off" and select it. It'll open a window with some options for you. In this window, you should select the following options:
43+
* Virtual Machine Platform
44+
* Windows Subsystem for Linux
45+
46+
![Turn Windows features on or off](images/windows_on_and_off_feature.png)
47+
48+
2. After you select these options, open your system's task manager and navigate to the performance tab. You should look for an option that says "virtualisation" to make sure it's enabled. If it isn't enabled, follow this [tutorial to enable it for your system](https://support.microsoft.com/en-us/windows/enable-virtualization-on-windows-11-pcs-c5578302-6e43-4b4b-a449-8ced115f58e1).
49+
![performance tab of the Windows Task Manager](./images/task_manager_virtualisation.png)
50+
51+
3. The next step is to restart your machine and try the `wsl --install` command again. It should work now.
52+
53+
4. If you retry the command and it doesn't work as expected, you might see an error that says, "Windows Subsystem for Linux is already installed. The operation timed out". You should update your WSL version with this command:
54+
```shell
55+
wsl.exe --update
56+
```
57+
The next step is to set the default WSL version to version 2. Use this command:
58+
```shell
59+
wsl --set-default-version 2
60+
```
61+
5. Once you have completed the above steps, open your Microsoft Store and search for "Ubuntu". It's advisable to install the latest version. After the installation, you should launch the app. It'll automatically connect to your WSL and you should be able to follow the next steps without errors.
62+
3763
## Your new Ubuntu VM
3864

3965
After you've restarted your physical machine, WSL will automatically launch Ubuntu in a new Terminal window. You won't need the Windows Terminal anymore, so you can close that one, and leave only the Ubuntu window open.
4066

41-
The Ubuntu window will be asking you to set up a username and password. This is separate to the credentials you use to log into your Windows machine, although you can choose the same. The password you type will be completely "hidden", so you won't be able to see it or see how many characters you've typed. It will ask you to confirm the password anyway, so if you think you made a mistake, you'll still have to type it correctly twice.
67+
The Ubuntu window will ask you to set up a username and password. This is separate from the credentials you use to log into your Windows machine, although you can choose the same. The password you type will be completely "hidden", so you won't be able to see it or see how many characters you've typed. It will ask you to confirm the password anyway, so if you think you made a mistake, you'll still have to type it correctly twice.
4268
4369
After this is done, your Ubuntu VM will be ready to use!
4470
@@ -50,8 +76,8 @@ It's always a good idea when you start up a new virtual machine to update and up
5076
sudo apt update && sudo apt upgrade
5177
```
5278

53-
Using `sudo` will prompt you for a password. This is the same password as you entered when you set up your Ubuntu machine in the previous step.
79+
Using `sudo` will prompt you for a password. This is the same password you entered when you set up your Ubuntu machine in the previous step.
5480

5581
When asked if you want to continue, type `y` (not case sensitive).
5682

57-
You're now ready to move onto the next stage! [Install and configure git](install_git.md).
83+
You're now ready to move on to the next stage! [Install and configure git](install_git.md).

0 commit comments

Comments
 (0)