Table of Content

Condition to install WSL2 on win10

This is condition to install wsl2 on win10:

  • win10 release: Windows 10 May 2020 (2004), Windows 10 May 2019 (1903), or Windows 10 November 2019 (1909) or later
  • Hyper-V

There are 3 similar features in tool "Turn Windows features on or off", easy to get confused,

  • Hyper-V – behind of WSL2 VM
  • Virtual Machine Platform – WSL2
  • Windows Hypervisor Platform – nested virtualization

So at least we need "Hyper-V" and "Virtual Machine Platform", need reboot after change.

Hyper-V conflicts with Hypervisor in win10

This is most annoy Hyper-V cannot work well with common Hypervisor:

  • not work with Virtualbox at all
  • conditional work with vmware: Windows 10 20H1 build 19041.264 or newer and vmware Workstation 15.5.5 or newer

Upgrade WSL to WSL2

Taking my case as example, it is build 18363.1801, release 1909, so should be qualified to install wsl2.

First of all need to download WSL2 kernel update and install it,

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

then upgrade to WSL2 in Powershell run as admin,

PS C:\Users\oldhorse> wsl --set-default-version 2
PS C:\Users\oldhorse> wsl --set-version Ubuntu 2
PS C:\Users\oldhorse> wsl -l -v
    N A M E             S T A T E                       V E R S I O N 

 *   U b u n t u         S t o p p e d                   2

Test on WSl2

cannot update,

oldhorse@:~$ sudo apt-get update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.ubuntu.com'

There seems not internet access for wsl2, can ping to nameserver even 8.8.8.8 but nothing else.

oldhorse@:~$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.17.91.49

oldhorse@:~$ ping 172.17.91.49
PING 172.17.91.49 (172.17.91.49) 56(84) bytes of data.
64 bytes from 172.17.91.49: icmp_seq=1 ttl=128 time=0.349 ms
64 bytes from 172.17.91.49: icmp_seq=2 ttl=128 time=1.17 ms
^C
--- 172.17.91.49 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1018ms
rtt min/avg/max/mdev = 0.349/0.757/1.166/0.408 ms
oldhorse@:~$

oldhorse@:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=111 time=15.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=111 time=16.6 ms
^C

There are many discussions and remedies but I gave up at this point, main reason is that no idea how to survive without Virtualbox available 😂

Rollback

If you are not happy with Hyper-V, turn it off, then existing WSL2 useless, stuck there,

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
Press any key to continue...

So only way "rollback" to WSL1 is to uninstall WSL2, then re-install new instance of WSL1.

Remember to set back wsl to version 1 before re-install wsl from store,

 
PS C:\Users\oldhorse> wsl --set-default-version 1