Skip to content

Windows Subsystem for Linux (WSL) on Windows

When working on cloud-based projects or needing a Linux-like environment on Windows, Windows Subsystem for Linux (WSL) is an excellent solution. It allows you to run a Linux distribution alongside your Windows environment. In this section, you will learn how to install an LTS version of Ubuntu within WSL.

Install Linux on Windows with WSL

Follow these steps to install Ubuntu on Windows with WSL:

  1. Open Microsoft Store: Search for "Microsoft Store" in your Windows search bar and open it.

  2. Search for Ubuntu: In the Microsoft Store, search for "Ubuntu." Look for an LTS (Long Term Support) version of Ubuntu.

  3. Install Ubuntu: Click on the Ubuntu version you prefer and click the "Install" button. The installation process will begin.

  4. Initial Configuration: After installation, launch the Ubuntu app.

Setting up Ubuntu in WSL

Once you've installed Ubuntu within WSL, you'll need to perform some initial configuration, including setting a Linux username and password.

  1. Launch Ubuntu: Open the newly installed Ubuntu app from your Windows Start menu.

  2. Initial Setup: The first time you run Ubuntu, it will perform some one-time setup, including configuring the user account.

  3. Create a Username: You will be prompted to create a Linux username. Enter the desired username.

  4. Set a Password: After creating the username, you'll be asked to set a password for your Linux user.

  5. Accessing the Terminal: Once the setup is complete, you'll have access to a Linux terminal within WSL, where you can execute Linux commands and install additional packages.

Common Issue

Warning

Common installation error: "Virtualization not enabled." Consult your laptop's manufacturer guide for BIOS settings to enable it based on the laptop's make and model.

Conclusion

With WSL and Ubuntu installed, you can enjoy a Linux-like environment on your Windows machine, making it easier to work on cloud-based or Linux-based projects. You can use the terminal within WSL for various tasks and development activities.

Happy Linux-on-Windows coding!