A Developer's Guide to Ansible on Windows with WSL

Lenny Shirley II | Nov 12, 2025 min read

Developing with Ansible on a Windows machine used to be a challenge, but thanks to the Windows Subsystem for Linux (WSL), it’s now easier than ever. This guide will walk you through setting up a complete Ansible development environment, from installing WSL and a Linux distribution to configuring VS Code for seamless remote development.

Part 1: Setting Up Your WSL Environment

First, we need to get the core WSL components running on your Windows machine.

Step 1: Install WSL

You can now install everything required for WSL with a single command. Open PowerShell in administrator mode (right-click and select “Run as administrator”), enter the following command, and then restart your machine when prompted.

wsl --install

Step 2: Set WSL 2 as the Default

WSL 2 offers better performance and full system call compatibility, which is ideal for our needs. Let’s set it as the default version for any new Linux distributions you install.

wsl.exe --set-default-version 2

Step 3: Install Fedora

With WSL ready, we can now install our Linux distribution of choice. For this guide, we’ll use Fedora 43.

wsl.exe --install FedoraLinux-43

Part 2: Configuring Your Fedora Linux Instance

After installing Fedora, WSL will launch the new instance so you can complete the initial setup.

Step 4: Create Your Linux User

You’ll be prompted to create a default user account for your new Fedora environment. This username doesn’t need to match your Windows username.

Please create a default user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: 

Follow the prompts to set your username and password.

Step 5: Install Essential Packages

Now that you’re logged into your Fedora instance, we need to install the core packages for Ansible development: git, python, podman (as a container engine), and Ansible itself.

1. Install Git, Python 3.12, and Podman

sudo dnf install -y git python3.12 podman

2. Install PIP for Python 3.12

We’ll use ensurepip to get the Python package installer.

python3.12 -m ensurepip --upgrade

3. Install Ansible Packages

Using pip, we can now install Ansible, Ansible Lint (for checking your playbooks), and Ansible Navigator (a text-based UI for running playbooks).

pip3.12 install "ansible~=11.0" "ansible-lint" "ansible-navigator" "ansible-sign"

4. Set Python 3.12 as the Default (Optional)

To make sure python3 points to our newly installed version, you can run this command to create a symbolic link.

sudo ln -s /usr/bin/python3.12 /usr/bin/python3 --force

Part 3: Setting Up Your Windows Tools

With the Linux environment configured, let’s get our Windows-side tools set up for a great development experience.

While you can access WSL through any terminal, the new Windows Terminal provides a much better, tabbed experience for managing WSL, PowerShell, and Command Prompt all in one place.

You can install it from the Microsoft Store or here: https://aka.ms/terminal

Step 7: Install Visual Studio Code

VS Code is my editor of choice, primarily for its outstanding remote development capabilities. Download and install it from the official site:

Part 4: Connecting VS Code to WSL

The real magic comes from VS Code’s ability to connect directly to the WSL instance, allowing you to edit files and use the terminal as if you were natively in Linux.

Step 8: Install Key VS Code Extensions

To make this connection seamless, we need to install a few extensions in VS Code. Open the Extensions view (Ctrl+Shift+X) and install the following:

And that’s it! You now have a powerful, fully integrated Ansible development environment. You can launch VS Code, connect to your WSL: Fedora instance, and start writing and testing your playbooks directly from Windows.