Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active December 13, 2022 20:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plembo/fbc7dd964e585f437b135ffa01e68a92 to your computer and use it in GitHub Desktop.
Save plembo/fbc7dd964e585f437b135ffa01e68a92 to your computer and use it in GitHub Desktop.
Revert to WSL 1

Revert to WSL 1 from WSL 2

I'll spare everyone the rant. This gist will be an all business how to revert to WSL (Windows Subsystem for Linux) on Windows 10 from version 2 back to version 1.

Note that enabling Hyper-V destabilized the (highly managed) system my company provides me. This is probably unique to the image used for the machine and the updates that base has received. So I'm not surprised by the issues people are having with Hyper-V and the Virtual Machine Platform.

My personal Windows virtual machines remain on WSL 1 because I just don't have the energy to deal with all the drama when I've already put in a full shift at work.

The assumption here is that you've already successfully installed both WSL 1 and "upgraded" to 2 by following the instructions here: Windows Subsystem for Linux Installation Guide for Windows 10. I can't emphasize enough that if your WSL 2 install went south, or used some other method to install it, you're in the wrong place.

This procedure will not allow you to rescue Linux installs that have already been coverted from v1 to v2. They will be lost.

It may also wreck any existing docker service installation that uses Hyper-V and/or Microsoft's Virual Machine Platform.

If you want to run docker on Windows, I recommend a full-featured VM run on VMware Player/Workstation or VirtualBox. Better yet, get yourself a real Linux machine.

The Procedure

  1. Go to Settings... Apps... Programs and Features... Turn Windows Features on or off.
  2. Uncheck Hyper-V, Virtual Machine Platform.
  3. Go to Settings... Apps. Uninstall "Windows Subsystem for Linux Update".
  4. Also uninstall any Linux apps (Ubuntu, Debian, Fedora, etc) from the Microsoft Store.
  5. Reboot.
  6. Open Windows PowerShell as Administrator and run:
PS C:\WINDOWS\system32> wsl --set-default-version 1
  1. Install your Linux of choice from the Microsoft Store and Launch.
  2. It will take a few minutes to set up. You'll know it worked when it prompts for a new username and password.
  3. Run through the rest of setup.
  4. Verify the new instance is WSL v1 with:
PS C:\WINDOWS\system32> wsl -l -v

Postscript

As the rant cited above indicates, there are still many ways to use Unix or Linux tools on Windows that don't require WSL or a virtual machine platform like VMware or VirtualBox. Probably the best one is the Git for Windows package. If you need more than the basic set of tools it provides you should also check out the distribution that spawned it, MSYS2. I've recently been getting reacquainted with MSYS2, whose precedesessor was my go-to package of Unix utilities on Windows for almost a decade, and found it meets most of my requirements out-of-the-box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment