Docker Desktop WSL Kernel Version To

Introduction

Docker is a popular platform that allows you to automate the deployment, scaling, and management of applications using containers. Docker Desktop is an application for MacOS and Windows that enables you to run Docker containers on your local machine. With the release of Docker Desktop 2.4.0, it introduced the use of the Windows Subsystem for Linux 2 (WSL 2) as the backend for running Docker containers on Windows. In this article, we will explore how to check and update the WSL kernel version used by Docker Desktop.

Checking WSL Kernel Version

To check the WSL kernel version used by Docker Desktop, you can run the following command in the Windows Command Prompt or PowerShell:

wsl --set-version <distribution name> <version number>

Replace <distribution name> with the name of your WSL distribution, such as "Ubuntu-20.04", and <version number> with the desired WSL kernel version, such as "2". This command sets the default WSL version for the specified distribution.

To verify the WSL kernel version, you can use the following command:

wsl --list --verbose

This command lists all the installed WSL distributions along with their versions and other details. Look for the "Version" column to determine the kernel version.

Updating WSL Kernel Version

To update the WSL kernel version used by Docker Desktop, follow these steps:

  1. Open the Docker Desktop application on your Windows machine.
  2. Click on the Docker icon in the system tray and select "Settings" from the context menu.
  3. In the Docker Settings window, navigate to the "Resources" section.
  4. Under the "WSL Integration" tab, you will see a list of installed WSL distributions.
  5. Locate the distribution you want to update and click on the "Settings" button next to it.
  6. In the distribution settings, you will find an option to select the WSL kernel version.
  7. Choose the desired version from the dropdown menu and click on the "Apply & Restart" button.

After Docker Desktop restarts, it will use the updated WSL kernel version for running containers.

Conclusion

In this article, we explored how to check and update the WSL kernel version used by Docker Desktop on Windows. By upgrading to the latest WSL kernel version, you can take advantage of the improved performance and compatibility offered by WSL 2. Remember to always check the compatibility of your WSL distributions and applications before updating the kernel version.

The journey to using the latest WSL kernel version with Docker Desktop is a simple process:

journey
    title Docker Desktop WSL Kernel Version To
    section Checking WSL Kernel Version
        Start --> Check WSL kernel version: Code(wsl --list --verbose)
    section Updating WSL Kernel Version
        Check WSL kernel version --> Open Docker Desktop
        Open Docker Desktop --> Click on "Settings"
        Click on "Settings" --> Navigate to "Resources" section
        Navigate to "Resources" section --> Click on "WSL Integration" tab
        Click on "WSL Integration" tab --> Locate distribution and click on "Settings"
        Locate distribution and click on "Settings" --> Choose desired WSL kernel version
        Choose desired WSL kernel version --> Click on "Apply & Restart"
    section Conclusion
        Click on "Apply & Restart" --> Docker Desktop restarts with updated WSL kernel version

Now you have the knowledge to manage the WSL kernel version used by Docker Desktop, enabling you to leverage the latest features and improvements in your containerized development workflows. Happy containerizing!