Created
August 5, 2021 14:53
-
-
Save Senpai-Codes/c12c3939af9feace7147d23e24736fde to your computer and use it in GitHub Desktop.
WSL Run Script on Startup
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
| #answer from https://superuser.com/questions/1343558/how-to-make-wsl-run-services-at-startup | |
| Step-1: Create line in /etc/sudoers (at WSL to prevent asking password): | |
| %sudo ALL=(ALL) NOPASSWD: /usr/sbin/service mysql start | |
| Step-2: Create .bat file in Windows startup directory with this line (dir find here: Win+R and shell:startup): | |
| wsl sudo service apache2 start | |
| wsl sudo service mysql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment