microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.23k stars 810 forks source link

Integrate Linux Services with Windows Services #5842

Open alisci01 opened 4 years ago

alisci01 commented 4 years ago

Is your feature request related to a problem? Please describe. I have a home server on Windows 10 that I would like to run a bunch of Linux services on automatically, on boot.

Describe the solution you'd like Have the Windows services system startup services on distros of interest, with at least the capability of having it work on a Local System account.

Describe alternatives you've considered The only working alternative that I have right now is scripts that start up as soon as my admin user signs on (who is configured to login automatically). I've also tried to write a Windows service myself in C# but kept running into permission issues. Really, every alternative I've tried has been rife with permission issues.

WSLUser commented 4 years ago

You can do this yourself to an extent using Task Manager using the wsl.exe or distro.exe. If you also install Windows Terminal, you could configure it to open upon login and you can create a script to open certain tabs/profiles that also run services. I suggest getting more info about this on the Windows Terminal repo though.

ameeno commented 4 years ago

Hello @WSLUser

That is very interesting. would it be possible to restart a windows service from WSL2 using a bash script?

can you explain how?