April 16th, 2021
0 reactions

Servicing the Windows Subsystem for Linux (WSL) 2 Linux kernel

Principal Product Manager

Note: This blog post is co-authored by the awesome WSL dev Pierre Boulay. Thanks Pierre! 😊

We’ve just shipped the 5.10.16.3 WSL 2 Linux kernel version to Windows Insiders which brings exciting new changes: Support for the LUKS disk encryption, and some long-awaited bug fixes. We’d like to seize this opportunity to highlight these improvements and show you how these changes land on your Windows machine no matter your Windows version.

New feature addition: Support for LUKS disk encryption

This kernel update adds support for LUKS disk format. Such disks can now we accessed using wsl –mount.

LUKS disks can be mounted through the following steps: (Refer to distro specific instructions to install cryptsetup if needed).

$ wsl --mount [disk-id] --bare
$ wsl cryptsetup luksOpen /dev/sdX my-device # Replace /dev/sdX with the block device path in WSL.
$ wsl mkdir /mnt/wsl/my-mountpoint
$ wsl mount /dev/mapper/my-device /mnt/wsl/my-mountpoint

The disk content can then be accessed by navigating to \\wsl$\<yourDistroName>\mnt\wsl (Replace with the name of your distro, any disto works). Please check the wsl –mount docs page for full instructions on how to mount a disk in WSL.

Bug fix: Clock sync

This new kernel version also contains a bug fix for a clock sync issue (Github Issue #5324). This issue causes the clock inside of your WSL 2 instances to be different than the actual time on your host machine. This bug was fixed entirely by changes inside of the Linux kernel itself that are present in this latest version.

Our kernel servicing process

These changes are very easy to get onto your machine, in fact it’s likely you won’t even notice that you are put onto the latest kernel version! We leverage Microsoft Update to ship this to you, and by hitting ‘Check for Updates’ in your settings, or just letting your computer update like normal, you’ll be kept up to date.