Edit

Get started with Azure Linux 4.0 on Windows Subsystem for Linux (WSL)

This guide helps you install Azure Linux on Windows Subsystem for Linux (WSL) and start using it as a local Linux environment for development, testing, and troubleshooting without needing a virtual machine (VM) or an Azure subscription.

Azure Linux on WSL uses the same command-line tools and behavior as Azure Linux running in Azure, so you can use it for day-to-day work and to reproduce issues locally.

Prerequisites

Install Azure Linux 4.0 on WSL

  1. Open Windows Terminal (no admin required).

  2. Follow the GitHub README guide to install Azure Linux.

  3. Launch Azure Linux:

    wsl -d AzureLinux-4
    

On first launch, you're prompted to create a Linux username and password. Use these credentials only inside the Azure Linux environment.

Verify the installation

After signing in, validate that Azure Linux is installed and running as expected.

cat /etc/os-release

You see output indicating Azure Linux and the installed version number.

At this point, Azure Linux is fully installed and ready to use.

After installation, update your system packages to ensure you have the latest fixes and security updates.

sudo dnf update -y

Use Visual Studio Code with Azure Linux (optional)

Note

Visual Studio Code isn't required, but you can use it with WSL for editing, debugging, and terminal workflows.

  1. Install Visual Studio Code on Windows.

  2. Install the Remote - WSL extension.

  3. From an Azure Linux terminal, open a folder in VS Code.

    code .
    

For more information, see the Visual Studio Code documentation.