Skip to content

Instantly share code, notes, and snippets.

@topalex
Last active June 11, 2021 10:32
Show Gist options
  • Save topalex/8f5d8dc5452a4d3f5bb2cbfef20ec376 to your computer and use it in GitHub Desktop.
Save topalex/8f5d8dc5452a4d3f5bb2cbfef20ec376 to your computer and use it in GitHub Desktop.
Auto-start services in WSL
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"WSLAutostart"="C:\\wsl-start.bat"
@echo off
set services="/etc/init.d/redis-server","/etc/init.d/nginx"
wsl echo OK >nul 2>nul
if %errorlevel% == 0 (for %%i in (%services%) do (wsl sudo %%~i start))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment