service docker start doesn't work if systemd is enabled
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
### Windows Version
Microsoft Windows [Version 10.0.26100.2314]
### WSL Version
2.3.26.0
### Are you using WSL 1 or WSL 2?
- [x] WSL 2
- [ ] WSL 1
### Kernel Version
Linux version 5.15.167.4-microsoft-standard-WSL2 (root@f9c826d3017f) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP Tue Nov 5 00:21:55 UTC 2024
### Distro Version
Ubuntu 22.04.3 LTS
### Other Software
`docker --version` (in WSL / Ubuntu) returns this:
```
Docker version 25.0.3, build 4debf41
```
`wsl --version` (in Windows) returns this:
```
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.2314
```
### Repro Steps
`service docker start`
### Expected Behavior
I'd expect `service docker start` to run without error.
### Actual Behavior
`service docker start` gives this error:
```
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
```
### Diagnostic Logs
Here's the output of `systemctl status docker.service`:
```
× docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-11-21 04:35:46 CST; 4min 35s ago
TriggeredBy: × docker.socket
Docs: https://docs.docker.com
Process: 1922 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 1922 (code=exited, status=1/FAILURE)
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: Stopped Docker Application Container Engine.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: docker.service: Start request repeated too quickly.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: docker.service: Failed with result 'exit-code'.
Nov 21 04:35:46 DESKTOP-OF86R9V systemd[1]: Failed to start Docker Application Container Engine.
```
Here's the output of `journalctl -xeu docker.service`:
https://pastebin.com/5u5vWS87
If I have this in my `/etc/wsl.conf` file `service docker start` doesn't work:
```
[boot]
systemd=true
```
If I comment out the `systemd=true` bit `service docker start` works but not with that line in place.
Contributor guide
Research direction
Reproduce `service docker start` on WSL 2 with `[boot] systemd=true` in `/etc/wsl.conf`, then compare `systemctl status docker.service` and `journalctl -xeu docker.service` with the configuration where systemd is disabled. Done means Docker starts successfully while systemd is enabled, or the incompatibility is documented with a clear diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100