artwhisper
← Blog Setting Up WSL and VSCode in Windows 11

Setting Up WSL and VSCode in Windows 11

Learn how to install Windows Subsystem for Linux (WSL) and configure Visual Studio Code (VSCode) for seamless development in Windows 11.

Mar 2, 2026

Introduction

Windows Subsystem for Linux (WSL) is a powerful feature that enables you to run a Linux environment directly on Windows 11. By combining the benefits of both platforms, you can take advantage of the best of both worlds for your development projects. In this post, we'll walk you through the process of setting up WSL and configuring Visual Studio Code (VSCode) for optimal usage.

Prerequisites

Before we get started, ensure you have the following prerequisites:

  1. A Windows 11 system with the latest updates installed.
  2. Administrative privileges to install WSL.
  3. A stable internet connection.

Installing WSL

Follow these steps to install WSL on your Windows 11 system:

  1. Press Win + X and select "Windows Terminal (Admin)" to open an elevated terminal.
  2. Enter the following command to install the WSL optional component:
    wsl --install
    
  3. Restart your machine to complete the installation process.

Configuring WSL

Once WSL is installed, it's time to configure your Linux distribution. You can download various Linux distributions from the Microsoft Store, such as Ubuntu or Debian. After installation, launch your preferred distribution, and follow these steps:

  1. Set your username and password.
  2. Update your package index.
    sudo apt update
    
  3. Install the OpenSSH server to enable SSH access.
    sudo apt install openssh-server
    
  4. Configure the SSH service to start automatically at boot.
    sudo systemctl enable ssh
    
  5. Set up a new SSH key for authentication.

Installing VSCode in WSL

Now that you have WSL up and running, it's time to install VSCode and configure it for your Linux distribution:

  1. Open your terminal and run the following command to download and install VSCode:
    wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-vscode-stable.deb -O packages.deb
    sudo dpkg -i packages.deb
    
  2. Launch VSCode for the first time by running:
    code
    

Conclusion

By following the steps outlined in this blog post, you'll have a fully functional development environment in Windows 11, complete with WSL and VSCode. Enjoy the best of both worlds, and happy coding!