WSL 1
WSL, the binary translation layer which we now call WSL 1, has served us well. WSL 1 has given us nearly-complete Linux syscall support and is a stable and mature platform. WSL 1 will continue to be an excellent option for WSL users. WSL 1 has a smaller resource footprint on low-spec devices and has simplified networking. Many enterprise and institutional users will be on a WSL 1-only build of Windows 10 for several more months or in some cases years after WSL 2 is released. WSL 1 is part of Windows 10 Enterprise LTSC and Windows Server 2019 which will be supported until 2024. We can expect WSL 1 to get critical fixes even as the WSL team at Microsoft turns their focus to WSL 2.
Issue 4989
An example of the WSL team continuing to service WSL 1 for now is a patch for issue 4989. Issue 4989 arises from a patch in glibc 2.31 that implements a nanosleep() library call in a more UNIX-like manner based on CLOCK_REALTIME. Emulating UNIX system clocks on an NT kernel is tricky. WSL 1 implemented the most popular clock-based system calls, but not all of them, and did not build CLOCK_REALTIME support into nanosleep. But because this is such a fundamental change in glibc the WSL team is very graciously implementing support for CLOCK_REALTIME in nanosleep in WSL 1 and will be backporting it in updates to existing builds. This is a challenging task that will take some time. In contrast, other more obscure system clock calls, like the one raised in issue 4973, will likely not see implementation in WSL 1.
What does this mean for Ubuntu on WSL?
The upcoming Ubuntu 20.04 implements glibc 2.31. Unless you are on Insider you have not gotten the fix for issue 4989 yet and likely will not for a couple months. Without the fix things tend to break on Ubuntu 20.04 on WSL 1, sometimes even in the upgrade process to Ubuntu 20.04. For example htop doesn’t work on Ubuntu 20.04 on unpatched WSL 1.
You can check your Windows 10 build from WSL with:
$ winver.exe
What is the plan?
For WSL 1 users, I recommend you sit tight on Ubuntu 18.04 for now. The patch for issue 4989 will take some time to be backported. Ubuntu 18.04 is an LTS release, short for long-term servicing, and is supported through 2023 so you will continue to get security patches and backports from Canonical in the meantime.
For WSL 2 users, you are free to upgrade to Ubuntu 20.04 when it drops, or even early to help us test.
WSL 2 is currently only available on Windows Insider Slow and Fast rings. WSL 2 will be landing in the release branch of Windows 10 with Windows 2004 in the next few weeks.
For WSL 1 users upgrading to WSL 2, such as when 2004 becomes available outside Insiders, you should convert your Ubuntu 18.04 image to WSL 2 first with:
$ wsl.exe --set-version Ubuntu 2
and then upgrade to Ubuntu 20.04.
tl;dr If you are using WSL 1 don’t upgrade to Ubuntu 20.04 quite yet, wait until an update fixes an issue or upgrade to WSL 2 when it is released.
Okay, what if I want to upgrade WSL 1 to Ubuntu 20.04 anyways?
Before you upgrade, you can block libc6 from being upgraded:
$ sudo apt-mark hold libc6