WSL2 Installation and Setup: A Beginner’s Guide

TOC

1. Introduction.

This article explains how to install Windows Subsystem for Linux (WSL2) and set up a Linux environment in a way that is easy for beginners to understand.

2. Background of WSL

Windows Subsystem for Linux (WSL) is a technology that allows Windows users to run Linux binaries directly. It was developed as part of Microsoft’s efforts to improve the development experience on Windows.

In the past, Microsoft positioned Linux and Windows as competitors. However, over time, the technology environment has changed and it has become very important for companies to harness the power of open source; Linux has become an essential platform for developers due to its open source community, which has created numerous tools and frameworks.

However, Windows users have typically had to dual-boot or use virtual machines to access these tools. This is resource-intensive, complex, and time-consuming.

Microsoft has therefore developed WSL, which allows Linux environments to run directly on Windows. This allows Windows users to use the powerful tools of Linux without having to reboot and install additional operating systems.

This represents a change in Microsoft policy and a new stance of working with open source and putting the convenience of users and developers first. It allows developers to use tools for both Windows and Linux, making it easier to transition their work between platforms.

This is the background and purpose behind the introduction of WSL to Windows. It makes Windows an even more powerful platform, providing a better experience for developers.

3. About WSL and VirtualBox Conflicts

Because VirtualBox and WSL2 use the same virtualization features, conflicts may occur on some systems. In particular, performance may be affected when VirtualBox runs on top of Hyper-V or Windows Hypervisor Platform (WHPX). This is because WSL2 uses these virtualization technologies internally.

Therefore, if you want to use WSL2 and VirtualBox at the same time, you must make specific settings for each virtual machine. Specifically, in the configuration of each virtual machine in VirtualBox, set “Paravirtualization Interface” to “None” or “Minimal” in the “System” > “Acceleration” tab. This will prevent VirtualBox virtual machines from using Hyper-V or WHPX and avoid conflicts.

4. How to install WSL2

To install WSL2, follow the steps below using the GUI:

  1. Enable WSL: First, go to Enable or Disable Windows Features and check “Windows Subsystem for Linux” to enable it.
  2. Enable Virtual Machine Platform: Next, check and enable “Virtual Machine Platform” as well.
  1. Restart Computer: Restart the computer for all changes to take effect.
  2. Set WSL2: After restarting, open PowerShell as administrator and enter the following command to set the default version of WSL to 2
wsl --set-default-version 2

5. Installing and configuring Linux from Microsoft Store

  1. Select and install a Linux distribution: Open Microsoft Store and search for “Linux”. Various Linux distributions will be displayed, so choose the one you prefer, such as Ubuntu or Debian, and install it.
  2. Linux Setup: Once the installation is complete, open the new distribution and follow the instructions for the first boot. This includes creating a new user account and setting a password.

6. Using WSL2 and VirtualBox

Whether you should use VirtualBox or WSL2 depends largely on your specific needs. If you need a completely virtual environment, or if you want a Linux environment that is completely separate from Windows, then VirtualBox is the right choice. On the other hand, if you want deep Windows integration and easy access to Linux command line tools on Windows, WSL2 is a better fit.

7.Resources for Deepening Your Linux Knowledge

For those new to Linux, links to learning resources can be very helpful. We recommend a few resources below.

  1. The Linux Command Line: A Complete Introduction – A book for learning the Linux command line.
  2. Linux Journey – A free online resource for learning Linux.
  3. WSL Documentation – Microsoft’s official WSL documentation.

8.Community Support

If you encounter a problem or get stumped on something, there are many online communities that can help. These communities help new users learn Linux more smoothly and solve problems. Here are a few communities

  1. Stack Overflow – A question and answer platform for programming and system administration.
  2. Reddit’s /r/linuxquestions – A Reddit community where you can post questions about Linux.
  3. Microsoft’s WSL Github – A place to track WSL development and report problems.

9. Summary

Using WSL2 and installing Linux from the Microsoft Store, even beginners can easily set up and use a Linux environment. In addition, certain settings can be made to eliminate WSL2 and VirtualBox conflict issues, making it possible to use both at the same time. This makes it possible to use powerful tools for both Windows and Linux.

Please share if you like it!
TOC