When Windows announced it was adding built-in support for Linux via the Windows Subsystem for Linux (WSL), it looked promising. However, it was riddled with issues, limited, and required several steps to set up. When we saw the new WSL2 stable version in 2020, it introduced the whole Linux kernel running inside a light VM on Windows. With WSL 1, the Linux kernel was virtualized. The updated WSL2 offers improved performance and compatibility over the first generation and is great for most users.
One of the significant improvements with WSL2 is the file system performance with intense operations like git clone, npm install, apt updates, and fast unpacking of archives. The company also boasts a 20x speed improvement. Although there are still issues to address, and it isn’t perfect, it provides the right amount of Linux for most people.
Integration and File Performance
While limitations exist, it’s a decent feature for most users
The WSL2 feature enables a complete Linux system with full compatibility, running an actual Linux kernel in a lightweight and managed VM. It’s actually nice since you don’t need to install and run a separate instance of a VM app like VirtualBox or VMWare.
Once you enable WSL2 on your Windows system (Home or Pro PC with virtualization technology), you can create a quick Ubuntu virtual machine. Also, you aren’t limited to using just Ubuntu and can install virtually any distro you want, including Mint Linux, even though it isn't officially supported. However, you can install popular stable versions of Linux with this technology. For instance, you can run Fedora on WSL2 or NixOS.
However, the file system's performance has some limitations. While moving files around within the Linux VM is straightforward and speedy, accessing files between systems can be tricky. However, using the native file system tool can cause overhead compared to accessing them directly within the proper environments.
File operations, such as those using /mnt/c/ paths, for instance, can be slower than Windows or Linux on a bar-metal machine. To improve performance, it’s recommended to store files in the WSL2 Linux environment, such as an ext4 VHD if possible. I also read about some users saying they have faster results using symbolic links like \\wsl.localhost\path-to-folder but haven't tried it yet. In that type of situation, you are mapping the folder to your Linux VM to improve performance.
Still, all of this isn't a deal-breaker, and the experience is typically better than using a virtualization environment like VirtualBox or Hyper-V hypervisor. Unless you are working in WSL all day, or need it for specific operations, file transfers shouldn't be much of an issue. While it has shortcomings for power users, people looking to play around with Linux will be happy with it.
Additionally, setting up Ubuntu in WSL is easy from the CLI, using a single line of code in the PowerShell. Run wsl -- install or add the -- no-distribution tag to the so it doesn't automatically install Ubuntu. This will allow you to run alternative and supported Linux distros like Fedora, Debian, or Arch Linux.
If you know the version of Linux you want, run the command. For instance, you could include wsl --install debian. It's also important to note that if you aren't comfortable with the CLI, you can download WSL from the Microsoft Store. Whichever method you use to get it installed, you'll be working on your new virtual Linux system in no time.
Hardware support
Lack of unstable drivers may set you back
While your PC may meet all the hardware requirements for Windows and virtualization to run WSL2, hardware support for Linux host systems may be limited. Virtualization means you may have limited support for legacy and modern hardware.
For instance, while you might be proud to have the latest and greatest GPU running on your computer, it might not work correctly. The WSL2 feature does add GPU passthrough, using NVIDIA’s proprietary CUDA and machine learning to blaze through demanding workloads on modern processing units. However, complete compatibility isn’t guaranteed since there may not be seamless proprietary Linux driver support.
Additionally, legacy hardware support can be inconsistent, depending on the specific hardware you have. Linux driver support for old cards requires direct access, and some devices won’t function correctly. Older ports like serial and parallel might also cause issues. So, if you have a system thrown together from old parts, WSL2 with Linux might not be the best solution. Instead, you can install Linux directly on the PC for the best results.
Running apps is a breeze
You can run Linux apps when needed within Windows
The good news here is that when you need to run a Linux app, you can do it directly in your Windows environment. It's possible to type WSL to launch it, sign in to your Linux prompt and install and launch apps easily. The cool thing is they play alongside your Windows apps. If you need to use an occasional Linux app or Linux version of an open-source app, the process is straightforward.
For instance, you can install the basic text editor Gedit by executing the sudo apt install gedit command and launch it using gedit. Similarly, you can use basic Linux commands to install and open whatever app you want. Once you have the Linux apps you need, it's a cinch to switch between them with Alt+Tab.
WSL2 works despite certain constraints
Despite some limitations of the WSL2 feature, for most users it’s good enough, and allows you to work with Linux or dip your toes into the experience. It is a good solution for most coders on newer systems. However, you might want to find a different virtualization option on new, powerful, and robust self-built systems. You might also encounter issues in various networking situations.
While it might not be ideal in specific situations, it will provide a decent experience when you need to build a Linux system on your Windows machine quickly. Just remember that it might not be a perfect solution depending on your system and network configuration. Still, I have had good results with it on three different systems I’ve tried it on. You can launch one or two Linux apps and run them alongside Windows.
Since Windows 11 or higher requires decent hardware to run, it’s likely your WSL2 Linux system will work just fine. The best way to find out is to try it out and see how it works. If not, there are plenty of other virtualization solutions available.
