Wsl: How can I revert from WSL 2 to the earlier version of WSL? (Need to remove conflict with VirtualBox)

Created on 14 Mar 2020  Â·  14Comments  Â·  Source: MicrosoftDocs/WSL

I had WSL 1 running fine and co-existing with VirtualBox. I then upgraded my OS (that was due anyway) and upgraded to WSL 2, because I wanted to try it out and check the performance benefits. That caused VirtualBox to stop working (as described in various VB forum threads, etc.). I really needed VB, so I turned off Hyper-V (which is the thing that interferes with VB, apparently). Of course that breaks WSL 2. Just doing --set-version Ubuntu 1 is not enough to revert (though it "worked", i.e., the command did not complain, because I turned Hyper-V back on temporarily). But I would like to the run the "old" WSL version 1.

How do I revert?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: b19a43be-b16a-d903-b69d-75dffce6c329
  • Version Independent ID: f9d4a118-1251-8d6b-43f5-2e64808dc527
  • Content: Install WSL 2
  • Content Source: WSL/wsl2-install.md
  • Product: dev-environment
  • Technology: windows-subsystem-for-linux
  • GitHub Login: @craigloewen-msft
  • Microsoft Alias: crloewen

Most helpful comment

@eliotmoss you just need to disable the Virtual Machine Platform feature after converting all your distros back to WSL1.
Also don't forget to set the default version back to one.

dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /norestart
wsl --set-default-version 1

EDIT: Successfully tested this on my machine with WSL Ubuntu and VMWare Workstation 15.

All 14 comments

From the command shell, run: wsl.exe --set-version Ubuntu 1
From Windows Powershell, run: wsl --set-version Ubuntu 1

This assumes you are using Ubuntu.

That will downgrade the distro, but it does not downgrade the wsl /program/. The program still insists on having VirtualMachineExtensions turned on, which is what interferes with VirtualBox.

BTW if your goal was to run WSL and VirtualBox at the same time:
Latest release(6.1.4) of VirtualBox is now compatible with Hyper-V hypervisor again, as changelog describes.

Windows host: Restore the ability to run VMs through Hyper-V, at the expense of performance

Yes, I had seen that. Supposedly the performance penalty is _really_ bad. Sigh. Doesn't someone know how to revert the WSL _program_?

Sorry, didn't mean to close it - clicked wrong option.

@eliotmoss you just need to disable the Virtual Machine Platform feature after converting all your distros back to WSL1.
Also don't forget to set the default version back to one.

dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /norestart
wsl --set-default-version 1

EDIT: Successfully tested this on my machine with WSL Ubuntu and VMWare Workstation 15.

I'm assuming turning VirtualMachinePlatform to on enabled Hyper-V. Try to disable hyperV in Windows Services.

I know people are trying to be helpful, but the steps Arkhaeon suggested do not accomplish what is required. After doing them, when I try to start wsl I get:

Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. For information please visit https://aka.ms/wsl2-install

So it seems wsl itself is still version 2, which requires VMP. The _distro_ is version 1 (fine), but the newer wsl won't run it without VMP. (PS: A reboot did not affect this.)

@eliotmoss That's odd, I managed to do this yesterday because I needed to use VMWare virtualisation again... Perhaps check to see if you have installed any other distros that are on WSL2 with wsl -l -v.

Might also be worth trying converting your distro back to wsl2 wsl.exe --set-version Ubuntu 2 and back again wsl.exe --set-version Ubuntu 1.

My WSL is definitely working again with Virtual Machine Platform, Hyper-V and Windows Hypervisor platform features all disabled.

Ah! I _thought_ I had revert the Ubuntu distro to version 1, but it was still at version 2. I see a path forward, but I have a long backup running and can't reboot for while to test. I'll edit this comment when I can ...

Yeah I tried WSL2 before and hyper-v made my system unstable.

I heard WSL2 didn't need hyper-v anymore and now so tried again but got stuck and now I'm this position. Hyper -v wasn't installed but VMware can no longer run because of something else.

I created a system restore point before setting up but restoring doesn't change anything.

I reversed what I did dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /all /norestart
And restarted and still no effect.

I really hate that some feature prevents me from running applications and can't be undone without re-installing windows.

I found that a recent change to Windows mean there is an additional setting I had to change. It seems that some new security features are supported by running the kernel under Hyper-V -- it's called virtualization-based security. I ended up having to go down into bcdedit. I think the entry I change was nx, and I set it to OptIn. This is the no-execute feature (prevent executing instructions fetched from data-only pages), also called DEP (data execution prevention). Then you can turn off Windows Defender Advanced Threat Protections. (Settings->Windows Security->Core Isolation->Memory integrity, and Memory access protection. To make the nx change you mat need to turn Secure Boot off temporarily. In that case, if it is off and your disk it BitLocker encrypted, you'll need the BitLocker key for the drive. This is from memory, but I think it is the setting in question. In any case, the goal is to get the virtualization at boot not done, because that is what turns Hyper-V on, even when you've apparently turned it off. (What we really need is proper virtualization sharing between Windows and VirtualBox, but I don't know if that's in the cards).

From the command shell, run: wsl.exe --set-version Ubuntu 1
From Windows Powershell, run: wsl --set-version Ubuntu 1

This assumes you are using Ubuntu.

This was the solution for me. I'm on Win10 Home insiders preview Build 20226. All ports on WSL were closed. rolling back to WSL 1 solved the issue for me. Thank you!

None of these options are working for me. When I try to run any variant of wsl --set-version Ubuntu 1 I get:

Error: Oxffffffff
Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaxPowerWasTaken picture MaxPowerWasTaken  Â·  4Comments

skycommand picture skycommand  Â·  7Comments

sferich888 picture sferich888  Â·  3Comments

statup-github picture statup-github  Â·  4Comments

taoyichen picture taoyichen  Â·  8Comments