Bash.exe not working

Matt May 0 Reputation points
2025-08-21T13:40:34.2933333+00:00

Running Windows 11. When I run bash.exe I get a command-prompt-like window, which disappears after a couple of seconds??

Developer technologies | .NET | .NET CLI
{count} votes

1 answer

Sort by: Most helpful
  1. Gade Harika (INFOSYS LIMITED) 490 Reputation points Microsoft External Staff
    2025-08-22T12:05:17.9633333+00:00

    Thanks for reaching out! It sounds like bash.exe is closing right after launch, which usually means the Windows Subsystem for Linux (WSL) isn’t fully set up yet.

    Here’s how you can fix it:

    Check WSL Installation Open Command Prompt and run: wsl --list --verbose If no distributions are listed, you’ll need to install one.

    Install a Linux Distribution Head to the Microsoft Store and install a distro like Ubuntu or Debian. Once installed, launch it from the Start menu to complete setup.

    1. Enable Required Features Open PowerShell as Administrator and run:
      dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart Then restart your PC. 4. Update WSL (Optional) You can run wsl --update to make sure everything’s up to date. Once that’s done, try running bash.exe again—it should open your Linux shell properly. Let me know if the issue persists after following these steps. I’ll be happy to assist further if needed. If the issue has been resolved, kindly mark the response as answered.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.