DEV Community

Discussion on: Install Fedora 37 or earlier on Windows Subsystem for Linux (WSL)

Collapse
 
krrishdhaneja profile image
Krrish Dhaneja • Edited

how do I start a service(like ssh) if I can't use systemctl in wsl? And how do I install SysVinit?

Collapse
 
operation420_net profile image
operation420_net

Hope my reply helpz

Collapse
 
operation420_net profile image
operation420_net • Edited

I got cron working in Fedora and Ubuntu on WSL.

Carlos at Whitewater Foundry was most helpful. Here is his reply to my email:

There is a solution that replaces systemctl by a python script that reads the service files and tries to start the services. We don’t distribute it with Fedora Remix because it has mixed results. For example, it works for cron and ssh but no for databases in general. Even in SSH, you need to do an extra step.

Follow these steps to start cron service in Fedora Remix. Works with WSL1 & WSL2:

wget raw.githubusercontent.com/gdraheim...

sudo cp /usr/bin/systemctl /usr/bin/systemctl.bak

sudo cp systemctl3.py /usr/bin/systemctl

sudo dnf install cronie cronie-anacron

crontab -e # Edit your crontab

sudo systemctl start crond

Be aware that each time that the package systemd is updated, you need to run the first three lines of the script.