You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-9Lines changed: 26 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,18 @@ __________
7
7
8
8
## What is the WSL and how it works ?
9
9
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).
11
11
12
12
### WSL is not a virtual machine !
13
13
14
14
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.
16
16
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.
18
18
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).
20
20
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).
22
22
23
23
> 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.
24
24
@@ -38,9 +38,9 @@ However, we can notice in the architecture of the WSL 2 that there is a whole Li
38
38
39
39

40
40
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.
42
42
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 32bits 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.
44
44
45
45
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>`.
46
46
@@ -64,12 +64,21 @@ First, you must be running Windows 10 64bits version 2004 or higher (Build 19041
64
64
65
65
If you have an older version, update your system with Windows Update.
66
66
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 :
68
68
69
69

70
70
71
71
Make sure to install both **Virtual Machine Platform** and **Windows Hypervisor Platform**. After this, you must restart your Windows system.
72
72
73
+
Or you can type this command in a prompt with administrator privilgees to install it :
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
78
87
wsl --install
79
88
```
80
89
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)
0 commit comments