Step 1: Check your WSL version
systemd needs WSL 0.67.6 or newer. In PowerShell:
wsl --version wsl --update # if it's older
Step 2: Enable systemd
Inside the distro, edit /etc/wsl.conf (create it if it's missing):
[boot] systemd=true
On Debian-based distros Microsoft's docs also install systemd-sysv:
sudo apt-get update -y && sudo apt-get install systemd systemd-sysv -y
Step 3: Restart WSL
From PowerShell, shut every distro down, then reopen yours:
wsl.exe --shutdown
Confirm systemd is running inside the distro:
systemctl status | head -3 # should say "running"
Step 4: Enable cron
sudo apt install -y cron # if it's missing sudo systemctl enable --now cron systemctl status cron
Two WSL-specific catches
WSL shuts idle distros down
A WSL distro isn't a server. Microsoft's docs say WSL shuts a distro down once it has been idle for instanceIdleTimeout milliseconds (default 15000), and it typically stops about 8 seconds after you close every shell. Jobs scheduled while it's stopped don't run. If your jobs stop when you close the terminal, disable the idle shutdown in %UserProfile%\.wslconfig:
[general] instanceIdleTimeout=-1
For something that must run on schedule on Windows, use Windows Task Scheduler (it can call wsl.exe -d Ubuntu -- /path/to/script.sh): see Task Scheduler ↔ cron.
Without systemd: start cron by hand
If you can't enable systemd, start cron's init script each session:
sudo service cron start
It still stops when WSL shuts down.
Sources
Checked against these official sources and, where marked, tested on Ubuntu 24.04 (cron 3.0pl1-184ubuntu2). Last verified 18 November 2026.