Unable to start WSL from a Scheduled Task

KMW-2262 6 Reputation points
2023-02-27T09:58:24.5166667+00:00

When I attempt to start WSL from a scheduled task, I get "Action completed" showing:
Task Scheduler successfully completed task "\WSL init script" , instance "{99d75e3f-a917-4eee-80b5-36f2023c29d7}" , action "C:\Windows\System32\wsl.exe" with return code 2147942401.User's image

and WSL is not running.

How can I overcome this issue?

Windows for business | Windows Client for IT Pros | User experience | Other
{count} vote

1 answer

Sort by: Most helpful
  1. Limitless Technology 45,181 Reputation points
    2023-02-28T13:48:14.0033333+00:00

    Hello there,

    Try the workaround posted in this thread https://github.com/microsoft/WSL/issues/8835

    The scheduled task will only work if the MSA account is in the Administrators group. If it is, then I can restart the server and the task will successfully kick off WSL and run that script.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.