Skip to content

WSL2 / Docker Dev / Ubuntu 22.04 systemd - How to use

The following info was pulled from latest release v1.7.

How to use

Short and simple instructions, generated per each release, on how to import configure and use the dev focused WSL images with docker engine embedded.

Ensure you can run WSL with native systemd

WSL with native systemd is currently in preview. You should be able to run the command wsl --version without errors if you have the right wsl version.

More info for systemd support is available in common/dev-setup README

Start a new Windows shell/terminal and download WSL docker dev distribution

curl.exe -o wsl-docker-dev-ubuntu-22.04-systemd-v1.7.tar.gz

Ensure your default WSL version is 2

wsl --set-default-version 2

Import WSL docker dev distribution with a custom name

Note: format is wsl --import <custom-distro-name> <data-folder-for-wsl> <downloaded file>

wsl --import my-docker-dev .\wsl-my-docker-dev wsl-docker-dev-ubuntu-22.04-systemd-v1.7.tar.gz

Post-import steps

wsl -d my-docker-dev post-import-setup

Optionally set new distro to be WSL command default

Note: Windows terminal follows it's own default WSL.

wsl --setdefault my-docker-dev

Start up new and ready wsl2 docker dev distro in linux home folder

wsl ~ -d my-docker-dev

Things to test or look into

For further info on how this was built and how to use it, see this project source code and the common/dev-setup project.

Propose changes to this page