Hello there,
How did you enable the enable systemd ?
You can try to disable systemd in conf and manually start systemd using this script and see if that helps
Currently, you need a process running that's a child of the Microsoft init (like an interactive shell) to keep WSL from idle-terminating. If you don't want to leave something open, you can always nohup something.
This may change in future; there's an issue open about it here: https://github.com/microsoft/WSL/issues/8854
MS's suggested solution for this request is that you start a tmux session and leave it running. You can even easily automate this.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–