This few steps will enable SYSTEMD on your WSL2. By enabling SYSTEMD you will be able to run snaps, docker, heroku and many more features.
This guide was made and tested on Windows 11, using Ubuntu 20.04 LTS in WSL2.
- Windows 11 (it should also work on Windows 10)
- WSL2
- SYSTEMD-GENIE
- Copy the
install-sg.sh
file:
cd /tmp
wget --content-disposition \
"https://gist.github.com/annasoldih/05a3423c877eae701076436cf00bbd43#file-install-sg-sh"
-
Make the
install-sg.sh
file executable:chmod +x /tmp/install-sg.sh
-
Run the executable file:
/tmp/install-sg.sh && rm /tmp/install-sg.sh
-
Restart your computer
-
You can check if it is already working on your WSL terminal:
sudo systemctl status time-sync.target
-
If it is not working, you can enable it on your powershell terminal:
wsl genie -s
-
Test it again on your WSL terminal:
sudo systemctl status time-sync.target