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
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,794 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Limitless Technology 43,966 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--