question

60766043 avatar image
60766043 asked ·

WSL and Windows integration?

Some services are spinning in WSL. How can I autostart WSL services on Windows?
I think you can use the Windows task scheduler (not the task manager), but there is a problem - Windows uses UAC, and ubuntu 18.04 uses sudo, but it is not possible to combine them (you can tinker with LDAP, AD and RADIUS, but you need Linux accounts to forward Windows Server)
What to do and how to configure autostart of Linux services from Windows?

not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

gekka avatar image
gekka answered ·

Hi 60766043,

For example, to start postfix in WSL1, you can register the following command in Task Manager.

 wsl -u root -- sudo postfix start

This is registered with the following command.

 schtasks /create /tn postfix /sc onstart /delay 0000:30 /tr "wsl.exe -u root -- sudo postfix start"
Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FayWang-MSFT avatar image
FayWang-MSFT answered ·

Hello,​

Welcome to our Microsoft Q&A platform!

The Q&A platform is currently in the preview stage. Your question is more relevant to WSL and is not currently supported. It is recommended that ou can ask questions on github.

Thanks.


Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.