Skip to content

Commit d69cb68

Browse files
committed
Update README.md
1 parent d841b78 commit d69cb68

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ __________
77

88
## What is the WSL and how it works ?
99

10-
The WSL for **W**indows **S**ubsystem for **L**inux is a compatibility layer developed by Microsoft for running Linux binaries natively (ELF format) in a console environment on Windows 10 and Windows 11. This ingenious technology provides a Linux-compatible kernel interface and can interact directly with the windows operating system with performances very close to a native Linux distribution. Moreover, it allows a user to chose a Linux distribution to install from the Microsoft Store (more info in below).
10+
The WSL for **W**indows **S**ubsystem for **L**inux is a compatibility layer developed by Microsoft for running Linux binaries natively (ELF format) in a console environment on Windows 10 and Windows 11. This ingenious technology provides a Linux-compatible kernel interface and can interact directly with the Windows operating system with performances very close to a native Linux distribution. Moreover, it allows a user to choose a Linux distribution to install directly from the Microsoft Store (more info in below).
1111

1212
### WSL is not a virtual machine !
1313

1414
Oh my god, I have heard so many times *"WSL ? Yeah it's like a virtual machine on your Windows"* but no. It's not as simple...
15-
Although WSl uses virtualization technologies in some cases (more information in the next section), it does not work in a partitioned environment on your Windows system like a classic virtual machine on VMWare or Virtualbox.
15+
Although WSL uses virtualization technologies in some cases (more information in the next section), it does not work in a partitioned environment on your Windows system like a classic virtual machine on VMware or VirtualBox.
1616

17-
It's important to know that all your storage devices that have an assigned letter by the Windows operating system (for example C:, D:, E: ...) are reachable in the `/mnt` directory. As an example, the famous `C:` partition of your Windows system is in `/mnt/c` and this is same thing for the others.
17+
It's important to know that all your storage devices that have an assigned letter by the Windows operating system (for example `C:`, `D:`, `E:`, ...) are reachable in the `/mnt` directory. As an example, the famous `C:` partition of your Windows system is in `/mnt/c` and this is same thing for the others.
1818

19-
> The NTFS and FAT partitions are directly mounted in the `/mnt` directory but it's necessary to execute some commands to mount EXT4 ones (more information below).
19+
> The NTFS and FAT partitions are directly mounted on the `/mnt` directory but it's necessary to execute some commands to mount EXT4 ones (more information below).
2020
21-
Therefore, the WSL can access to your storage devices and it may have some consequences. Indeed, if you try to delete your Document folder for example, you will notice that it will be permanently removed from your computer. You can also create a new file with a text editor like vim or nano, and you will be able to edit it with a Windows text editor (like notepad for example).
21+
Therefore, the WSL can access to your storage devices and it may have some consequences. Indeed, if you try to delete your Document folder for example, you will notice that it will be permanently removed from your computer. You can also create a new file with a text editor like vim or nano and be able to edit it with a Windows text editor (like notepad for example).
2222

2323
> For the curious ones, we tried to do a `rm -fr /mnt/c` command with the WSL and the root privileges, to delete all the files in the **C:\\** directory. It seems that the WSL can only delete the files in the user folder in **C:\Users\<name_of-the_user>**. However, the windows system becomes quite unstable and slow.
2424
@@ -38,9 +38,9 @@ However, we can notice in the architecture of the WSL 2 that there is a whole Li
3838

3939
![bg fit right](./img/WSL2.svg)
4040

41-
>The Hypervisor platform is not Hyper-V ! It's an API that third-party developers can use for Hyper-V, VMWare Workstation/Player, Virtualbox... It adds an extended user-mode API for third-party virtualization stacks and applications to create and manage partitions at the hypervisor level, configure memory mappings for the partition, and create and control the execution of virtual processors.
41+
>The Hypervisor platform is not Hyper-V ! It's an API that third-party developers can use for Hyper-V, VMware Workstation/Player, VirtualBox... It adds an extended user-mode API for third-party virtualization stacks and applications to create and manage partitions at the hypervisor level, configure memory mappings for the partition, and create and control the execution of virtual processors.
4242
43-
As we can see, the WSL 2 is based on a Linux kernel virtualized with the Windows Hypervisor Platform. This version has an increased I/O performance and a full system call compatibility. Indeed, initial versions of WSL 2 run up to 20 times faster compared to WSL 1 when unpacking a zipped tar archive, and around 2-5 times faster when using file intensive operations like git clone, apt uppragde, etc... Besides, unlike the WSL 1, it supports 32 bits applications.
43+
As we can see, the WSL 2 is based on a Linux kernel virtualized with the Windows Hypervisor Platform. This version has an increased I/O performance and a full system call compatibility. Indeed, initial versions of WSL 2 run up to 20 times faster compared to WSL 1 when unpacking a zipped tar archive, and around 2-5 times faster when using file intensive operations like git clone, apt upgrade, etc. Besides, unlike the WSL 1, it supports 32-bits applications.
4444

4545
However, if you are using files stored in storage devices on `/mnt` in your Windows file system, the WSL 1 will be faster than then second version. It has a lighter architecture and it does not need a hypervisor layer. But if you are using files stored in the root directory ( / ), WSL 2 will be even faster because file operations are moved on a VHD (Virtual Hardware Disk). You can access to this virtual disk with the windows explorer if you enter the command `explorer.exe` in your home directory or directly with the windows explorer by specifying the path `\\wsl$\<name_of_the_distro>`.
4646

@@ -64,12 +64,21 @@ First, you must be running Windows 10 64bits version 2004 or higher (Build 19041
6464
6565
If you have an older version, update your system with Windows Update.
6666

67-
You need to have several Windows functionalities installed before using WSL. To install them, select Windows Logo key and enter **Windows Features**. This window should open :
67+
You need to have several Windows functionalities installed before using WSL. To install them, select Windows Logo key, type **Windows Features** and enter. This window should open :
6868

6969
![bg fit right](./img/features.png)
7070

7171
Make sure to install both **Virtual Machine Platform** and **Windows Hypervisor Platform**. After this, you must restart your Windows system.
7272

73+
Or you can type this command in a prompt with administrator privilgees to install it :
74+
75+
```Powershell
76+
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
77+
dism.exe /online /enable-feature /featurename:WindowsHypervisorPlatform /all /norestart
78+
```
79+
80+
Make sure to restart the system afterwards.
81+
7382
### Download WSL
7483

7584
You can install the WSL feature with the same procedure described before by selecting the **Windows Subsystem for Linux** or with the following Powershell command as an administrator :
@@ -78,6 +87,15 @@ You can install the WSL feature with the same procedure described before by sele
7887
wsl --install
7988
```
8089

90+
>According to Microsoft, this command will activates the required optional components, downloads the latest Linux kernel, sets WSL 2 as default and installs a Linux distribution for you (Ubuntu by default)
91+
92+
or
93+
94+
```Powershell
95+
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
96+
```
97+
98+
> This command will only install WSL.
8199
### WSL distributions available at this time
82100

83101
At this moment (when this article was written), you can install these distributions :
@@ -98,7 +116,6 @@ You can install the distribution you want directly on the Windows Store !
98116

99117
First, you must be running Windows 11 Build 22000 or higher and have admin privileges. This procedure only works on the WSL 2.
100118

101-
102119
``` Powershell
103120
GET-CimInstance -query "SELECT * from Win32_DiskDrive"
104121
```

0 commit comments

Comments
 (0)