Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert from WSL2 to WSL1

I am a big fan of WSL and was totally psyched when they announced WSL2. However, the official Docs said that WSL2 isn't as performant as WSL1 when it comes to working with files in the Windows File system. This is kind of a bummer because most of my work is in the Windows File System itself and I would like to keep it that way.

But for the sake of checking it out, I converted my main Distro to WSL2:

wsl --set-version Ubuntu-18.04 2

The conversion was successful. Then when I ran

cd
explorer.exe .

It launched a file explorer in Network\wsl$\Ubuntu-18.04\home\user. I knew that this is a feature in WSL2; that we could access the Linux file system using the Windows Explorer.

However, I then decided to revert back to WSL1 (file system access). So I ran the command:

wsl --set-version Ubuntu-18.04 1

And just to cross check, running

wsl --list --verbose

Lists my main distro as running version 1.

But now if I head over to ~ and run explorer.exe ., it still opens up the directory in the File Explorer! AFAIK, this normally gives the error that windows can't access file paths with the Linux structure or something like that when run with WSL1.

So I was wondering if this is normal, or did it happen because of the reversion, or did I somehow break my installation?

TIA!

like image 282
dkapur17 Avatar asked Jun 20 '20 07:06

dkapur17


People also ask

How do I revert from WSL2 to WSL1?

To set the default version to WSL 1 or WSL 2 when a new Linux distribution is installed, use the command: wsl --set-default-version <Version#> , replacing <Version#> with either 1 or 2.

Can I use both WSL1 and WSL2?

Show activity on this post. Yes. Windows 10 can have both WSL1 and WSL2 active.

Is WSL1 faster than WSL2?

File performance across the Windows and Linux operating systems is faster in WSL 1 than WSL 2, so if you are using Windows applications to access Linux files, you will currently achieve faster performance with WSL 1.

What is the difference between WSL1 and WSL2?

The primary differences between WSL 1 and WSL 2 are the use of an actual Linux kernel inside a managed VM, support for full system call compatibility, and performance across the Linux and Windows operating systems.


1 Answers

Type this command to grab the version of distro

wsl -l -v

Then type this command to roll back / set default version

  wsl --set-version Ubuntu-20.04 1

It will output something like - Conversion in progress, this may take a few minutes...

Then try wsl -l -v command again, and check the result

In my case results before and after are

  NAME                   STATE           VERSION
* Ubuntu-20.04           Stopped         2
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2

and after

  NAME                   STATE           VERSION
* Ubuntu-20.04           Stopped         1
  docker-desktop         Stopped         2
  docker-desktop-data    Stopped         2

EDIT

Actually I read description of the question, after leaving this comment, and I guess I'm not answering on it at all, but I have decided to leave it here, because it can be helpful for someone who are trying to figure it out!

like image 104
Gh111 Avatar answered Oct 30 '22 00:10

Gh111