WSL and Windows integration?

Глеб Гребенщиков 26 Reputation points
2020-04-05T11:57:43.407+00:00

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 Monitored
Not Monitored
Tag not monitored by Microsoft.
36,204 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. gekka 6,766 Reputation points MVP
    2020-04-06T07:24:28.793+00:00

    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"
    
    0 comments No comments

  2. Fay Wang - MSFT 5,196 Reputation points
    2020-04-09T05:40:00.827+00:00

    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.

    0 comments No comments