Docker Service is Not Starting Automatically at WSL Start
Windows Version
Microsoft Windows [Version 10.0.22631.5472]
WSL Version
2.5.7.0
Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
Kernel Version
6.6.87.1-1
Distro Version
Ubuntu 22.04
Other Software
Docker installed inside WSL distro according to [1].
Client: Docker Engine - Community
Version: 28.2.2
API version: 1.50
Go version: go1.24.3
Git commit: e6534b4
Built: Fri May 30 12:07:28 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 28.2.2
API version: 1.50 (minimum version 1.24)
Go version: go1.24.3
Git commit: 45873be
Built: Fri May 30 12:07:28 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
[1] https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
Repro Steps
Configure docker to be ran automatically at start of WSL:
/etc/wsl.conf
[boot]
command="service docker start"
[network]
generateResolvConf = false
- Shut down WSL using
wsl --shutdown - start WSL
- check state of docker service
service docker statusgives* Docker is not running - starting docker service manually using
sudo service docker startafterwards works fine
This stopped working after running a wsl --update. I don't know which version was installed before in detail, but it was a 5.15 kernel for sure.
Expected Behavior
The docker service is started automatically at start of WSL.
Actual Behavior
The docker service is not started automatically at start of WSL.
Diagnostic Logs
No response
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here
Once completed please upload the output files to this Github issue.
Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
Try enabling systemd. In /etc/wsl.conf add this:
[boot] systemd=true
Try enabling systemd. In /etc/wsl.conf add this:
Yeah, that works for me. I was just wondering if it's intended to no longer work without systemd anymore. Since logs contain some proprietary/confidential information I can't share them here.
But since I can live with the systemd solution for now, I'll close this ticket.
This seems to be the same problem as https://github.com/microsoft/WSL/issues/12985