WSL2 / Docker Dev / Ubuntu 22.04 systemd - How to use¶
The following info was pulled from latest release v1.9.
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.9.tar.gz https://gitlab.com/api/v4/projects/41026181/packages/generic/v1.9/v1.9/wsl-docker-dev-ubuntu-22.04-systemd-v1.9.tar.gz
Ensure your default WSL version is 2¶
Import WSL docker dev distribution with a custom name¶
Note: format is wsl --import <custom-distro-name> <data-folder-for-wsl> <downloaded file>
Post-import steps¶
Optionally set new distro to be WSL command default¶
Note: Windows terminal follows it's own default WSL.
Start up new and ready wsl2 docker dev distro in linux home folder¶
Things to test or look into¶
docker ps
,docker compose
,docker-dev info
.- Developing with VSCode in WSL
- Get started with Devcontainers in WSL
- Try a Rust devcontainer:
git clone https://gitlab.com/geekstuff.dev/playground/rust-cli.git
code -n rust-cli/
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