- Save the services.sh file to your computer in a location like
C:/tools/wsl-startup/. - Download the WSL Statup.xml and import it into Task Scheduler.
- Modify as needed for you personal use.
-
-
Save kriiv/c83e2adf8a6a86dc03375dc949cebe1b to your computer and use it in GitHub Desktop.
WSL Startup Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo service dbus start | |
| sudo service cron start | |
| sudo service atd start | |
| sudo service memcached start | |
| sudo service redis-server start | |
| sudo service mysql start | |
| sudo service php7.4-fpm start | |
| sudo service nginx start | |
| bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-16"?> | |
| <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
| <RegistrationInfo> | |
| <Date>2020-03-16T14:14:50.2948542</Date> | |
| <Author>DESKTOP-GV81FFD\samrh</Author> | |
| <URI>\WSL Startup</URI> | |
| </RegistrationInfo> | |
| <Triggers> | |
| <BootTrigger> | |
| <Enabled>true</Enabled> | |
| </BootTrigger> | |
| </Triggers> | |
| <Principals> | |
| <Principal id="Author"> | |
| <UserId>S-1-5-21-1767457005-3651416866-2414491648-1001</UserId> | |
| <LogonType>S4U</LogonType> | |
| <RunLevel>LeastPrivilege</RunLevel> | |
| </Principal> | |
| </Principals> | |
| <Settings> | |
| <MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy> | |
| <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> | |
| <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> | |
| <AllowHardTerminate>false</AllowHardTerminate> | |
| <StartWhenAvailable>false</StartWhenAvailable> | |
| <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> | |
| <IdleSettings> | |
| <StopOnIdleEnd>true</StopOnIdleEnd> | |
| <RestartOnIdle>false</RestartOnIdle> | |
| </IdleSettings> | |
| <AllowStartOnDemand>true</AllowStartOnDemand> | |
| <Enabled>true</Enabled> | |
| <Hidden>false</Hidden> | |
| <RunOnlyIfIdle>false</RunOnlyIfIdle> | |
| <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession> | |
| <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine> | |
| <WakeToRun>false</WakeToRun> | |
| <ExecutionTimeLimit>PT0S</ExecutionTimeLimit> | |
| <Priority>7</Priority> | |
| </Settings> | |
| <Actions Context="Author"> | |
| <Exec> | |
| <Command>C:\Windows\System32\wsl.exe</Command> | |
| <Arguments>sh /mnt/c/tools/wsl-startup/services.sh</Arguments> | |
| </Exec> | |
| </Actions> | |
| </Task> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment