Support for starting the Linux services in Windows Subsystem for Linux (WSL) on Windows startup.
Table of Contents
- Clone to any directory using the git command: (e.g
git clone https://github.com/troytse/wsl-autostart
/etc/sudoersin the WSL to specify the service commands calling on startup without a password. e.g:
%sudo ALL=NOPASSWD: /etc/init.d/cron %sudo ALL=NOPASSWD: /etc/init.d/ssh %sudo ALL=NOPASSWD: /etc/init.d/mysql %sudo ALL=NOPASSWD: /etc/init.d/apache2
commands.txtin the wsl-autostart directory to specify the service commands for your need. e.g:
/etc/init.d/cron /etc/init.d/ssh /etc/init.d/mysql /etc/init.d/apache2
gpedit.msc, it is possible to define a program that runs when the computer starts
Note that the configured program will run as the system user.
taskschd.msc, it is possible to schedule a task after the startup of the computer.
You may configure which user will run the program, a delay before a run and a number of retries. the same
taskschd.mscprogram will show a specific log regarding the execution of the task