Windows 11 WSL 2 Installation, Pros, and Cons

The Windows subsystem for Linux is a fantastic feature first introduced in the Windows 10 operating system. It is a great feature for developers who can’t stay away from the Linux OS for a long time, and a reason for people who ditched the Windows OS for Linux to switch back to the Microsoft OS. WSL enables users to use Linux on their PCs without installing third-party virtualization software such as VirtualBox, VMWare, etc.

How to install and use WSL 2? What are the advantages and disadvantages of the Windows subsystem for Linux? Below, we’ve shared a tutorial to activate/run WSL and the pros/cons of the Windows subsystem for Linux.

WSL 2 installation

Enable WSL2

WSL is an optional feature that users must activate to use it. To enable WSL 2 on Windows, type “Turn Windows features on or off” in the start menu search box and click on the app when it appears in the search results. Windows 11/10 OS will now open a mini window with many checkboxes and options. Select the Windows Subsystem for Linux option and click the OK button. Now head over to the Windows Store app.

The Microsft Store has four WSL apps – Kali, SUSE, Ubuntu, and Debian. Select the Linux subsystem you want to install and click the “GET” button. No matter what app you choose and install, Windows OS will install the command line edition of the distro you’ve chosen and add its shortcuts to the start menu. WSL will start the command line Linux operating system when you click this shortcut.

WSL2 on Windows 11

WSL 2 pros/advantages

There is no need to install the windows version of Linux packages: When you install WSL 2 on the Windows 11 or 10 operating system, you don’t have to download and install the Windows version of MariaDB, PHP, etc. The software repository of Linux operating systems has thousands of packages. You can install any package of your choice by simply typing a command. For example, to install the MariaDB server on Debian, you must run the command apt-get install mariadb-server.

SSH: Command prompt supports SSH protocol. If you’re using passwordless SSH authentication and don’t want to store your SSH keys in the Windows folder for some reason, you can use WSL 2 and Linux terminal.

Isolation of data: Your Linux data is stored in the WSL directory instead of a standard Windows folder. Unless someone knows the location of this directory, your WSL data will be safe.

Using WSL as a server: You can use WSL as a server. For example, if you’re building a web application, you can run the web/database server on the Linux OS and run the IDE on the Windows operating system. You don’t have to do anything special to make the IDE recognize the DB or application server as the ports under which the DB/application/web server should run.

No need to install Linux: Although Linux operating system comes with an installer, the disk partitioning part is confusing. Recovering the data or lost files would be difficult if you accidentally delete a partition. If you don’t use Windows after installing Linux or Linux after using Windows, you must get rid of the OS you won’t use. If you don’t do so, a massive volume of storage memory will be wasted. The only way to remove the OS is to delete the partition of the OS. When you play with partitions, a massive amount of data is handled by the disks and the life of the HDD or SSD may decrease, according to CNET. If you use WSL, you don’t have to create partitions.

WSL2 cons/disadvantages

Regular users won’t know where the WSL directory is on the storage hardware, but the advanced users can quickly locate the WSL directory on Windows and see the contents of the directory, files, etc. It would be great if the directory is locked by default, and only users with a password/PIN can browse the WSL directory and subdirectories.

Config files may require some special tweaks: On Linux OS, WordPress CMS installed in a localhost environment with LEMP stack works like a charm. On WSL, the Nginx configuration file must have considerably higher fastcgi_read_timeout time. If you don’t change the fastcgi_read_timeout time to more than 300, you may see timeout errors while accessing your WP site on localhost.

No GUI: You cannot run applications with a graphical user interface in the WSL environment. You can only work with applications that don’t have GUI. For example, WSL 2 enables you to use Nano editor, Vi editor, crontab, etc. Thus, if you want to use WSL to play games, install IDEs, etc., you should reevaluate your decision or use VirtualBox, etc.

Closing words: The Windows subsystem is a nice feature of the Windows 11 operating system. It makes work easier for developers who work with Linux operating system frequently.

Leave a Comment

Your email address will not be published.

Scroll to Top