Unable to start WSL from a Scheduled Task

KMW-2262 6 Reputation points

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?

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.
5,083 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,096 Reputation points

    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--